On 08/08/2025 16:49, Christophe Lyon wrote:
On Fri, 8 Aug 2025 at 17:04, Richard Earnshaw <richard.earns...@arm.com> wrote:

On 04/07/2025 23:00, Christophe Lyon wrote:
Like we do in other effective-targets, add
"-mcpu=unset -march=armv8-a"
directly when setting et_arm_v8_neon_flags in arm_v8_neon_ok_nocache,
to avoid having to add these two flags in all users of arm_v8_neon_ok.

This avoids duplication and possible typos / oversights.

gcc/testsuite/ChangeLog:
       * lib/target-supports.exp
       (check_effective_target_arm_v8_neon_ok_nocache): Add "-mcpu=unset
       -march=armv8-a" to et_arm_v8_neon_flags.

Adding -march=armv8-a wasn't just useless, it's wrong when using
-mfpu=auto :)

You mean in r5-2846-gcd0059f55fc3e1 ?
It was added in 2014, I'm not sure I fully understand the explanation in
https://gcc.gnu.org/pipermail/gcc-patches/2014-August/396565.html

I don't quite remember when -mfpu=auto was added, I think it's more
recent than 2014?
Was -march=armv8-a+simd supported at that time?

More recently than that (circa 2018, IIRC). I was just pointing out that the existing code is wrong as of today.

R.


       (add_options_for_vect_early_break): Remove useless "-mcpu=unset
       -march=armv8-a".

I wonder if this is the correct solution for the issue that Torbjorn
reported elsewhere.


       (add_options_for_arm_v8_neon): Likewise.
---
   gcc/testsuite/lib/target-supports.exp | 6 +++---
   1 file changed, 3 insertions(+), 3 deletions(-)

OK.

R.


diff --git a/gcc/testsuite/lib/target-supports.exp 
b/gcc/testsuite/lib/target-supports.exp
index 2581c8d5b01..5d06d70c017 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -4597,7 +4597,7 @@ proc add_options_for_vect_early_break { flags } {

       if { [check_effective_target_arm_v8_neon_ok] } {
       global et_arm_v8_neon_flags
-     return "$flags $et_arm_v8_neon_flags -mcpu=unset -march=armv8-a"
+     return "$flags $et_arm_v8_neon_flags"
       }

       if { [check_effective_target_sse4] } {
@@ -5420,7 +5420,7 @@ proc add_options_for_arm_v8_neon { flags } {
       return "$flags"
       }
       global et_arm_v8_neon_flags
-    return "$flags $et_arm_v8_neon_flags -mcpu=unset -march=armv8-a"
+    return "$flags $et_arm_v8_neon_flags"
   }

   # Add the options needed for ARMv8.1 Adv.SIMD.  Also adds the ARMv8 NEON
@@ -5879,7 +5879,7 @@ proc check_effective_target_arm_v8_neon_ok_nocache { } {
               __asm__ volatile ("vrintn.f32 q0, q0");
           }
       } "$flags -mcpu=unset -march=armv8-a"] } {
-         set et_arm_v8_neon_flags $flags
+         set et_arm_v8_neon_flags "$flags -mcpu=unset -march=armv8-a"
           return 1
       }
       }


Reply via email to