* 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 -
This commit is contained in:
Jonas Maebe 2020-05-02 13:17:21 +00:00
parent de805fddcd
commit 3f6ad30b69
2 changed files with 157 additions and 132 deletions

View File

@ -473,6 +473,8 @@ interface
the source }
procedure removeshuffles(var shuffle : tmmshuffle);
function is_float_cgsize(size: tcgsize): boolean;{$ifdef USEINLINE}inline;{$endif}
implementation
uses
@ -858,6 +860,12 @@ 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;

View File

@ -1023,13 +1023,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:
@ -1152,7 +1152,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);
@ -1160,7 +1167,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);
@ -1884,6 +1891,7 @@ implementation
var
srcref,
href : treference;
srcsize,
hsize: tcgsize;
paraloc: PCGParaLocation;
sizeleft: tcgint;
@ -1896,9 +1904,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