https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122974

            Bug ID: 122974
           Summary: bfloat16_simd tests fail when forcing -mtune for an
                    M-class CPU
           Product: gcc
           Version: 16.0
               URL: https://linaro.atlassian.net/browse/GNU-1673
            Status: UNCONFIRMED
          Keywords: testsuite-fail
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: clyon at gcc dot gnu.org
  Target Milestone: ---
            Target: arm

When running the testsuite with
-mthumb/-march=armv6s-m/-mtune=cortex-m0/-mfloat-abi=soft/-mfpu=auto we have:

FAIL: gcc.target/arm/bfloat16_simd_1_2.c check-function-bodies stacktest1
FAIL: gcc.target/arm/bfloat16_simd_2_2.c check-function-bodies stacktest1
FAIL: gcc.target/arm/bfloat16_simd_3_2.c check-function-bodies stacktest1

For instance bfloat16_simd_1_2.c is compiled with
-mthumb -march=armv6s-m -mtune=cortex-m0 -mfloat-abi=soft -mfpu=auto
-march=armv8.2-a+bf16 -mfloat-abi=softfp -mfpu=auto

and the generated code is:
stacktest1:
        sub     sp, sp, #8
        strh    r0, [sp, #6]    @ __bf16
        ldrh    r0, [sp, #6]    @ __bf16
        add     r3, sp, #6
        add     sp, sp, #8
        bx      lr

so the test fails because we generate a store to sp + 6.

Adding -mtune=cortex-a57 generates:
stacktest1:
        sub     sp, sp, #8
        add     r3, sp, #6
        strh    r0, [r3]        @ __bf16
        ldrh    r0, [sp, #6]    @ __bf16
        add     sp, sp, #8
        bx      lr

It's not clear whether we'd want to update the test to accept a store to sp+6,
or if we want to force a suitable -mtune value.

In addition the code generated without -mtune=cortex-a57 contains a useless:
        add     r3, sp, #6

Reply via email to