|
@@ -30,10 +30,10 @@ unit cpupara;
|
|
globtype,globals,
|
|
globtype,globals,
|
|
aasmtai,aasmdata,
|
|
aasmtai,aasmdata,
|
|
cpuinfo,cpubase,cgbase,cgutils,
|
|
cpuinfo,cpubase,cgbase,cgutils,
|
|
- symconst,symbase,symtype,symdef,parabase,paramgr;
|
|
|
|
|
|
+ symconst,symbase,symtype,symdef,parabase,paramgr,armpara;
|
|
|
|
|
|
type
|
|
type
|
|
- tcpuparamanager = class(tparamanager)
|
|
|
|
|
|
+ tcpuparamanager = class(tarmgenparamanager)
|
|
function get_volatile_registers_int(calloption: tproccalloption): tcpuregisterset; override;
|
|
function get_volatile_registers_int(calloption: tproccalloption): tcpuregisterset; override;
|
|
function get_volatile_registers_fpu(calloption: tproccalloption): tcpuregisterset; override;
|
|
function get_volatile_registers_fpu(calloption: tproccalloption): tcpuregisterset; override;
|
|
function get_volatile_registers_mm(calloption: tproccalloption): tcpuregisterset; override;
|
|
function get_volatile_registers_mm(calloption: tproccalloption): tcpuregisterset; override;
|
|
@@ -52,6 +52,7 @@ unit cpupara;
|
|
|
|
|
|
procedure init_para_alloc_values;
|
|
procedure init_para_alloc_values;
|
|
procedure alloc_para(out result: tcgpara; p: tabstractprocdef; varspez: tvarspez; side: tcallercallee; paradef: tdef; isvariadic, isdelphinestedcc: boolean);
|
|
procedure alloc_para(out result: tcgpara; p: tabstractprocdef; varspez: tvarspez; side: tcallercallee; paradef: tdef; isvariadic, isdelphinestedcc: boolean);
|
|
|
|
+ function getparaloc(calloption: tproccalloption; p: tdef): tcgloc;
|
|
|
|
|
|
procedure create_paraloc_info_intern(p: tabstractprocdef; side: tcallercallee; paras: tparalist; isvariadic: boolean);
|
|
procedure create_paraloc_info_intern(p: tabstractprocdef; side: tcallercallee; paras: tparalist; isvariadic: boolean);
|
|
end;
|
|
end;
|
|
@@ -106,83 +107,7 @@ unit cpupara;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
- function is_hfa_internal(p: tdef; var basedef: tdef; var elecount: longint): boolean;
|
|
|
|
- var
|
|
|
|
- i: longint;
|
|
|
|
- sym: tsym;
|
|
|
|
- tmpelecount: longint;
|
|
|
|
- begin
|
|
|
|
- result:=false;
|
|
|
|
- case p.typ of
|
|
|
|
- arraydef:
|
|
|
|
- begin
|
|
|
|
- if is_special_array(p) then
|
|
|
|
- exit;
|
|
|
|
- { an array of empty records has no influence }
|
|
|
|
- if tarraydef(p).elementdef.size=0 then
|
|
|
|
- begin
|
|
|
|
- result:=true;
|
|
|
|
- exit
|
|
|
|
- end;
|
|
|
|
- tmpelecount:=0;
|
|
|
|
- if not is_hfa_internal(tarraydef(p).elementdef,basedef,tmpelecount) then
|
|
|
|
- exit;
|
|
|
|
- { tmpelecount now contains the number of hfa elements in a
|
|
|
|
- single array element (e.g. 2 if it's an array of a record
|
|
|
|
- containing two singles) -> multiply by number of elements
|
|
|
|
- in the array }
|
|
|
|
- inc(elecount,tarraydef(p).elecount*tmpelecount);
|
|
|
|
- if elecount>4 then
|
|
|
|
- exit;
|
|
|
|
- result:=true;
|
|
|
|
- end;
|
|
|
|
- floatdef:
|
|
|
|
- begin
|
|
|
|
- if not assigned(basedef) then
|
|
|
|
- basedef:=p
|
|
|
|
- else if basedef<>p then
|
|
|
|
- exit;
|
|
|
|
- inc(elecount);
|
|
|
|
- result:=true;
|
|
|
|
- end;
|
|
|
|
- recorddef:
|
|
|
|
- begin
|
|
|
|
- for i:=0 to tabstractrecorddef(p).symtable.symlist.count-1 do
|
|
|
|
- begin
|
|
|
|
- sym:=tsym(tabstractrecorddef(p).symtable.symlist[i]);
|
|
|
|
- if sym.typ<>fieldvarsym then
|
|
|
|
- continue;
|
|
|
|
- if not is_hfa_internal(tfieldvarsym(sym).vardef,basedef,elecount) then
|
|
|
|
- exit
|
|
|
|
- end;
|
|
|
|
- result:=true;
|
|
|
|
- end;
|
|
|
|
- else
|
|
|
|
- exit
|
|
|
|
- end;
|
|
|
|
- end;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- { Returns whether a def is a "homogeneous float array" at the machine level.
|
|
|
|
- This means that in the memory layout, the def only consists of maximally
|
|
|
|
- 4 floating point values that appear consecutively in memory }
|
|
|
|
- function is_hfa(p: tdef; out basedef: tdef) : boolean;
|
|
|
|
- var
|
|
|
|
- elecount: longint;
|
|
|
|
- begin
|
|
|
|
- result:=false;
|
|
|
|
- basedef:=nil;
|
|
|
|
- elecount:=0;
|
|
|
|
- result:=is_hfa_internal(p,basedef,elecount);
|
|
|
|
- result:=
|
|
|
|
- result and
|
|
|
|
- (elecount>0) and
|
|
|
|
- (elecount<=4) and
|
|
|
|
- (p.size=basedef.size*elecount)
|
|
|
|
- end;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- function getparaloc(calloption: tproccalloption; p: tdef): tcgloc;
|
|
|
|
|
|
+ function tcpuparamanager.getparaloc(calloption: tproccalloption; p: tdef): tcgloc;
|
|
var
|
|
var
|
|
hfabasedef: tdef;
|
|
hfabasedef: tdef;
|
|
begin
|
|
begin
|