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 :)

        (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