mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 09:28:19 +02:00
* completed thlcgobj.location_force_fpureg(), use it everywhere and removed
ncgutil/thlcg2ll.location_force_fpureg() git-svn-id: trunk@27071 -
This commit is contained in:
parent
875a7418b3
commit
4065483a50
@ -142,8 +142,8 @@ interface
|
||||
begin
|
||||
{ force fpureg as location, left right doesn't matter
|
||||
as both will be in a fpureg }
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,left.location,true);
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,right.location,true);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,right.location,right.resultdef,true);
|
||||
|
||||
location_reset(location,LOC_FPUREGISTER,def_cgsize(resultdef));
|
||||
location.register:=cg.getfpuregister(current_asmdata.CurrAsmList,location.size);
|
||||
@ -258,8 +258,8 @@ interface
|
||||
begin
|
||||
{ force fpureg as location, left right doesn't matter
|
||||
as both will be in a fpureg }
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,left.location,true);
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,right.location,true);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,right.location,right.resultdef,true);
|
||||
|
||||
cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
|
||||
if nodetype in [equaln,unequaln] then
|
||||
|
@ -75,7 +75,7 @@ implementation
|
||||
fpu_fpa10,
|
||||
fpu_fpa11:
|
||||
begin
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,left.location,true);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
|
||||
location_copy(location,left.location);
|
||||
if left.location.loc=LOC_CFPUREGISTER then
|
||||
begin
|
||||
|
@ -401,7 +401,7 @@ implementation
|
||||
fpu_fpa10,
|
||||
fpu_fpa11:
|
||||
begin
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,left.location,false);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,false);
|
||||
location:=left.location;
|
||||
current_asmdata.CurrAsmList.concat(setoppostfix(taicpu.op_reg_reg_const(A_RSF,
|
||||
location.register,left.location.register,0),
|
||||
|
@ -310,7 +310,6 @@ unit hlcg2ll;
|
||||
procedure g_local_unwind(list: TAsmList; l: TAsmLabel);override;
|
||||
|
||||
procedure location_force_reg(list:TAsmList;var l:tlocation;src_size,dst_size:tdef;maybeconst:boolean);override;
|
||||
procedure location_force_fpureg(list:TAsmList;var l: tlocation;size: tdef;maybeconst:boolean);override;
|
||||
procedure location_force_mem(list:TAsmList;var l:tlocation;size:tdef);override;
|
||||
procedure location_force_mmregscalar(list:TAsmList;var l: tlocation;size:tdef;maybeconst:boolean);override;
|
||||
// procedure location_force_mmreg(list:TAsmList;var l: tlocation;size:tdef;maybeconst:boolean);override;
|
||||
@ -1214,11 +1213,6 @@ implementation
|
||||
location_freetemp(list,oldloc);
|
||||
end;
|
||||
|
||||
procedure thlcg2ll.location_force_fpureg(list: TAsmList; var l: tlocation; size: tdef; maybeconst: boolean);
|
||||
begin
|
||||
ncgutil.location_force_fpureg(list,l,maybeconst);
|
||||
end;
|
||||
|
||||
procedure thlcg2ll.location_force_mem(list: TAsmList; var l: tlocation; size: tdef);
|
||||
var
|
||||
r: treference;
|
||||
|
@ -3669,7 +3669,7 @@ implementation
|
||||
begin
|
||||
{ if it's in an mm register, store to memory first }
|
||||
if (l.loc in [LOC_MMREGISTER,LOC_CMMREGISTER]) then
|
||||
internalerror(2011012903);
|
||||
location_force_mem(list,l,size);
|
||||
reg:=getfpuregister(list,size);
|
||||
a_loadfpu_loc_reg(list,size,size,l,reg);
|
||||
location_freetemp(list,l);
|
||||
|
@ -406,8 +406,8 @@ implementation
|
||||
swapleftright;
|
||||
|
||||
// put both operands in a register
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,right.location,true);
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,left.location,true);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,right.location,right.resultdef,true);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
|
||||
|
||||
// initialize de result
|
||||
if not cmpop then
|
||||
@ -454,8 +454,8 @@ implementation
|
||||
}
|
||||
{ force fpureg as location, left right doesn't matter
|
||||
as both will be in a fpureg }
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,left.location,true);
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,right.location,true);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,right.location,right.resultdef,true);
|
||||
|
||||
location_reset(location,LOC_FLAGS,OS_NO);
|
||||
location.resflags:=getresflags(true);
|
||||
|
@ -63,7 +63,7 @@ uses
|
||||
procinfo,
|
||||
symconst,symdef,
|
||||
ncon, nset, nadd,
|
||||
ncgutil, cgobj;
|
||||
ncgutil, hlcgobj, cgobj;
|
||||
|
||||
{*****************************************************************************
|
||||
tmipsaddnode
|
||||
@ -210,8 +210,8 @@ begin
|
||||
|
||||
{ force fpureg as location, left right doesn't matter
|
||||
as both will be in a fpureg }
|
||||
location_force_fpureg(current_asmdata.CurrAsmList, left.location, True);
|
||||
location_force_fpureg(current_asmdata.CurrAsmList, right.location, True);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList, left.location, left.resultdef, True);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList, right.location, right.resultdef, True);
|
||||
|
||||
location_reset(location, LOC_FPUREGISTER, def_cgsize(resultdef));
|
||||
location.register:=cg.getfpuregister(current_asmdata.CurrAsmList,location.size);
|
||||
@ -271,8 +271,8 @@ begin
|
||||
if nf_swapped in flags then
|
||||
swapleftright;
|
||||
|
||||
location_force_fpureg(current_asmdata.CurrAsmList, left.location, True);
|
||||
location_force_fpureg(current_asmdata.CurrAsmList, right.location, True);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList, left.location, left.resultdef, True);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList, right.location, right.resultdef, True);
|
||||
location_reset(location, LOC_JUMP, OS_NO);
|
||||
|
||||
op:=ops_cmpfloat[left.location.size=OS_F64,nodetype];
|
||||
|
@ -53,7 +53,7 @@ uses
|
||||
cgbase, pass_2,
|
||||
cpubase, paramgr,
|
||||
nbas, ncon, ncal, ncnv, nld,
|
||||
ncgutil, cgobj, cgutils;
|
||||
hlcgobj, ncgutil, cgobj, cgutils;
|
||||
|
||||
{*****************************************************************************
|
||||
tMIPSELinlinenode
|
||||
@ -62,7 +62,7 @@ uses
|
||||
procedure tMIPSELinlinenode.load_fpu_location;
|
||||
begin
|
||||
secondpass(left);
|
||||
location_force_fpureg(current_asmdata.CurrAsmList, left.location, True);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList, left.location, left.resultdef, True);
|
||||
location_copy(location, left.location);
|
||||
if left.location.loc = LOC_CFPUREGISTER then
|
||||
begin
|
||||
|
@ -270,7 +270,7 @@ end;
|
||||
procedure TMIPSunaryminusnode.second_float;
|
||||
begin
|
||||
secondpass(left);
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,left.location,true);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
|
||||
location_reset(location,LOC_FPUREGISTER,def_cgsize(resultdef));
|
||||
location.register:=cg.getfpuregister(current_asmdata.CurrAsmList,location.size);
|
||||
case location.size of
|
||||
|
@ -421,7 +421,7 @@ interface
|
||||
(left.location.size in [OS_F80,OS_C64]) then
|
||||
begin
|
||||
if (left.location.loc in [LOC_CREFERENCE,LOC_REFERENCE]) then
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,left.location,false);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,false);
|
||||
{ round them down to the proper precision }
|
||||
tg.gethltemp(current_asmdata.currasmlist,resultdef,resultdef.size,tt_normal,tr);
|
||||
cg.a_loadfpu_reg_ref(current_asmdata.CurrAsmList,left.location.size,location.size,left.location.register,tr);
|
||||
@ -479,7 +479,7 @@ interface
|
||||
case expectloc of
|
||||
LOC_FPUREGISTER:
|
||||
begin
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,left.location,false);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,false);
|
||||
location.register:=cg.getfpuregister(current_asmdata.CurrAsmList,location.size);
|
||||
cg.a_loadfpu_reg_reg(current_asmdata.CurrAsmList,left.location.size,location.size,left.location.register,location.register);
|
||||
end;
|
||||
|
@ -60,7 +60,6 @@ interface
|
||||
procedure maketojumpbool(list:TAsmList; p : tnode; loadregvars: tloadregvars);
|
||||
// procedure remove_non_regvars_from_loc(const t: tlocation; var regs:Tsuperregisterset);
|
||||
|
||||
procedure location_force_fpureg(list:TAsmList;var l: tlocation;maybeconst:boolean);
|
||||
procedure location_force_mmreg(list:TAsmList;var l: tlocation;maybeconst:boolean);
|
||||
procedure location_allocate_register(list:TAsmList;out l: tlocation;def: tdef;constant: boolean);
|
||||
|
||||
@ -486,31 +485,6 @@ implementation
|
||||
*****************************************************************************}
|
||||
|
||||
|
||||
procedure location_force_fpureg(list:TAsmList;var l: tlocation;maybeconst:boolean);
|
||||
var
|
||||
reg : tregister;
|
||||
href : treference;
|
||||
begin
|
||||
if (l.loc<>LOC_FPUREGISTER) and
|
||||
((l.loc<>LOC_CFPUREGISTER) or (not maybeconst)) then
|
||||
begin
|
||||
{ if it's in an mm register, store to memory first }
|
||||
if (l.loc in [LOC_MMREGISTER,LOC_CMMREGISTER]) then
|
||||
begin
|
||||
tg.GetTemp(list,tcgsize2size[l.size],tcgsize2size[l.size],tt_normal,href);
|
||||
cg.a_loadmm_reg_ref(list,l.size,l.size,l.register,href,mms_movescalar);
|
||||
location_reset_ref(l,LOC_REFERENCE,l.size,0);
|
||||
l.reference:=href;
|
||||
end;
|
||||
reg:=cg.getfpuregister(list,l.size);
|
||||
cg.a_loadfpu_loc_reg(list,l.size,l,reg);
|
||||
location_freetemp(list,l);
|
||||
location_reset(l,LOC_FPUREGISTER,l.size);
|
||||
l.register:=reg;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure register_maybe_adjust_setbase(list: TAsmList; var l: tlocation; setbase: aint);
|
||||
var
|
||||
tmpreg: tregister;
|
||||
|
@ -341,8 +341,8 @@ implementation
|
||||
swapleftright;
|
||||
|
||||
// put both operands in a register
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,right.location,true);
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,left.location,true);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,right.location,right.resultdef,true);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
|
||||
|
||||
// initialize de result
|
||||
if not cmpop then
|
||||
|
@ -60,7 +60,7 @@ implementation
|
||||
defutil,
|
||||
cgbase,pass_2,
|
||||
cpuinfo,ncgutil,
|
||||
cgutils,cgobj,rgobj,tgobj;
|
||||
hlcgobj,cgutils,cgobj,rgobj,tgobj;
|
||||
|
||||
|
||||
{*****************************************************************************
|
||||
@ -122,7 +122,7 @@ implementation
|
||||
begin
|
||||
location_reset(location,LOC_FPUREGISTER,def_cgsize(resultdef));
|
||||
secondpass(left);
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,left.location,true);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
|
||||
location.loc := LOC_FPUREGISTER;
|
||||
location.register := cg.getfpuregister(current_asmdata.CurrAsmList,OS_F64);
|
||||
end;
|
||||
@ -178,7 +178,7 @@ implementation
|
||||
if (current_settings.cputype < cpu_PPC970) then
|
||||
internalerror(2007020910);
|
||||
secondpass(left);
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,left.location,true);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
|
||||
tmpreg:=cg.getfpuregister(current_asmdata.CurrAsmList,OS_F64);
|
||||
current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(op,tmpreg,
|
||||
left.location.register));
|
||||
|
@ -56,7 +56,7 @@ interface
|
||||
cgbase,cgcpu,cgutils,
|
||||
cpupara,
|
||||
ncon,nset,nadd,
|
||||
ncgutil,cgobj;
|
||||
hlcgobj, ncgutil,cgobj;
|
||||
|
||||
{*****************************************************************************
|
||||
TSparcAddNode
|
||||
@ -170,8 +170,8 @@ interface
|
||||
|
||||
{ force fpureg as location, left right doesn't matter
|
||||
as both will be in a fpureg }
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,left.location,true);
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,right.location,(left.location.loc<>LOC_CFPUREGISTER));
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,right.location,right.resultdef,(left.location.loc<>LOC_CFPUREGISTER));
|
||||
|
||||
location_reset(location,LOC_FPUREGISTER,def_cgsize(resultdef));
|
||||
if left.location.loc<>LOC_CFPUREGISTER then
|
||||
@ -227,8 +227,8 @@ interface
|
||||
|
||||
{ force fpureg as location, left right doesn't matter
|
||||
as both will be in a fpureg }
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,left.location,true);
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,right.location,true);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,right.location,right.resultdef,true);
|
||||
|
||||
location_reset(location,LOC_FLAGS,OS_NO);
|
||||
location.resflags:=getfpuresflags;
|
||||
|
@ -217,7 +217,7 @@ implementation
|
||||
op : tasmop;
|
||||
begin
|
||||
location_reset(location,LOC_FPUREGISTER,def_cgsize(resultdef));
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,left.location,false);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,false);
|
||||
{ Convert value in fpu register from integer to float }
|
||||
op:=conv_op[tfloatdef(resultdef).floattype,tfloatdef(left.resultdef).floattype];
|
||||
if op=A_NONE then
|
||||
|
@ -51,7 +51,7 @@ implementation
|
||||
cgbase,pass_2,
|
||||
cpubase,paramgr,
|
||||
nbas,ncon,ncal,ncnv,nld,
|
||||
ncgutil,cgobj,cgutils;
|
||||
hlcgobj,ncgutil,cgobj,cgutils;
|
||||
|
||||
{*****************************************************************************
|
||||
tsparcinlinenode
|
||||
@ -60,7 +60,7 @@ implementation
|
||||
procedure tsparcinlinenode.load_fpu_location;
|
||||
begin
|
||||
secondpass(left);
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,left.location,true);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
|
||||
location_copy(location,left.location);
|
||||
if left.location.loc=LOC_CFPUREGISTER then
|
||||
begin
|
||||
|
@ -293,7 +293,7 @@ implementation
|
||||
procedure tsparcunaryminusnode.second_float;
|
||||
begin
|
||||
secondpass(left);
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,left.location,true);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
|
||||
location_reset(location,LOC_FPUREGISTER,def_cgsize(resultdef));
|
||||
location.register:=cg.getfpuregister(current_asmdata.CurrAsmList,location.size);
|
||||
case location.size of
|
||||
|
@ -241,9 +241,9 @@ unit nx86add;
|
||||
begin
|
||||
if (force_fpureg) then
|
||||
begin
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,right.location,false);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,right.location,right.resultdef,false);
|
||||
if (left.location.loc<>LOC_FPUREGISTER) then
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,left.location,false)
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,false)
|
||||
else
|
||||
{ left was on the stack => swap }
|
||||
toggleflag(nf_swapped);
|
||||
@ -253,7 +253,7 @@ unit nx86add;
|
||||
else if (left.location.loc<>LOC_FPUREGISTER) then
|
||||
begin
|
||||
if (force_fpureg) then
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,left.location,false)
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,false)
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
@ -281,7 +281,7 @@ implementation
|
||||
LOC_MMREGISTER,LOC_CMMREGISTER:
|
||||
begin
|
||||
location:=lnode.location;
|
||||
location_force_fpureg(current_asmdata.CurrAsmList,location,false);
|
||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,location,resultdef,false);
|
||||
end;
|
||||
else
|
||||
internalerror(309991);
|
||||
|
Loading…
Reference in New Issue
Block a user