Skip to content

Commit

Permalink
testsuite/arm: Add arm_softfp_ok or arm_hard_ok as needed.
Browse files Browse the repository at this point in the history
Several tests override the -mfloat-abi option detected by their
effective targets. Make sure it is supported, so that these tests are
unsupported rather than failures (the inclusion of arm_neon.h
otherwise fails for lack of gnu/stubs-*.h)

This avoids failures with
bfloat16_simd_2_1.c
bfloat16_simd_3_1.c
bf16_vldn_1.c
bf16_vstn_1.c on arm-linux-gnueabi
and
pr51968.c
bfloat16_simd_1_2.c
bfloat16_simd_2_2.c
bfloat16_simd_3_2.c on arm-linux-gnueabihf.

On arm-eabi with default cpu/fpu/mode and a+rm multilibs,
bfloat16_simd_2_1.c, bfloat16_simd_3_1.c, bf16_vstn_1.c and
bf16_vldn_1.c become unsupported instead of pass because arm_hard_ok
fails with "selected processor lacks an FPU". Since we also override
the fpu in dg-additional-options, we'd need another effective target
(say arm_hard_neon_ok) that would check -mfloat-abi=hard -mfpu=neon at
the same time. But we have already so many arm effective targets, it
doesn't seem like a good way forward.

2021-03-19  Christophe Lyon  <[email protected]>

	gcc/testsuite/
	* gcc.target/arm/bfloat16_simd_1_2.c: Add arm_softfp_ok.
	* gcc.target/arm/bfloat16_simd_2_2.c: Likewise.
	* gcc.target/arm/bfloat16_simd_3_2.c: Likewise.
	* gcc.target/arm/pr51968.c: Likewise.
	* gcc.target/arm/bfloat16_simd_2_1.c: arm_hard_ok.
	* gcc.target/arm/bfloat16_simd_3_1.c: Likewise.
	* gcc.target/arm/simd/bf16_vldn_1.c: Likewise.
	* gcc.target/arm/simd/bf16_vstn_1.c: Likewise.
  • Loading branch information
Christophe Lyon committed Mar 23, 2021
1 parent 451c51e commit fcfad74
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions gcc/testsuite/gcc.target/arm/bfloat16_simd_1_2.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* { dg-do assemble { target { arm*-*-* } } } */
/* { dg-require-effective-target arm_softfp_ok } */
/* { dg-require-effective-target arm_v8_neon_ok } */
/* { dg-require-effective-target arm_v8_2a_bf16_neon_ok } */
/* { dg-additional-options "-march=armv8.2-a+bf16 -mfloat-abi=softfp -mfpu=auto" } */
Expand Down
1 change: 1 addition & 0 deletions gcc/testsuite/gcc.target/arm/bfloat16_simd_2_1.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* { dg-do assemble { target { arm*-*-* } } } */
/* { dg-require-effective-target arm_hard_ok } */
/* { dg-require-effective-target arm_v8_neon_ok } */
/* { dg-require-effective-target arm_v8_2a_bf16_neon_ok } */
/* { dg-additional-options "-march=armv8.2-a -mfloat-abi=hard -mfpu=neon-fp-armv8" } */
Expand Down
1 change: 1 addition & 0 deletions gcc/testsuite/gcc.target/arm/bfloat16_simd_2_2.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* { dg-do assemble { target { arm*-*-* } } } */
/* { dg-require-effective-target arm_softfp_ok } */
/* { dg-require-effective-target arm_v8_neon_ok } */
/* { dg-require-effective-target arm_v8_2a_bf16_neon_ok } */
/* { dg-additional-options "-march=armv8.2-a -mfloat-abi=softfp -mfpu=neon-fp-armv8" } */
Expand Down
1 change: 1 addition & 0 deletions gcc/testsuite/gcc.target/arm/bfloat16_simd_3_1.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* { dg-do assemble { target { arm*-*-* } } } */
/* { dg-require-effective-target arm_hard_ok } */
/* { dg-require-effective-target arm_v8_neon_ok } */
/* { dg-require-effective-target arm_v8_2a_bf16_neon_ok } */
/* { dg-additional-options "-march=armv8.2-a -mfloat-abi=hard -mfpu=neon-fp-armv8" } */
Expand Down
1 change: 1 addition & 0 deletions gcc/testsuite/gcc.target/arm/bfloat16_simd_3_2.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* { dg-do assemble { target { arm*-*-* } } } */
/* { dg-require-effective-target arm_softfp_ok } */
/* { dg-require-effective-target arm_v8_neon_ok } */
/* { dg-require-effective-target arm_v8_2a_bf16_neon_ok } */
/* { dg-additional-options "-march=armv8.2-a -mfloat-abi=softfp -mfpu=neon-fp-armv8" } */
Expand Down
3 changes: 2 additions & 1 deletion gcc/testsuite/gcc.target/arm/pr51968.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* PR target/51968 */
/* { dg-do compile } */
/* { dg-options "-O2 -march=armv7-a -mfloat-abi=softfp -mfpu=neon" } */
/* { dg-require-effective-target arm_softfp_ok } */
/* { dg-require-effective-target arm_neon_ok } */
/* { dg-options "-O2 -march=armv7-a -mfloat-abi=softfp -mfpu=neon" } */
#include <arm_neon.h>

struct T { int8x8x2_t val; };
Expand Down
1 change: 1 addition & 0 deletions gcc/testsuite/gcc.target/arm/simd/bf16_vldn_1.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* { dg-do assemble } */
/* { dg-require-effective-target arm_hard_ok } */
/* { dg-require-effective-target arm_v8_2a_bf16_neon_ok } */
/* { dg-add-options arm_v8_2a_bf16_neon } */
/* { dg-additional-options "-save-temps -O2 -mfloat-abi=hard" } */
Expand Down
1 change: 1 addition & 0 deletions gcc/testsuite/gcc.target/arm/simd/bf16_vstn_1.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* { dg-do assemble } */
/* { dg-require-effective-target arm_hard_ok } */
/* { dg-require-effective-target arm_v8_2a_bf16_neon_ok } */
/* { dg-add-options arm_v8_2a_bf16_neon } */
/* { dg-additional-options "-save-temps -O2 -mfloat-abi=hard" } */
Expand Down

0 comments on commit fcfad74

Please sign in to comment.