From f891788a8631b33c51694b6802aa3ce41950e5ea Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Fri, 12 Aug 2016 16:53:02 +0000 Subject: [PATCH] * 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 - --- compiler/aarch64/cpupara.pas | 38 +++++++++++++++--------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/compiler/aarch64/cpupara.pas b/compiler/aarch64/cpupara.pas index 57e9f54587..21423daa4d 100644 --- a/compiler/aarch64/cpupara.pas +++ b/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