mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-14 15:09:14 +02:00
* fixed parameter passing for 64 bit ints
This commit is contained in:
parent
a5e7f02527
commit
80b1ccdd76
@ -493,40 +493,65 @@ unit cg64f32;
|
|||||||
|
|
||||||
|
|
||||||
procedure tcg64f32.a_param64_const(list : taasmoutput;value : qword;const locpara : tparalocation);
|
procedure tcg64f32.a_param64_const(list : taasmoutput;value : qword;const locpara : tparalocation);
|
||||||
|
var
|
||||||
|
tmplochi,tmploclo: tparalocation;
|
||||||
begin
|
begin
|
||||||
{$ifdef fpc}
|
tmplochi:=locpara;
|
||||||
{$warning FIX ME}
|
tmploclo:=locpara;
|
||||||
{$endif}
|
if locpara.size=OS_S64 then
|
||||||
if target_info.endian = endian_big then
|
tmplochi.size:=OS_S32
|
||||||
swap_qword(value);
|
else
|
||||||
cg.a_param_const(list,OS_32,hi(value),locpara);
|
tmplochi.size:=OS_32;
|
||||||
{ the nr+1 needs definitivly a fix FK }
|
tmploclo.size:=OS_32;
|
||||||
{ maybe the parameter numbering needs }
|
case locpara.loc of
|
||||||
{ to take care of this on 32 Bit }
|
LOC_REGISTER:
|
||||||
{ systems FK }
|
tmplochi.register:=tmplochi.registerhigh;
|
||||||
cg.a_param_const(list,OS_32,lo(value),locpara);
|
LOC_REFERENCE:
|
||||||
|
if target_info.endian=endian_big then
|
||||||
|
inc(tmploclo.reference.offset,4)
|
||||||
|
else
|
||||||
|
inc(tmplochi.reference.offset,4);
|
||||||
|
else
|
||||||
|
internalerror(2003042702);
|
||||||
|
end;
|
||||||
|
cg.a_param_const(list,OS_32,lo(value),tmploclo);
|
||||||
|
cg.a_param_const(list,OS_32,hi(value),tmplochi);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure tcg64f32.a_param64_ref(list : taasmoutput;const r : treference;const locpara : tparalocation);
|
procedure tcg64f32.a_param64_ref(list : taasmoutput;const r : treference;const locpara : tparalocation);
|
||||||
var
|
var
|
||||||
tmpref: treference;
|
tmprefhi,tmpreflo : treference;
|
||||||
tmploc: tparalocation;
|
tmploclo,tmplochi : tparalocation;
|
||||||
begin
|
begin
|
||||||
tmpref := r;
|
tmprefhi:=r;
|
||||||
inc(tmpref.offset,4);
|
tmpreflo:=r;
|
||||||
tmploc := locpara;
|
tmplochi:=locpara;
|
||||||
tmploc.registerlow:=tmploc.registerhigh;
|
tmploclo:=locpara;
|
||||||
if target_info.endian = endian_big then
|
if locpara.size=OS_S64 then
|
||||||
begin
|
tmplochi.size:=OS_S32
|
||||||
cg.a_param_ref(list,OS_32,tmpref,tmploc);
|
|
||||||
cg.a_param_ref(list,OS_32,r,locpara);
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
begin
|
tmplochi.size:=OS_32;
|
||||||
cg.a_param_ref(list,OS_32,tmpref,locpara);
|
tmploclo.size:=OS_32;
|
||||||
cg.a_param_ref(list,OS_32,r,locpara);
|
case locpara.loc of
|
||||||
end;
|
LOC_REGISTER:
|
||||||
|
begin
|
||||||
|
if target_info.endian=endian_big then
|
||||||
|
inc(tmpreflo.offset,4)
|
||||||
|
else
|
||||||
|
inc(tmprefhi.offset,4);
|
||||||
|
tmplochi.register:=tmplochi.registerhigh;
|
||||||
|
end;
|
||||||
|
LOC_REFERENCE:
|
||||||
|
begin
|
||||||
|
inc(tmprefhi.offset,4);
|
||||||
|
inc(tmplochi.reference.offset,4);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
internalerror(2003042701);
|
||||||
|
end;
|
||||||
|
cg.a_param_ref(list,OS_32,tmpreflo,tmploclo);
|
||||||
|
cg.a_param_ref(list,OS_32,tmprefhi,tmplochi);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -836,7 +861,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.40 2003-04-23 20:16:03 peter
|
Revision 1.41 2003-04-27 08:23:51 florian
|
||||||
|
* fixed parameter passing for 64 bit ints
|
||||||
|
|
||||||
|
Revision 1.40 2003/04/23 20:16:03 peter
|
||||||
+ added currency support based on int64
|
+ added currency support based on int64
|
||||||
+ is_64bit for use in cg units instead of is_64bitint
|
+ is_64bit for use in cg units instead of is_64bitint
|
||||||
* removed cgmessage from n386add, replace with internalerrors
|
* removed cgmessage from n386add, replace with internalerrors
|
||||||
|
Loading…
Reference in New Issue
Block a user