Permalink
Browse files

Merge pull request #10 from maciej-izak/master

* Patch from Alfred for Interface RTTI
  • Loading branch information...
maciej-izak committed Jun 29, 2016
2 parents eddcfdd + e1746ab commit 632bd194f0fb0007c5855bc5264991de3467505d
@@ -36,6 +36,7 @@
tcpuparamanager = class(tparamanager)
function get_volatile_registers_int(calloption: tproccalloption): tcpuregisterset; override;
function get_volatile_registers_fpu(calloption: tproccalloption): tcpuregisterset; override;
procedure get_para_regoff(proccalloption: tproccalloption; paraloc: pcgparalocation; out reg: Byte; out off: LongInt); override;
function get_volatile_registers_mm(calloption: tproccalloption): tcpuregisterset; override;
function push_addr_param(varspez: tvarspez; def: tdef; calloption: tproccalloption): boolean; override;
function ret_in_param(def: tdef; pd: tabstractprocdef):boolean;override;
@@ -80,6 +81,28 @@ tcpuparamanager = class(tparamanager)
result:=[];
end;
procedure tcpuparamanager.get_para_regoff(proccalloption: tproccalloption; paraloc: pcgparalocation; out reg: Byte; out off: LongInt);
var
I : SizeInt;
begin
with paraloc^ do
case loc of
LOC_REGISTER:
begin
reg:=getsupreg(register)-RS_X0;
off:=0;
end;
LOC_MMREGISTER:
begin
reg:=getsupreg(register)-RS_D0;
end;
LOC_REFERENCE:
begin
reg:=255;
off:=reference.offset;
end;
end;
end;
function tcpuparamanager.get_volatile_registers_mm(calloption: tproccalloption): tcpuregisterset;
begin
View
@@ -37,6 +37,7 @@ tcpuparamanager = class(tparamanager)
function get_volatile_registers_int(calloption : tproccalloption):tcpuregisterset;override;
function get_volatile_registers_fpu(calloption : tproccalloption):tcpuregisterset;override;
function get_volatile_registers_mm(calloption : tproccalloption):tcpuregisterset;override;
procedure get_para_regoff(proccalloption: tproccalloption; paraloc: pcgparalocation; out reg: Byte; out off: LongInt);override;
function push_addr_param(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;override;
function ret_in_param(def:tdef;pd:tabstractprocdef):boolean;override;
procedure getintparaloc(list: TAsmList; pd : tabstractprocdef; nr : longint; var cgpara : tcgpara);override;
@@ -74,6 +75,44 @@ tcpuparamanager = class(tparamanager)
result:=VOLATILE_FPUREGISTERS;
end;
procedure tcpuparamanager.get_para_regoff(proccalloption: tproccalloption; paraloc: pcgparalocation; out reg: Byte; out off: LongInt);
var
I : SizeInt;
begin
with paraloc^ do
case loc of
LOC_REGISTER:
begin
reg:=getsupreg(register)-RS_R0;
off:=0;
end;
LOC_FPUREGISTER:
begin
reg:=getsupreg(register)-RS_F0;
off:=0;
end;
LOC_MMREGISTER:
begin
reg:=getsupreg(register);
if reg < RS_S1 then
begin
reg:=reg-RS_D0;
off:=0;
end
else
begin
reg:=reg-RS_S1;
off:=4;
end;
end;
LOC_REFERENCE:
begin
reg:=255;
off:=reference.offset;
end;
end;
end;
function tcpuparamanager.get_volatile_registers_mm(calloption: tproccalloption): tcpuregisterset;
begin
View
@@ -40,6 +40,7 @@ tcpuparamanager = class(tparamanager)
function get_volatile_registers_int(calloption : tproccalloption):tcpuregisterset;override;
function get_volatile_registers_fpu(calloption : tproccalloption):tcpuregisterset;override;
function get_volatile_registers_mm(calloption : tproccalloption):tcpuregisterset;override;
procedure get_para_regoff(proccalloption: tproccalloption; paraloc: pcgparalocation; out reg: Byte; out off: LongInt);override;
function create_paraloc_info(p : tabstractprocdef; side: tcallercallee):longint;override;
function create_varargs_paraloc_info(p : tabstractprocdef; varargspara:tvarargsparalist):longint;override;
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)
result:=[0..first_mm_imreg-1];
end;
procedure tcpuparamanager.get_para_regoff(proccalloption: tproccalloption; paraloc: pcgparalocation; out reg: Byte; out off: LongInt);
var
I : SizeInt;
begin
with paraloc^ do
case loc of
LOC_REGISTER:
begin
for I := 0 to high(parasupregs) do
if getsupreg(register)=parasupregs[I] then
begin
reg:=I;
break;
end;
off:=0;
end;
LOC_REFERENCE:
begin
reg:=255;
off:=reference.offset;
end;
end;
end;
function tcpuparamanager.get_funcretloc(p : tabstractprocdef; side: tcallercallee; forcetempdef: tdef): TCGPara;
var
Oops, something went wrong.

0 comments on commit 632bd19

Please sign in to comment.