File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636 tcpuparamanager = class (tparamanager)
3737 function get_volatile_registers_int (calloption: tproccalloption): tcpuregisterset; override;
3838 function get_volatile_registers_fpu (calloption: tproccalloption): tcpuregisterset; override;
39+ procedure get_para_regoff (proccalloption: tproccalloption; paraloc: pcgparalocation; out reg: Byte; out off: LongInt); override;
3940 function get_volatile_registers_mm (calloption: tproccalloption): tcpuregisterset; override;
4041 function push_addr_param (varspez: tvarspez; def: tdef; calloption: tproccalloption): boolean; override;
4142 function ret_in_param (def: tdef; pd: tabstractprocdef):boolean;override;
@@ -80,6 +81,28 @@ tcpuparamanager = class(tparamanager)
8081 result:=[];
8182 end ;
8283
84+ procedure tcpuparamanager.get_para_regoff (proccalloption: tproccalloption; paraloc: pcgparalocation; out reg: Byte; out off: LongInt);
85+ var
86+ I : SizeInt;
87+ begin
88+ with paraloc^ do
89+ case loc of
90+ LOC_REGISTER:
91+ begin
92+ reg:=getsupreg(register)-RS_X0;
93+ off:=0 ;
94+ end ;
95+ LOC_MMREGISTER:
96+ begin
97+ reg:=getsupreg(register)-RS_D0;
98+ end ;
99+ LOC_REFERENCE:
100+ begin
101+ reg:=255 ;
102+ off:=reference.offset;
103+ end ;
104+ end ;
105+ end ;
83106
84107 function tcpuparamanager.get_volatile_registers_mm (calloption: tproccalloption): tcpuregisterset;
85108 begin
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ tcpuparamanager = class(tparamanager)
3737 function get_volatile_registers_int (calloption : tproccalloption):tcpuregisterset;override;
3838 function get_volatile_registers_fpu (calloption : tproccalloption):tcpuregisterset;override;
3939 function get_volatile_registers_mm (calloption : tproccalloption):tcpuregisterset;override;
40+ procedure get_para_regoff (proccalloption: tproccalloption; paraloc: pcgparalocation; out reg: Byte; out off: LongInt);override;
4041 function push_addr_param (varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;override;
4142 function ret_in_param (def:tdef;pd:tabstractprocdef):boolean;override;
4243 procedure getintparaloc (list: TAsmList; pd : tabstractprocdef; nr : longint; var cgpara : tcgpara);override;
@@ -74,6 +75,44 @@ tcpuparamanager = class(tparamanager)
7475 result:=VOLATILE_FPUREGISTERS;
7576 end ;
7677
78+ procedure tcpuparamanager.get_para_regoff (proccalloption: tproccalloption; paraloc: pcgparalocation; out reg: Byte; out off: LongInt);
79+ var
80+ I : SizeInt;
81+ begin
82+ with paraloc^ do
83+ case loc of
84+ LOC_REGISTER:
85+ begin
86+ reg:=getsupreg(register)-RS_R0;
87+ off:=0 ;
88+ end ;
89+ LOC_FPUREGISTER:
90+ begin
91+ reg:=getsupreg(register)-RS_F0;
92+ off:=0 ;
93+ end ;
94+ LOC_MMREGISTER:
95+ begin
96+ reg:=getsupreg(register);
97+ if reg < RS_S1 then
98+ begin
99+ reg:=reg-RS_D0;
100+ off:=0 ;
101+ end
102+ else
103+ begin
104+ reg:=reg-RS_S1;
105+ off:=4 ;
106+ end ;
107+ end ;
108+ LOC_REFERENCE:
109+ begin
110+ reg:=255 ;
111+ off:=reference.offset;
112+ end ;
113+ end ;
114+ end ;
115+
77116
78117 function tcpuparamanager.get_volatile_registers_mm (calloption: tproccalloption): tcpuregisterset;
79118 begin
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ tcpuparamanager = class(tparamanager)
4040 function get_volatile_registers_int (calloption : tproccalloption):tcpuregisterset;override;
4141 function get_volatile_registers_fpu (calloption : tproccalloption):tcpuregisterset;override;
4242 function get_volatile_registers_mm (calloption : tproccalloption):tcpuregisterset;override;
43+ procedure get_para_regoff (proccalloption: tproccalloption; paraloc: pcgparalocation; out reg: Byte; out off: LongInt);override;
4344 function create_paraloc_info (p : tabstractprocdef; side: tcallercallee):longint;override;
4445 function create_varargs_paraloc_info (p : tabstractprocdef; varargspara:tvarargsparalist):longint;override;
4546 procedure createtempparaloc (list: TAsmList;calloption : tproccalloption;parasym : tparavarsym;can_use_final_stack_loc : boolean;var cgpara:TCGPara);override;
@@ -285,6 +286,29 @@ tcpuparamanager = class(tparamanager)
285286 result:=[0 ..first_mm_imreg-1 ];
286287 end ;
287288
289+ procedure tcpuparamanager.get_para_regoff (proccalloption: tproccalloption; paraloc: pcgparalocation; out reg: Byte; out off: LongInt);
290+ var
291+ I : SizeInt;
292+ begin
293+ with paraloc^ do
294+ case loc of
295+ LOC_REGISTER:
296+ begin
297+ for I := 0 to high(parasupregs) do
298+ if getsupreg(register)=parasupregs[I] then
299+ begin
300+ reg:=I;
301+ break;
302+ end ;
303+ off:=0 ;
304+ end ;
305+ LOC_REFERENCE:
306+ begin
307+ reg:=255 ;
308+ off:=reference.offset;
309+ end ;
310+ end ;
311+ end ;
288312
289313 function tcpuparamanager.get_funcretloc (p : tabstractprocdef; side: tcallercallee; forcetempdef: tdef): TCGPara;
290314 var
You can’t perform that action at this time.
0 commit comments