Browse Source

* 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 -

Jonas Maebe 9 years ago
parent
commit
f891788a86
1 changed files with 16 additions and 22 deletions
  1. 16 22
      compiler/aarch64/cpupara.pas

+ 16 - 22
compiler/aarch64/cpupara.pas

@@ -99,29 +99,23 @@ unit cpupara;
             begin
               if is_special_array(p) then
                 exit;
-              case tarraydef(p).elementdef.typ of
-                floatdef:
-                  begin
-                    { an array of empty records has no influence }
-                    if tarraydef(p).elementdef.size=0 then
-                      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);
+              { an array of empty records has no influence }
+              if tarraydef(p).elementdef.size=0 then
+                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;
+              result:=true;
             end;
           floatdef:
             begin