* simplification of and fix for AArch64 cpupara.is_hfa_internal() (patch by

modulo7, mantis #30381)
   o check for array elements of size 0 does not make sense after we've
     established it's an array of floats
   o since the recursive call to is_hfa_internal() already checks for
     floats, we don't have to do it before calling it again for the
     elements of an array
   o set the result to "true" if the array is small enough to be a HFA

git-svn-id: trunk@34293 -
This commit is contained in:
Jonas Maebe 2016-08-12 16:53:02 +00:00
parent a2bf4efce2
commit f891788a86

View File

@ -99,29 +99,23 @@ unit cpupara;
begin begin
if is_special_array(p) then if is_special_array(p) then
exit; exit;
case tarraydef(p).elementdef.typ of { an array of empty records has no influence }
floatdef: if tarraydef(p).elementdef.size=0 then
begin begin
{ an array of empty records has no influence } result:=true;
if tarraydef(p).elementdef.size=0 then exit
begin
result:=true;
exit
end;
tmpelecount:=0;
if not is_hfa_internal(tarraydef(p).elementdef,basedef,tmpelecount) then
exit;
{ tmpelecount now contains the number of hfa elements in a
single array element (e.g. 2 if it's an array of a record
containing two singles) -> multiply by number of elements
in the array }
inc(elecount,tarraydef(p).elecount*tmpelecount);
if elecount>4 then
exit;
end;
else
result:=is_hfa_internal(tarraydef(p).elementdef,basedef,elecount);
end; end;
tmpelecount:=0;
if not is_hfa_internal(tarraydef(p).elementdef,basedef,tmpelecount) then
exit;
{ tmpelecount now contains the number of hfa elements in a
single array element (e.g. 2 if it's an array of a record
containing two singles) -> multiply by number of elements
in the array }
inc(elecount,tarraydef(p).elecount*tmpelecount);
if elecount>4 then
exit;
result:=true;
end; end;
floatdef: floatdef:
begin begin