mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 07:09:23 +02:00
+ setting of bit 6 of cr for c var args on ppc implemented
This commit is contained in:
parent
85e84512fb
commit
d38abc3a3f
@ -50,7 +50,7 @@ unit cpupara;
|
|||||||
}
|
}
|
||||||
function getintparaloc(calloption : tproccalloption; nr : longint) : tparalocation;override;
|
function getintparaloc(calloption : tproccalloption; nr : longint) : tparalocation;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:tlinkedlist):longint;override;
|
function create_varargs_paraloc_info(p : tabstractprocdef; varargspara:tvarargspara):longint;override;
|
||||||
private
|
private
|
||||||
procedure create_funcret_paraloc_info(p : tabstractprocdef; side: tcallercallee);
|
procedure create_funcret_paraloc_info(p : tabstractprocdef; side: tcallercallee);
|
||||||
function create_stdcall_paraloc_info(p : tabstractprocdef; side: tcallercallee):longint;
|
function create_stdcall_paraloc_info(p : tabstractprocdef; side: tcallercallee):longint;
|
||||||
@ -255,7 +255,7 @@ unit cpupara;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function ti386paramanager.create_varargs_paraloc_info(p : tabstractprocdef; varargspara:tlinkedlist):longint;
|
function ti386paramanager.create_varargs_paraloc_info(p : tabstractprocdef; varargspara:tvarargspara):longint;
|
||||||
var
|
var
|
||||||
hp : tparaitem;
|
hp : tparaitem;
|
||||||
paraloc : tparalocation;
|
paraloc : tparalocation;
|
||||||
@ -487,7 +487,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.47 2003-12-03 23:13:20 peter
|
Revision 1.48 2003-12-28 22:09:12 florian
|
||||||
|
+ setting of bit 6 of cr for c var args on ppc implemented
|
||||||
|
|
||||||
|
Revision 1.47 2003/12/03 23:13:20 peter
|
||||||
* delayed paraloc allocation, a_param_*() gets extra parameter
|
* delayed paraloc allocation, a_param_*() gets extra parameter
|
||||||
if it needs to allocate temp or real paralocation
|
if it needs to allocate temp or real paralocation
|
||||||
* optimized/simplified int-real loading
|
* optimized/simplified int-real loading
|
||||||
|
@ -29,6 +29,7 @@ interface
|
|||||||
uses
|
uses
|
||||||
cutils,cclasses,
|
cutils,cclasses,
|
||||||
globtype,cpuinfo,
|
globtype,cpuinfo,
|
||||||
|
paramgr,
|
||||||
node,nbas,
|
node,nbas,
|
||||||
{$ifdef state_tracking}
|
{$ifdef state_tracking}
|
||||||
nstate,
|
nstate,
|
||||||
@ -93,7 +94,7 @@ interface
|
|||||||
{ inline function body }
|
{ inline function body }
|
||||||
inlinecode : tnode;
|
inlinecode : tnode;
|
||||||
{ varargs tparaitems }
|
{ varargs tparaitems }
|
||||||
varargsparas : tlinkedlist;
|
varargsparas : tvarargspara;
|
||||||
{ node that specifies where the result should be put for calls }
|
{ node that specifies where the result should be put for calls }
|
||||||
{ that return their result in a parameter }
|
{ that return their result in a parameter }
|
||||||
property funcretnode: tnode read _funcretnode write setfuncretnode;
|
property funcretnode: tnode read _funcretnode write setfuncretnode;
|
||||||
@ -186,7 +187,7 @@ implementation
|
|||||||
uses
|
uses
|
||||||
systems,
|
systems,
|
||||||
verbose,globals,
|
verbose,globals,
|
||||||
symconst,paramgr,defutil,defcmp,
|
symconst,defutil,defcmp,
|
||||||
htypechk,pass_1,
|
htypechk,pass_1,
|
||||||
ncnv,nld,ninl,nadd,ncon,nmem,
|
ncnv,nld,ninl,nadd,ncon,nmem,
|
||||||
procinfo,
|
procinfo,
|
||||||
@ -1057,7 +1058,7 @@ type
|
|||||||
n.inlinecode:=nil;
|
n.inlinecode:=nil;
|
||||||
if assigned(varargsparas) then
|
if assigned(varargsparas) then
|
||||||
begin
|
begin
|
||||||
n.varargsparas:=tlinkedlist.create;
|
n.varargsparas:=tvarargspara.create;
|
||||||
hp:=tparaitem(varargsparas.first);
|
hp:=tparaitem(varargsparas.first);
|
||||||
while assigned(hp) do
|
while assigned(hp) do
|
||||||
begin
|
begin
|
||||||
@ -1943,7 +1944,7 @@ type
|
|||||||
if nf_varargs_para in pt.flags then
|
if nf_varargs_para in pt.flags then
|
||||||
begin
|
begin
|
||||||
if not assigned(varargsparas) then
|
if not assigned(varargsparas) then
|
||||||
varargsparas:=tlinkedlist.create;
|
varargsparas:=tvarargspara.create;
|
||||||
varargspara:=tparaitem.create;
|
varargspara:=tparaitem.create;
|
||||||
varargspara.paratyp:=vs_value;
|
varargspara.paratyp:=vs_value;
|
||||||
varargspara.paratype:=pt.resulttype;
|
varargspara.paratype:=pt.resulttype;
|
||||||
@ -2701,7 +2702,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.216 2003-12-21 19:42:42 florian
|
Revision 1.217 2003-12-28 22:09:12 florian
|
||||||
|
+ setting of bit 6 of cr for c var args on ppc implemented
|
||||||
|
|
||||||
|
Revision 1.216 2003/12/21 19:42:42 florian
|
||||||
* fixed ppc inlining stuff
|
* fixed ppc inlining stuff
|
||||||
* fixed wrong unit writing
|
* fixed wrong unit writing
|
||||||
+ added some sse stuff
|
+ added some sse stuff
|
||||||
|
@ -66,6 +66,7 @@ interface
|
|||||||
function align_parasize:longint;virtual;
|
function align_parasize:longint;virtual;
|
||||||
procedure pop_parasize(pop_size:longint);virtual;
|
procedure pop_parasize(pop_size:longint);virtual;
|
||||||
procedure extra_interrupt_code;virtual;
|
procedure extra_interrupt_code;virtual;
|
||||||
|
procedure extra_call_code;virtual;
|
||||||
public
|
public
|
||||||
procedure pass_2;override;
|
procedure pass_2;override;
|
||||||
end;
|
end;
|
||||||
@ -413,6 +414,11 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure tcgcallnode.extra_call_code;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function tcgcallnode.align_parasize:longint;
|
function tcgcallnode.align_parasize:longint;
|
||||||
begin
|
begin
|
||||||
result:=0;
|
result:=0;
|
||||||
@ -785,6 +791,7 @@ implementation
|
|||||||
cg.allocexplicitregisters(exprasmlist,R_MMREGISTER,paramanager.get_volatile_registers_mm(procdefinition.proccalloption));
|
cg.allocexplicitregisters(exprasmlist,R_MMREGISTER,paramanager.get_volatile_registers_mm(procdefinition.proccalloption));
|
||||||
|
|
||||||
{ call method }
|
{ call method }
|
||||||
|
extra_call_code;
|
||||||
cg.a_call_reg(exprasmlist,pvreg);
|
cg.a_call_reg(exprasmlist,pvreg);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -807,6 +814,7 @@ implementation
|
|||||||
extra code }
|
extra code }
|
||||||
if (po_interrupt in procdefinition.procoptions) then
|
if (po_interrupt in procdefinition.procoptions) then
|
||||||
extra_interrupt_code;
|
extra_interrupt_code;
|
||||||
|
extra_call_code;
|
||||||
cg.a_call_name(exprasmlist,tprocdef(procdefinition).mangledname);
|
cg.a_call_name(exprasmlist,tprocdef(procdefinition).mangledname);
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
@ -847,6 +855,7 @@ implementation
|
|||||||
extra_interrupt_code;
|
extra_interrupt_code;
|
||||||
{$warning fixme regvars.}
|
{$warning fixme regvars.}
|
||||||
{ rg.saveotherregvars(exprasmlist,ALL_OTHERREGISTERS);}
|
{ rg.saveotherregvars(exprasmlist,ALL_OTHERREGISTERS);}
|
||||||
|
extra_call_code;
|
||||||
cg.a_call_reg(exprasmlist,pvreg);
|
cg.a_call_reg(exprasmlist,pvreg);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1145,7 +1154,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.148 2003-12-26 13:19:16 florian
|
Revision 1.149 2003-12-28 22:09:12 florian
|
||||||
|
+ setting of bit 6 of cr for c var args on ppc implemented
|
||||||
|
|
||||||
|
Revision 1.148 2003/12/26 13:19:16 florian
|
||||||
* rtl and compiler compile with -Cfsse2
|
* rtl and compiler compile with -Cfsse2
|
||||||
|
|
||||||
Revision 1.147 2003/12/21 19:42:42 florian
|
Revision 1.147 2003/12/21 19:42:42 florian
|
||||||
|
@ -35,6 +35,14 @@ unit paramgr;
|
|||||||
symconst,symtype,symdef;
|
symconst,symtype,symdef;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
tvarargsinfo = (
|
||||||
|
va_uses_float_reg
|
||||||
|
);
|
||||||
|
|
||||||
|
tvarargspara = class(tlinkedlist)
|
||||||
|
varargsinfo : set of tvarargsinfo;
|
||||||
|
end;
|
||||||
|
|
||||||
{# This class defines some methods to take care of routine
|
{# This class defines some methods to take care of routine
|
||||||
parameters. It should be overriden for each new processor
|
parameters. It should be overriden for each new processor
|
||||||
}
|
}
|
||||||
@ -107,7 +115,7 @@ unit paramgr;
|
|||||||
for the routine that are passed as varargs. It returns
|
for the routine that are passed as varargs. It returns
|
||||||
the size allocated on the stack (including the normal parameters)
|
the size allocated on the stack (including the normal parameters)
|
||||||
}
|
}
|
||||||
function create_varargs_paraloc_info(p : tabstractprocdef; varargspara:tlinkedlist):longint;virtual;abstract;
|
function create_varargs_paraloc_info(p : tabstractprocdef; varargspara:tvarargspara):longint;virtual;abstract;
|
||||||
|
|
||||||
{ Return the location of the low and high part of a 64bit parameter }
|
{ Return the location of the low and high part of a 64bit parameter }
|
||||||
procedure splitparaloc64(const locpara:tparalocation;var loclopara,lochipara:tparalocation);virtual;
|
procedure splitparaloc64(const locpara:tparalocation;var loclopara,lochipara:tparalocation);virtual;
|
||||||
@ -450,7 +458,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.67 2003-12-06 01:15:22 florian
|
Revision 1.68 2003-12-28 22:09:12 florian
|
||||||
|
+ setting of bit 6 of cr for c var args on ppc implemented
|
||||||
|
|
||||||
|
Revision 1.67 2003/12/06 01:15:22 florian
|
||||||
* reverted Peter's alloctemp patch; hopefully properly
|
* reverted Peter's alloctemp patch; hopefully properly
|
||||||
|
|
||||||
Revision 1.66 2003/12/03 23:13:20 peter
|
Revision 1.66 2003/12/03 23:13:20 peter
|
||||||
|
@ -58,6 +58,7 @@ uses
|
|||||||
constructor op_reg_reg_ref(op : tasmop;_op1,_op2 : tregister; const _op3: treference);
|
constructor op_reg_reg_ref(op : tasmop;_op1,_op2 : tregister; const _op3: treference);
|
||||||
constructor op_const_reg_reg(op : tasmop;_op1 : longint;_op2, _op3 : tregister);
|
constructor op_const_reg_reg(op : tasmop;_op1 : longint;_op2, _op3 : tregister);
|
||||||
constructor op_const_reg_const(op : tasmop;_op1 : longint;_op2 : tregister;_op3 : longint);
|
constructor op_const_reg_const(op : tasmop;_op1 : longint;_op2 : tregister;_op3 : longint);
|
||||||
|
constructor op_const_const_const(op : tasmop;_op1 : longint;_op2 : longint;_op3 : longint);
|
||||||
|
|
||||||
constructor op_reg_reg_reg_reg(op : tasmop;_op1,_op2,_op3,_op4 : tregister);
|
constructor op_reg_reg_reg_reg(op : tasmop;_op1,_op2,_op3,_op4 : tregister);
|
||||||
constructor op_reg_bool_reg_reg(op : tasmop;_op1: tregister;_op2:boolean;_op3,_op4:tregister);
|
constructor op_reg_bool_reg_reg(op : tasmop;_op1: tregister;_op2:boolean;_op3,_op4:tregister);
|
||||||
@ -239,6 +240,16 @@ uses cutils,rgobj;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
constructor taicpu.op_const_const_const(op : tasmop;_op1 : longint;_op2 : longint;_op3 : longint);
|
||||||
|
begin
|
||||||
|
inherited create(op);
|
||||||
|
ops:=3;
|
||||||
|
loadconst(0,aword(_op1));
|
||||||
|
loadconst(1,aword(_op2));
|
||||||
|
loadconst(2,aword(_op3));
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
constructor taicpu.op_reg_reg_reg_reg(op : tasmop;_op1,_op2,_op3,_op4 : tregister);
|
constructor taicpu.op_reg_reg_reg_reg(op : tasmop;_op1,_op2,_op3,_op4 : tregister);
|
||||||
begin
|
begin
|
||||||
inherited create(op);
|
inherited create(op);
|
||||||
@ -406,7 +417,10 @@ uses cutils,rgobj;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.22 2003-12-26 14:02:30 peter
|
Revision 1.23 2003-12-28 22:09:12 florian
|
||||||
|
+ setting of bit 6 of cr for c var args on ppc implemented
|
||||||
|
|
||||||
|
Revision 1.22 2003/12/26 14:02:30 peter
|
||||||
* sparc updates
|
* sparc updates
|
||||||
* use registertype in spill_register
|
* use registertype in spill_register
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ unit cpupara;
|
|||||||
function push_addr_param(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;override;
|
function push_addr_param(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;override;
|
||||||
function getintparaloc(calloption : tproccalloption; nr : longint) : tparalocation;override;
|
function getintparaloc(calloption : tproccalloption; nr : longint) : tparalocation;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:tlinkedlist):longint;override;
|
function create_varargs_paraloc_info(p : tabstractprocdef; varargspara:tvarargspara):longint;override;
|
||||||
private
|
private
|
||||||
procedure init_values(var curintreg, curfloatreg, curmmreg: tsuperregister; var cur_stack_offset: aword);
|
procedure init_values(var curintreg, curfloatreg, curmmreg: tsuperregister; var cur_stack_offset: aword);
|
||||||
function create_paraloc_info_intern(p : tabstractprocdef; side: tcallercallee; firstpara: tparaitem;
|
function create_paraloc_info_intern(p : tabstractprocdef; side: tcallercallee; firstpara: tparaitem;
|
||||||
@ -293,7 +293,7 @@ unit cpupara;
|
|||||||
hp.paraloc[side].size := OS_ADDR;
|
hp.paraloc[side].size := OS_ADDR;
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if (hp.paratyp in [vs_var,vs_out]) then
|
if (hp.paratyp in [vs_var,vs_out]) then
|
||||||
begin
|
begin
|
||||||
paradef := voidpointertype.def;
|
paradef := voidpointertype.def;
|
||||||
@ -400,15 +400,16 @@ unit cpupara;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function tppcparamanager.create_varargs_paraloc_info(p : tabstractprocdef; varargspara:tlinkedlist):longint;
|
function tppcparamanager.create_varargs_paraloc_info(p : tabstractprocdef; varargspara:tvarargspara):longint;
|
||||||
var
|
var
|
||||||
cur_stack_offset: aword;
|
cur_stack_offset: aword;
|
||||||
parasize, l: longint;
|
parasize, l: longint;
|
||||||
curintreg, curfloatreg, curmmreg: tsuperregister;
|
curintreg, firstfloatreg, curfloatreg, curmmreg: tsuperregister;
|
||||||
hp: tparaitem;
|
hp: tparaitem;
|
||||||
paraloc: tparalocation;
|
paraloc: tparalocation;
|
||||||
begin
|
begin
|
||||||
init_values(curintreg,curfloatreg,curmmreg,cur_stack_offset);
|
init_values(curintreg,curfloatreg,curmmreg,cur_stack_offset);
|
||||||
|
firstfloatreg:=curfloatreg;
|
||||||
|
|
||||||
result := create_paraloc_info_intern(p,callerside,tparaitem(p.para.first),curintreg,curfloatreg,curmmreg,cur_stack_offset);
|
result := create_paraloc_info_intern(p,callerside,tparaitem(p.para.first),curintreg,curfloatreg,curmmreg,cur_stack_offset);
|
||||||
if (p.proccalloption in [pocall_cdecl,pocall_cppdecl]) then
|
if (p.proccalloption in [pocall_cdecl,pocall_cppdecl]) then
|
||||||
@ -432,6 +433,8 @@ unit cpupara;
|
|||||||
end;
|
end;
|
||||||
result := parasize;
|
result := parasize;
|
||||||
end;
|
end;
|
||||||
|
if curfloatreg<>firstfloatreg then
|
||||||
|
include(varargspara.varargsinfo,va_uses_float_reg);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -440,7 +443,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.54 2003-12-28 15:33:06 jonas
|
Revision 1.55 2003-12-28 22:09:12 florian
|
||||||
|
+ setting of bit 6 of cr for c var args on ppc implemented
|
||||||
|
|
||||||
|
Revision 1.54 2003/12/28 15:33:06 jonas
|
||||||
* hopefully fixed varargs (both Pascal- and C-style)
|
* hopefully fixed varargs (both Pascal- and C-style)
|
||||||
|
|
||||||
Revision 1.53 2003/12/16 21:49:47 florian
|
Revision 1.53 2003/12/16 21:49:47 florian
|
||||||
|
@ -31,6 +31,7 @@ interface
|
|||||||
|
|
||||||
type
|
type
|
||||||
tppccallnode = class(tcgcallnode)
|
tppccallnode = class(tcgcallnode)
|
||||||
|
procedure extra_call_code;override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -54,12 +55,28 @@ implementation
|
|||||||
ncgutil,cgobj,tgobj,regvars,rgobj,rgcpu,
|
ncgutil,cgobj,tgobj,regvars,rgobj,rgcpu,
|
||||||
cg64f32,cgcpu,cpupi,procinfo;
|
cg64f32,cgcpu,cpupi,procinfo;
|
||||||
|
|
||||||
|
|
||||||
|
procedure tppccallnode.extra_call_code;
|
||||||
|
begin
|
||||||
|
if assigned(varargsparas) then
|
||||||
|
begin
|
||||||
|
if va_uses_float_reg in varargsparas.varargsinfo then
|
||||||
|
exprasmlist.concat(taicpu.op_const_const_const(A_CREQV,6,6,6))
|
||||||
|
else
|
||||||
|
exprasmlist.concat(taicpu.op_const_const_const(A_CRXOR,6,6,6));
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
ccallnode:=tppccallnode;
|
ccallnode:=tppccallnode;
|
||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.22 2003-10-01 20:34:49 peter
|
Revision 1.23 2003-12-28 22:09:12 florian
|
||||||
|
+ setting of bit 6 of cr for c var args on ppc implemented
|
||||||
|
|
||||||
|
Revision 1.22 2003/10/01 20:34:49 peter
|
||||||
* procinfo unit contains tprocinfo
|
* procinfo unit contains tprocinfo
|
||||||
* cginfo renamed to cgbase
|
* cginfo renamed to cgbase
|
||||||
* moved cgmessage to verbose
|
* moved cgmessage to verbose
|
||||||
|
Loading…
Reference in New Issue
Block a user