On Thu, Jan 08, 2026 at 03:19:47PM +0000, Richard Earnshaw (foss) wrote:
> On 08/01/2026 12:35, Christophe Lyon wrote:
> > 
> > 
> > On 1/8/26 12:53, Artemiy Volkov wrote:
> >> The check_effective_target_arm_v8_3a_fp16_complex_neon_ok_nocache
> >> procedure in target-supports.exp should return a set of flags providing
> >> all of AdvSIMD, complex numbers, and fp16 capabilities.� However, to
> >> achieve this we have to be able to overwrite the current -mfpu setting.
> >> This means that the current empty string alternative for $flags does not
> >> work for us.� This patch splits sets of options to iterate over
> >> between the arm and the aarch64 backend and prohibits an empty string for
> >> the former.� Moreover, it changes
> >> check_effective_target_arm_v8_3a_complex_neon_ok_nocache in the same way.
> >>
> >> This (fully) fixes the advsimd-intrinsics.exp/vector-complex_f16.c
> >> testcase, which was previously being compiled with the -mfpu=neon-fp16
> >> flag added by the .exp file itself.
> >>
> >> Tested on aarch64 by me and on arm by Christophe.
> >>
> >> Co-authored-by: Richard Earnshaw <[email protected]>
> >>
> >> gcc/testsuite/ChangeLog:
> >>
> >> ����* lib/target-supports.exp:
> >> ����(check_effective_target_arm_v8_3a_complex_neon_ok_nocache):
> >> ����Split and fill in arm and aarch64 compile options.� Remove 
> >> the
> >> ����cpu_unset variable.
> >> ����(check_effective_target_arm_v8_3a_fp16_complex_neon_ok_nocache):
> >> ����Likewise.
> >> ---
> >> � gcc/testsuite/lib/target-supports.exp | 31 +++++++++++++++++----------
> >> � 1 file changed, 20 insertions(+), 11 deletions(-)
> >>
> >> diff --git a/gcc/testsuite/lib/target-supports.exp 
> >> b/gcc/testsuite/lib/target-supports.exp
> >> index dbcba42629f..210e246c955 100644
> >> --- a/gcc/testsuite/lib/target-supports.exp
> >> +++ b/gcc/testsuite/lib/target-supports.exp
> >> @@ -13717,27 +13717,32 @@ proc check_effective_target_inff { } {
> >> � proc check_effective_target_arm_v8_3a_complex_neon_ok_nocache { } {
> >> ����� global et_arm_v8_3a_complex_neon_flags
> >> ����� set et_arm_v8_3a_complex_neon_flags ""
> >> -��� set cpu_unset ""
> >> � ����� if { ![istarget arm*-*-*] && ![istarget aarch64*-*-*] 
> >> } {
> >> ����� return 0;
> >> ����� }
> >> � ����� if { [istarget arm*-*-*] } {
> >> -��� set cpu_unset "-mcpu=unset"
> >> +��� set flag_opts {
> 
> We should try "" first, before attempting to modify the architecture.

That will defeat the purpose of this patch, since you need to be able to
"reset" -mfpu by setting it to "auto", much like you need to do
"-mcpu=unset" in every alternative here.  So I'll prepend "-mcpu=unset
-mfpu=auto" instead of "" to the list and resend as v2, would that be OK
with you?

> 
> >> +������� "-mcpu=unset -mfpu=auto -march=armv8.3-a+simd"
> >> +������� "-mcpu=unset -mfloat-abi=softfp -mfpu=auto 
> >> -march=armv8.3-a+simd"
> >> +������� "-mcpu=unset -mfloat-abi=hard -mfpu=auto 
> >> -march=armv8.3-a+simd"
> >> +��� }
> >> +��� } else {
> >> +��� set flag_opts { "" "-march=armv8.3-a" }
> >> ����� }
> > 
> > While this had no visible effect with the configurations I/we have tested, 
> > I suspect we still want to start with just "-mcpu=unset" on arm. Richard?
> 
> We only want to add -mcpu=unset if we're overriding the defaults.  And since 
> we should try "" before trying anything else, it has to be part of the 
> options where this is needed.
> 
> AFAIK aarch64 doesn't support -mcpu=unset (yet), so it's correct not to add 
> that for the aarch64 list.
> 
> > 
> > And on aarch64, dropping +simd seems harmless at the moment, but maybe we 
> > want to keep it in order to be more future-proof?
> 
> I'll let Tamar make the call on that one.  But as things stand we always 
> default to having simd on aarch64 and I expect there will be a huge amount of 
> testsuite churn if that ever changes, so I'm not too worried about that.

Yeah, every base arch on aarch64 has +simd as per aarch64-arches.def:33,
so armv8.3-a here should be enough.

Thanks,
Artemiy

Reply via email to