* 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 } the source }
procedure removeshuffles(var shuffle : tmmshuffle); procedure removeshuffles(var shuffle : tmmshuffle);
function is_float_cgsize(size: tcgsize): boolean;{$ifdef USEINLINE}inline;{$endif}
implementation implementation
uses uses
@ -858,6 +860,12 @@ implementation
end; 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); procedure Initmms(var p : pmmshuffle;len : ShortInt);
var var
i : Integer; i : Integer;

View File

@ -1023,13 +1023,13 @@ implementation
location: pcgparalocation; location: pcgparalocation;
orgsizeleft, orgsizeleft,
sizeleft: tcgint; sizeleft: tcgint;
usesize: tcgsize;
reghasvalue: boolean; reghasvalue: boolean;
begin begin
location:=cgpara.location; location:=cgpara.location;
tmpref:=r; tmpref:=r;
sizeleft:=cgpara.intsize; sizeleft:=cgpara.intsize;
while assigned(location) do repeat
begin
paramanager.allocparaloc(list,location); paramanager.allocparaloc(list,location);
case location^.loc of case location^.loc of
LOC_REGISTER,LOC_CREGISTER: LOC_REGISTER,LOC_CREGISTER:
@ -1152,7 +1152,14 @@ implementation
end; end;
LOC_FPUREGISTER,LOC_CFPUREGISTER: LOC_FPUREGISTER,LOC_CFPUREGISTER:
begin 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 end
else else
internalerror(2010053111); internalerror(2010053111);
@ -1160,7 +1167,7 @@ implementation
inc(tmpref.offset,tcgsize2size[location^.size]); inc(tmpref.offset,tcgsize2size[location^.size]);
dec(sizeleft,tcgsize2size[location^.size]); dec(sizeleft,tcgsize2size[location^.size]);
location:=location^.next; location:=location^.next;
end; until not assigned(location);
end; end;
procedure tcg.a_load_ref_cgparalocref(list: TAsmList; sourcesize: tcgsize; sizeleft: tcgint; const ref, paralocref: treference; const cgpara: tcgpara; const location: PCGParaLocation); 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 var
srcref, srcref,
href : treference; href : treference;
srcsize,
hsize: tcgsize; hsize: tcgsize;
paraloc: PCGParaLocation; paraloc: PCGParaLocation;
sizeleft: tcgint; sizeleft: tcgint;
@ -1896,9 +1904,18 @@ implementation
case paraloc^.loc of case paraloc^.loc of
LOC_FPUREGISTER,LOC_CFPUREGISTER: LOC_FPUREGISTER,LOC_CFPUREGISTER:
begin 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]); 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; end;
LOC_REFERENCE,LOC_CREFERENCE: LOC_REFERENCE,LOC_CREFERENCE:
begin begin