[SUMMARY] Re: [PATCH v2] testsuite: arm: Set tuning for MVE FP intrinsic tests

Torbjörn Svensson via Sourceware Forge forge-bot+azoff@forge-stage.sourceware.org
Sun Oct 4 17:14:11 GMT 2026


This is a summary of discussions relative to the merge request created by Torbjörn Svensson (azoff) <torbjorn.svensson@foss.st.com> titled
arm: Set Cortex-M55 tuning for MVE FP tests
since its creation.

Description: Changes since v1:
- Dropped the generic change in lib/target-supports.exp
- Added the change to the dg-options/dg-additional-options for the affected tests.

--

When running DejaGNU with thumb/arch=a/tune=b and a does not happen to be armv8.1-m.main+mve.fp, the effective target check will switch target to that. If that happens, the tune "b" will survive and impact what assembler that will be generated.
This change resets the tune to the default one for armv8.1-m.main+mve.fp.

Tested on arm-none-eabi with both -mcpu and -mtune on r17-4804-gf7094fe5ff882f without any regressions.

Ok for trunk, releases/gcc-16 and releases/gcc-15?

--

CC: Richard Earnshaw <Richard.Earnshaw@arm.com>
CC: Andre Simoes Dias Vieira <Andre.SimoesDiasVieira@arm.com>
CC: Christophe Lyon <christophe.lyon@arm.com>

The full and up to date discussion can be found at https://forge.sourceware.org/gcc/gcc/pulls/238

The merge request has been closed without being merged directly on the forge repository.

On 2026-10-04 07:03:32+00:00, Torbjörn Svensson (azoff) <torbjorn.svensson@foss.st.com> requested that Christophe Lyon (clyon) <clyon@gcc.gnu.org> review the code:




On 2026-10-04 07:31:07+00:00, Richard Earnshaw (rearnsha) <rearnsha@arm.com> commented on the code:


> +++ gcc/testsuite/lib/target-supports.exp
> @@ -7035,2 +7035,3 @@
>      # need to be added to the -march option.
> -    foreach flags {"" "-mfloat-abi=softfp -mfpu=auto -mcpu=unset -march=armv8.1-m.main+mve.fp" "-mfloat-abi=hard -mfpu=auto -mcpu=unset -march=armv8.1-m.main+mve.fp"} {
> +    foreach flags {
> +	""
Why would this alternative not also override the tuning?  What if we have a CPU with the same architecture but different tuning costs?

Which tests are affected by this issue?  Would it make sense to override the tuning there as needed?
> +++ gcc/testsuite/lib/target-supports.exp
> @@ -7035,2 +7035,3 @@
>      # need to be added to the -march option.
> -    foreach flags {"" "-mfloat-abi=softfp -mfpu=auto -mcpu=unset -march=armv8.1-m.main+mve.fp" "-mfloat-abi=hard -mfpu=auto -mcpu=unset -march=armv8.1-m.main+mve.fp"} {
> +    foreach flags {
> +	""
The tests fixed are:
- FAIL: gcc.target/arm/mve/intrinsics/vcmpeqq_n_f16.c check-function-bodies foo2
- FAIL: gcc.target/arm/mve/intrinsics/vcmpeqq_n_f32.c check-function-bodies foo2
- FAIL: gcc.target/arm/mve/intrinsics/vcmpgeq_n_f16.c check-function-bodies foo2
- FAIL: gcc.target/arm/mve/intrinsics/vcmpgeq_n_f32.c check-function-bodies foo2
- FAIL: gcc.target/arm/mve/intrinsics/vcmpgtq_n_f16.c check-function-bodies foo2
- FAIL: gcc.target/arm/mve/intrinsics/vcmpgtq_n_f32.c check-function-bodies foo2
- FAIL: gcc.target/arm/mve/intrinsics/vcmpleq_n_f16.c check-function-bodies foo2
- FAIL: gcc.target/arm/mve/intrinsics/vcmpleq_n_f32.c check-function-bodies foo2
- FAIL: gcc.target/arm/mve/intrinsics/vcmpltq_n_f16.c check-function-bodies foo2
- FAIL: gcc.target/arm/mve/intrinsics/vcmpltq_n_f32.c check-function-bodies foo2
- FAIL: gcc.target/arm/mve/intrinsics/vcmpneq_n_f16.c check-function-bodies foo2
- FAIL: gcc.target/arm/mve/intrinsics/vcmpneq_n_f32.c check-function-bodies foo2
- FAIL: gcc.target/arm/mve/intrinsics/vdupq_n_f16.c check-function-bodies foo1
- FAIL: gcc.target/arm/mve/intrinsics/vdupq_n_f32.c check-function-bodies foo1

All of these were failing with `thumb/arch=armv7ve+simd/tune=cortex-a7/float-abi=hard/fpu=auto` and `thumb/arch=armv7ve+nofp/tune=cortex-a7/float-abi=soft/fpu=auto`, while passing when replacing `-mtune` with `-mcpu`.

The reason why I did not add the `-mtune=cortex-m55` for the empty string is that I thought it was only needed when switching target.
I can add it there too in case you think that is better (should have no impact regardless). 

Comparing -mtune with -mcpu for gcc.target/arm/mve/intrinsics/vcmpeqq_n_f16.c, I see the following difference in generated assembler:
```
--- mcpu.s  2026-10-04 09:49:39.835214873 +0200
+++ mtune.s  2026-10-04 09:49:39.836214873 +0200
@@ -66,11 +66,23 @@
        @ args = 0, pretend = 0, frame = 0
        @ frame_needed = 0, uses_anonymous_args = 0
        @ link register save eliminated.
-       vmov    d6, r0, r1  @ v8hf
-       vmov    d7, r2, r3
-       movw    r3, #15462
-       vcmp.f16        eq, q3, r3
+       vmov    d4, r0, r1  @ v8hf
+       vmov    d5, r2, r3
+       vldr.64 d6, .L5
+       vldr.64 d7, .L5+8
+       vcmp.f16        eq, q2, q3
        vmrs    r0, p0  @ movhi
        uxth    r0, r0
        bx      lr
+.L6:
+       .align  3
+.L5:
+       .short  15462
+       .short  15462
+       .short  15462
+       .short  15462
+       .short  15462
+       .short  15462
+       .short  15462
+       .short  15462
        .size   foo2, .-foo2
```

If you have a suggestion how to fix the tests in a better way, I'd be happy to try it.


On 2026-10-04 11:52:44+00:00, Torbjörn Svensson (azoff) wrote:

Updated the patch after live discussion with Richard E.

On 2026-10-04 11:54:30+00:00, Richard Earnshaw (rearnsha) <rearnsha@arm.com> approved the changes:
OK



On 2026-10-04 17:13:16+00:00, Torbjörn Svensson (azoff) wrote:

Pushed as r17-4873-g8a5c76ca173f25, r16-9734-ga239230fc45aa9 and r15-11613-gb56c7709b773a2.


More information about the Gcc-patches mailing list