|
@@ -35,7 +35,6 @@ unit cpupara;
|
|
type
|
|
type
|
|
tx86_64paramanager = class(tparamanager)
|
|
tx86_64paramanager = class(tparamanager)
|
|
private
|
|
private
|
|
- procedure create_funcretloc_info(p : tabstractprocdef; side: tcallercallee);
|
|
|
|
procedure create_paraloc_info_intern(p : tabstractprocdef; side: tcallercallee;paras:tparalist;
|
|
procedure create_paraloc_info_intern(p : tabstractprocdef; side: tcallercallee;paras:tparalist;
|
|
var intparareg,mmparareg,parasize:longint;varargsparas: boolean);
|
|
var intparareg,mmparareg,parasize:longint;varargsparas: boolean);
|
|
public
|
|
public
|
|
@@ -48,7 +47,7 @@ unit cpupara;
|
|
function get_volatile_registers_fpu(calloption : tproccalloption):tcpuregisterset;override;
|
|
function get_volatile_registers_fpu(calloption : tproccalloption):tcpuregisterset;override;
|
|
function create_paraloc_info(p : tabstractprocdef; side: tcallercallee):longint;override;
|
|
function create_paraloc_info(p : tabstractprocdef; side: tcallercallee):longint;override;
|
|
function create_varargs_paraloc_info(p : tabstractprocdef; varargspara:tvarargsparalist):longint;override;
|
|
function create_varargs_paraloc_info(p : tabstractprocdef; varargspara:tvarargsparalist):longint;override;
|
|
- function get_funcretloc(p : tabstractprocdef; side: tcallercallee; def: tdef): tcgpara;override;
|
|
|
|
|
|
+ function get_funcretloc(p : tabstractprocdef; side: tcallercallee; forcetempdef: tdef): tcgpara;override;
|
|
end;
|
|
end;
|
|
|
|
|
|
implementation
|
|
implementation
|
|
@@ -791,13 +790,7 @@ unit cpupara;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
- procedure tx86_64paramanager.create_funcretloc_info(p : tabstractprocdef; side: tcallercallee);
|
|
|
|
- begin
|
|
|
|
- p.funcretloc[side]:=get_funcretloc(p,side,p.returndef);
|
|
|
|
- end;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- function tx86_64paramanager.get_funcretloc(p : tabstractprocdef; side: tcallercallee; def: tdef): tcgpara;
|
|
|
|
|
|
+ function tx86_64paramanager.get_funcretloc(p : tabstractprocdef; side: tcallercallee; forcetempdef: tdef): tcgpara;
|
|
const
|
|
const
|
|
intretregs: array[0..1] of tregister = (NR_FUNCTION_RETURN_REG,NR_FUNCTION_RETURN_REG_HIGH);
|
|
intretregs: array[0..1] of tregister = (NR_FUNCTION_RETURN_REG,NR_FUNCTION_RETURN_REG_HIGH);
|
|
mmretregs: array[0..1] of tregister = (NR_MM_RESULT_REG,NR_MM_RESULT_REG_HIGH);
|
|
mmretregs: array[0..1] of tregister = (NR_MM_RESULT_REG,NR_MM_RESULT_REG_HIGH);
|
|
@@ -810,7 +803,7 @@ unit cpupara;
|
|
retcgsize : tcgsize;
|
|
retcgsize : tcgsize;
|
|
paraloc : pcgparalocation;
|
|
paraloc : pcgparalocation;
|
|
begin
|
|
begin
|
|
- if set_common_funcretloc_info(p,def,retcgsize,result) then
|
|
|
|
|
|
+ if set_common_funcretloc_info(p,forcetempdef,retcgsize,result) then
|
|
exit;
|
|
exit;
|
|
|
|
|
|
{ integer sizes < 32 bit have to be sign/zero extended to 32 bit on
|
|
{ integer sizes < 32 bit have to be sign/zero extended to 32 bit on
|
|
@@ -827,10 +820,10 @@ unit cpupara;
|
|
{ Return in FPU register? -> don't use classify_argument(), because
|
|
{ Return in FPU register? -> don't use classify_argument(), because
|
|
currency and comp need special treatment here (they are integer class
|
|
currency and comp need special treatment here (they are integer class
|
|
when passing as parameter, but LOC_FPUREGISTER as function result) }
|
|
when passing as parameter, but LOC_FPUREGISTER as function result) }
|
|
- if def.typ=floatdef then
|
|
|
|
|
|
+ if result.def.typ=floatdef then
|
|
begin
|
|
begin
|
|
paraloc:=result.add_location;
|
|
paraloc:=result.add_location;
|
|
- case tfloatdef(def).floattype of
|
|
|
|
|
|
+ case tfloatdef(result.def).floattype of
|
|
s32real:
|
|
s32real:
|
|
begin
|
|
begin
|
|
paraloc^.loc:=LOC_MMREGISTER;
|
|
paraloc^.loc:=LOC_MMREGISTER;
|
|
@@ -861,7 +854,7 @@ unit cpupara;
|
|
else
|
|
else
|
|
{ Return in register }
|
|
{ Return in register }
|
|
begin
|
|
begin
|
|
- numclasses:=classify_argument(def,vs_value,def.size,classes,0);
|
|
|
|
|
|
+ numclasses:=classify_argument(result.def,vs_value,result.def.size,classes,0);
|
|
{ this would mean a memory return }
|
|
{ this would mean a memory return }
|
|
if (numclasses=0) then
|
|
if (numclasses=0) then
|
|
internalerror(2010021502);
|
|
internalerror(2010021502);
|