File tree 8 files changed +373
-66
lines changed
8 files changed +373
-66
lines changed Original file line number Diff line number Diff line change 36
36
tcpuparamanager = class (tparamanager)
37
37
function get_volatile_registers_int (calloption: tproccalloption): tcpuregisterset; override;
38
38
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;
39
40
function get_volatile_registers_mm (calloption: tproccalloption): tcpuregisterset; override;
40
41
function push_addr_param (varspez: tvarspez; def: tdef; calloption: tproccalloption): boolean; override;
41
42
function ret_in_param (def: tdef; pd: tabstractprocdef):boolean;override;
@@ -80,6 +81,28 @@ tcpuparamanager = class(tparamanager)
80
81
result:=[];
81
82
end ;
82
83
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 ;
83
106
84
107
function tcpuparamanager.get_volatile_registers_mm (calloption: tproccalloption): tcpuregisterset;
85
108
begin
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ tcpuparamanager = class(tparamanager)
37
37
function get_volatile_registers_int (calloption : tproccalloption):tcpuregisterset;override;
38
38
function get_volatile_registers_fpu (calloption : tproccalloption):tcpuregisterset;override;
39
39
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;
40
41
function push_addr_param (varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;override;
41
42
function ret_in_param (def:tdef;pd:tabstractprocdef):boolean;override;
42
43
procedure getintparaloc (list: TAsmList; pd : tabstractprocdef; nr : longint; var cgpara : tcgpara);override;
@@ -74,6 +75,44 @@ tcpuparamanager = class(tparamanager)
74
75
result:=VOLATILE_FPUREGISTERS;
75
76
end ;
76
77
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
+
77
116
78
117
function tcpuparamanager.get_volatile_registers_mm (calloption: tproccalloption): tcpuregisterset;
79
118
begin
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ tcpuparamanager = class(tparamanager)
40
40
function get_volatile_registers_int (calloption : tproccalloption):tcpuregisterset;override;
41
41
function get_volatile_registers_fpu (calloption : tproccalloption):tcpuregisterset;override;
42
42
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;
43
44
function create_paraloc_info (p : tabstractprocdef; side: tcallercallee):longint;override;
44
45
function create_varargs_paraloc_info (p : tabstractprocdef; varargspara:tvarargsparalist):longint;override;
45
46
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)
285
286
result:=[0 ..first_mm_imreg-1 ];
286
287
end ;
287
288
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 ;
288
312
289
313
function tcpuparamanager.get_funcretloc (p : tabstractprocdef; side: tcallercallee; forcetempdef: tdef): TCGPara;
290
314
var
You can’t perform that action at this time.
0 commit comments