mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-05-03 23:43:43 +02:00

represent complex locations (required for full x86-64 ABI support, which is not yet implemented) -> lots of special result handling code has been removed and replaced by the parameter handling routines + added support for composite parameters (and hence function results) to tcg.a_load_ref_cgpara() (so it can be used for handling, e.g., 64 bit parameters on 32 bit platforms) * the above fixed writing past the end of allocated memory when handling records returned in registers on x86-64 whose size is not a multiple of 8 bytes (mantis #16357) - removed the x86-64 and PPC specific versions of a_load_ref_cgpara(), as they are now handled correctly by the generic version * moved the responsibility of allocating tcgpara cpu registers (using paramanager.allocparaloc()) from the callers of cg.a_load*_cgpara() to the cg.a_load*_cgpara() methods themselves (so the register allocation can be done efficiently when dealing with function results) * for the above, renamed paramanager.alloc/freeparaloc() to paramanager.alloc/freecgpara(), and use paramanager.allocparaloc() to allocate individual pcgparalocations instead * fixed the register size of SSE2 function result registers for x86-64 (when used for floating point), which results in removing a few superfluous "movs? %xmm0,%xmm0" instructions * fixed compilation of paramanagers of avr, m68k and mips after r13695 and also updated them for these new changes git-svn-id: trunk@15350 -
75 lines
2.2 KiB
ObjectPascal
75 lines
2.2 KiB
ObjectPascal
{
|
|
Copyright (c) 2002 by Florian Klaempfl
|
|
|
|
Implements the ARM specific part of call nodes
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
****************************************************************************
|
|
}
|
|
unit narmcal;
|
|
|
|
{$i fpcdefs.inc}
|
|
|
|
interface
|
|
|
|
uses
|
|
symdef,node,ncal,ncgcal;
|
|
|
|
type
|
|
tarmcallnode = class(tcgcallnode)
|
|
procedure set_result_location(realresdef: tstoreddef);override;
|
|
end;
|
|
|
|
implementation
|
|
|
|
uses
|
|
verbose,globtype,globals,aasmdata,
|
|
symconst,
|
|
cgbase,
|
|
cpubase,cpuinfo,
|
|
ncgutil,
|
|
paramgr;
|
|
|
|
procedure tarmcallnode.set_result_location(realresdef: tstoreddef);
|
|
begin
|
|
if (realresdef.typ=floatdef) and
|
|
((cs_fp_emulation in current_settings.moduleswitches) or
|
|
(current_settings.fputype in [fpu_vfpv2,fpu_vfpv3])) then
|
|
begin
|
|
{ keep the fpu values in integer registers for now, the code
|
|
generator will move them to memory or an mmregister when necessary
|
|
(avoids double moves in case a function result is assigned to
|
|
another function result, or passed as a parameter) }
|
|
case retloc.size of
|
|
OS_32,
|
|
OS_F32:
|
|
location_allocate_register(current_asmdata.CurrAsmList,location,s32inttype,false);
|
|
OS_64,
|
|
OS_F64:
|
|
location_allocate_register(current_asmdata.CurrAsmList,location,s64inttype,false);
|
|
else
|
|
internalerror(2010053008);
|
|
end
|
|
end
|
|
else
|
|
inherited;
|
|
end;
|
|
|
|
|
|
begin
|
|
ccallnode:=tarmcallnode;
|
|
end.
|