* don't convert the fpu parameters size from tcgsize -> int -> float_tcgsize

if not required, to avoid translating OS_C64 into OS_F64 (fix for x86
    test failures after r45205)

git-svn-id: trunk@45221 -
(cherry picked from commit 3f6ad30b69)
This commit is contained in:
Jonas Maebe 2020-05-02 13:17:21 +00:00
parent 8a31764a7b
commit 1c3fc6e2df
2 changed files with 171 additions and 133 deletions

View File

@ -433,10 +433,12 @@ interface
the source }
procedure removeshuffles(var shuffle : tmmshuffle);
function is_float_cgsize(size: tcgsize): boolean;{$ifdef USEINLINE}inline;{$endif}
implementation
uses
verbose;
cutils,verbose;
{******************************************************************************
tsuperregisterworklist
@ -815,6 +817,25 @@ implementation
end;
function is_float_cgsize(size: tcgsize): boolean;{$ifdef USEINLINE}inline;{$endif}
begin
result:=size in [OS_F32..OS_F128];
end;
procedure Initmms(var p : pmmshuffle;len : ShortInt);
var
i : Integer;
begin
Getmem(p,sizeof(tmmshuffle)+(max(len,0)-1)*2);
p^.len:=len;
for i:=1 to len do
{$push}
{$R-}
p^.shuffles[i]:=i;
{$pop}
end;
initialization
new(mms_movescalar);
mms_movescalar^.len:=0;

View File

@ -1029,13 +1029,13 @@ implementation
location: pcgparalocation;
orgsizeleft,
sizeleft: tcgint;
usesize: tcgsize;
reghasvalue: boolean;
begin
location:=cgpara.location;
tmpref:=r;
sizeleft:=cgpara.intsize;
while assigned(location) do
begin
repeat
paramanager.allocparaloc(list,location);
case location^.loc of
LOC_REGISTER,LOC_CREGISTER:
@ -1158,7 +1158,14 @@ implementation
end;
LOC_FPUREGISTER,LOC_CFPUREGISTER:
begin
a_loadfpu_ref_reg(list,location^.size,location^.size,tmpref,location^.register);
{ can be not a float size in case of a record passed in fpu registers }
{ the size comparison is to catch F128 passed in two 64 bit floating point registers }
if is_float_cgsize(size) and
(tcgsize2size[location^.size]>=tcgsize2size[size]) then
usesize:=size
else
usesize:=location^.size;
a_loadfpu_ref_reg(list,usesize,location^.size,tmpref,location^.register);
end
else
internalerror(2010053111);
@ -1166,7 +1173,7 @@ implementation
inc(tmpref.offset,tcgsize2size[location^.size]);
dec(sizeleft,tcgsize2size[location^.size]);
location:=location^.next;
end;
until not assigned(location);
end;
procedure tcg.a_load_ref_cgparalocref(list: TAsmList; sourcesize: tcgsize; sizeleft: tcgint; const ref, paralocref: treference; const cgpara: tcgpara; const location: PCGParaLocation);
@ -1882,6 +1889,7 @@ implementation
var
srcref,
href : treference;
srcsize,
hsize: tcgsize;
paraloc: PCGParaLocation;
sizeleft: tcgint;
@ -1894,9 +1902,18 @@ implementation
case paraloc^.loc of
LOC_FPUREGISTER,LOC_CFPUREGISTER:
begin
{ force fpu size }
{ destination: can be something different in case of a record passed in fpu registers }
if is_float_cgsize(paraloc^.size) then
hsize:=paraloc^.size
else
hsize:=int_float_cgsize(tcgsize2size[paraloc^.size]);
a_loadfpu_ref_reg(list,hsize,hsize,srcref,paraloc^.register);
{ source: the size comparison is to catch F128 passed in two 64 bit floating point registers }
if is_float_cgsize(size) and
(tcgsize2size[size]<=tcgsize2size[paraloc^.size]) then
srcsize:=size
else
srcsize:=hsize;
a_loadfpu_ref_reg(list,srcsize,hsize,srcref,paraloc^.register);
end;
LOC_REFERENCE,LOC_CREFERENCE:
begin