diff --git a/gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-3.C b/gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-3.C index 29080c7514f4c0d48469a59a4c0d13a826078f93..5eceb3074dfdf00ec823a9783c5bce7d3da58d24 100644 --- a/gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-3.C +++ b/gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-3.C @@ -1,6 +1,6 @@ /* Test various operators on __fp16 and mixed __fp16/float operands. */ /* { dg-do run { target arm*-*-* } } */ /* { dg-require-effective-target arm_fp16_alternative_ok } */ -/* { dg-options "-mfp16-format=alternative" } */ +/* { dg-add-options arm_fp16_alternative } */ #include "arm-fp16-ops.h" diff --git a/gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-4.C b/gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-4.C index 4be8883faad20415bf736b637b03f46ba3f233d4..d86019f14699dbbe905439a181263bad5c08693c 100644 --- a/gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-4.C +++ b/gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-4.C @@ -1,6 +1,7 @@ /* Test various operators on __fp16 and mixed __fp16/float operands. */ /* { dg-do run { target arm*-*-* } } */ /* { dg-require-effective-target arm_fp16_alternative_ok } */ -/* { dg-options "-mfp16-format=alternative -ffast-math" } */ +/* { dg-options "-ffast-math" } */ +/* { dg-add-options arm_fp16_alternative } */ #include "arm-fp16-ops.h" diff --git a/gcc/testsuite/gcc.dg/torture/arm-fp16-int-convert-alt.c b/gcc/testsuite/gcc.dg/torture/arm-fp16-int-convert-alt.c index f013b59ddde0d44e044805527d5c87661041667f..42171d4e83e23e6da8b366c5775dcaf548a09c0b 100644 --- a/gcc/testsuite/gcc.dg/torture/arm-fp16-int-convert-alt.c +++ b/gcc/testsuite/gcc.dg/torture/arm-fp16-int-convert-alt.c @@ -1,7 +1,7 @@ /* Test floating-point conversions. Standard types and __fp16. */ /* { dg-do run { target arm*-*-* } } */ /* { dg-require-effective-target arm_fp16_alternative_ok } -/* { dg-options "-mfp16-format=alternative" } */ +/* { dg-add-options arm_fp16_alternative } */ #include "fp-int-convert.h" #define FP16_MANT_DIG 11 diff --git a/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-3.c b/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-3.c index 7716baf818ec4cc999e3ecde7600835a145f99cc..3f0aecf357b4ec067b311c5a2fedc2073ed2da87 100644 --- a/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-3.c +++ b/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-3.c @@ -1,6 +1,6 @@ /* Test various operators on __fp16 and mixed __fp16/float operands. */ /* { dg-do run { target arm*-*-* } } */ /* { dg-require-effective-target arm_fp16_alternative_ok } -/* { dg-options "-mfp16-format=alternative" } */ +/* { dg-add-options arm_fp16_alternative } */ #include "arm-fp16-ops.h" diff --git a/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-4.c b/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-4.c index 1940f4320d0cd9dfecef96e0fe661365b76a6e20..846515b5eabcaaad44be1d4f8a29fc8988bb3219 100644 --- a/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-4.c +++ b/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-4.c @@ -1,6 +1,7 @@ /* Test various operators on __fp16 and mixed __fp16/float operands. */ /* { dg-do run { target arm*-*-* } } */ /* { dg-require-effective-target arm_fp16_alternative_ok } -/* { dg-options "-mfp16-format=alternative -ffast-math" } */ +/* { dg-options "-ffast-math" } */ +/* { dg-add-options arm_fp16_alternative } */ #include "arm-fp16-ops.h" diff --git a/gcc/testsuite/gcc.target/arm/fp16-aapcs-3.c b/gcc/testsuite/gcc.target/arm/fp16-aapcs-3.c index 858181cdd8561346e35ef9ce0d249e8d38d9e802..56a3ae2618432a408cd9b20f9e1334106efab98b 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-aapcs-3.c +++ b/gcc/testsuite/gcc.target/arm/fp16-aapcs-3.c @@ -1,7 +1,8 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_hard_vfp_ok } */ /* { dg-require-effective-target arm_fp16_alternative_ok } */ -/* { dg-options "-O2 -mfp16-format=alternative" } */ +/* { dg-options "-O2" } */ +/* { dg-add-options arm_fp16_alternative } */ /* Test __fp16 arguments and return value in registers (hard-float). */ diff --git a/gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c b/gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c index ae65fb86184e30dc693893e9ddbd4cbb38fc15e5..daac29137aeb2efa75ee4172524b5f3797bde715 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c +++ b/gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_fp16_alternative_ok } */ -/* { dg-options "-mfloat-abi=softfp -O2 -mfp16-format=alternative" } */ +/* { dg-options "-mfloat-abi=softfp -O2" } */ +/* { dg-add-options arm_fp16_alternative } */ /* { dg-skip-if "incompatible float-abi" { arm*-*-* } { "-mfloat-abi=hard" } } */ /* Test __fp16 arguments and return value in registers (softfp). */ diff --git a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-1.c b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-1.c index 0845e886a835df4207f406a2880b86fe76eb3a94..ab5e1d5f43081ea58e74e3e53b17dec8603248eb 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-1.c +++ b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-1.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_fp16_alternative_ok } */ -/* { dg-options "-mfp16-format=alternative" } */ +/* { dg-add-options arm_fp16_alternative } */ __fp16 xx = 0.0; diff --git a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-10.c b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-10.c index a8772a19ae00f85238a6ab174caae1d9d9f97019..985299d26458ec4f9f8ab71055dc291565c489d9 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-10.c +++ b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-10.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_fp16_alternative_ok } */ -/* { dg-options "-mfp16-format=alternative -pedantic -std=gnu99" } */ +/* { dg-options "-pedantic -std=gnu99" } */ +/* { dg-add-options arm_fp16_alternative } */ #include <math.h> diff --git a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-11.c b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-11.c index 1cb3d2c4963fc46a37b83a7b0b60148d7cb30f68..7c506e9a88456bd081987f9cc6613460f23386a1 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-11.c +++ b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-11.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_fp16_alternative_ok } */ -/* { dg-options "-mfp16-format=alternative -pedantic -std=gnu99" } */ +/* { dg-options "-pedantic -std=gnu99" } */ +/* { dg-add-options arm_fp16_alternative } */ #include <math.h> diff --git a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-12.c b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-12.c index 3c3bd2f02f6f90c15cac7cb60e0ffa859540e874..f7cb3f0455874ca1b2550511e09d44fe6344e890 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-12.c +++ b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-12.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_fp16_alternative_ok } */ -/* { dg-options "-mfp16-format=alternative" } */ +/* { dg-add-options arm_fp16_alternative } */ float xx __attribute__((mode(HF))) = 0.0; diff --git a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-2.c b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-2.c index 8a45f1f4ae10c893a4de481b2ef2efc11e6b71cb..a3eebfee189596224424c0cfb1894af2b5c5098c 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-2.c +++ b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-2.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_fp16_alternative_ok } */ -/* { dg-options "-mfp16-format=alternative" } */ +/* { dg-add-options arm_fp16_alternative } */ /* Encoding taken from: http://en.wikipedia.org/wiki/Half_precision */ /* 0x3c00 = 15360 */ diff --git a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-3.c b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-3.c index 7221766284ebb79d8f5b829461f117961d562594..c1ae6de7c1184754b6e67fec8398ecf51952d311 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-3.c +++ b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-3.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_fp16_alternative_ok } */ -/* { dg-options "-mfp16-format=alternative" } */ +/* { dg-add-options arm_fp16_alternative } */ /* Encoding taken from: http://en.wikipedia.org/wiki/Half_precision */ /* 0xc000 = 49152 */ diff --git a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-4.c b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-4.c index cfeb61aaea74cf24fb0d2afc396df843e07020e9..e244bd1745e8e465b925ef3f4851325455f2eb63 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-4.c +++ b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-4.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_fp16_alternative_ok } */ -/* { dg-options "-mfp16-format=alternative" } */ +/* { dg-add-options arm_fp16_alternative } */ /* Encoding taken from: http://en.wikipedia.org/wiki/Half_precision */ /* 0x7bff = 31743 */ diff --git a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-5.c b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-5.c index 3b741ae62dcd4ac9a79810f15a325749e37b57eb..373a59a4fb64fcac0ee2a5d57de9ba0648195baf 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-5.c +++ b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-5.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_fp16_alternative_ok } */ -/* { dg-options "-mfp16-format=alternative" } */ +/* { dg-add-options arm_fp16_alternative } */ /* Encoding taken from: http://en.wikipedia.org/wiki/Half_precision */ /* 0x3555 = 13653 */ diff --git a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-6.c b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-6.c index abffff5fa60b1482d5c52353925c57e4fc38b9f1..a8503ddb51f0efeef49d98234596dd9c7763404b 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-6.c +++ b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-6.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_fp16_alternative_ok } */ -/* { dg-options "-mfp16-format=alternative" } */ +/* { dg-add-options arm_fp16_alternative } */ /* This number is the maximum value representable in the alternative encoding. */ diff --git a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-7.c b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-7.c index c339f197cd77c365ec8f042413ecd4e435849ae4..0e59234cfd48b04bf76273f14668907eb1fa2cba 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-7.c +++ b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-7.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_fp16_alternative_ok } */ -/* { dg-options "-mfp16-format=alternative -pedantic" } */ +/* { dg-options "-pedantic" } */ +/* { dg-add-options arm_fp16_alternative } */ /* This number overflows the range of the alternative encoding. Since this encoding doesn't have infinities, we should get a pedantic warning, diff --git a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-8.c b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-8.c index deeb5cd557423874f24702494b37d3ecfca27eaf..36e71c36d4ed40a7dbd60de8079d6c04767184b5 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-8.c +++ b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-8.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_fp16_alternative_ok } */ -/* { dg-options "-mfp16-format=alternative" } */ +/* { dg-add-options arm_fp16_alternative } */ /* Encoding taken from: http://en.wikipedia.org/wiki/Half_precision */ /* This is the minimum normalized value. */ diff --git a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-9.c b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-9.c index f9f565453e70eb06715ea0507f169f6ac98f8609..5a2eef7df2f05aa5651c77f56b7735aba91fe82e 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-compile-alt-9.c +++ b/gcc/testsuite/gcc.target/arm/fp16-compile-alt-9.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_fp16_alternative_ok } */ -/* { dg-options "-mfp16-format=alternative" } */ +/* { dg-add-options arm_fp16_alternative } */ /* Encoding taken from: http://en.wikipedia.org/wiki/Half_precision */ /* This is the minimum denormalized value. */ diff --git a/gcc/testsuite/gcc.target/arm/fp16-rounding-alt-1.c b/gcc/testsuite/gcc.target/arm/fp16-rounding-alt-1.c index 27bb40dcfee837587e79af6e2be90290a572c06f..2ad03afbcd1e4d5f25905a53752a3b34eb321538 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-rounding-alt-1.c +++ b/gcc/testsuite/gcc.target/arm/fp16-rounding-alt-1.c @@ -3,8 +3,10 @@ __fp16 via float. */ /* { dg-do run } */ +/* { dg-require-effective-target arm_fp16_hw } */ /* { dg-require-effective-target arm_fp16_alternative_ok } */ -/* { dg-options "-mfp16-format=alternative" } */ +/* { dg-options "-std=c99" } */ +/* { dg-add-options arm_fp16_alternative } */ #include <stdlib.h> diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index b1faaf4aa955efdb78cdc13a139a0a11b24012a7..6ce8557c9a9d6906c809d9218d45dddc1a18eadc 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -5247,25 +5247,25 @@ proc add_options_for_aarch64_sve { flags } { # Return 1 if this is an ARM target supporting the FP16 alternative # format. Some multilibs may be incompatible with the options needed. Also -# set et_arm_neon_fp16_flags to the best options to add. +# set et_arm_fp16_alternative_flags to the best options to add. proc check_effective_target_arm_fp16_alternative_ok_nocache { } { if { [istarget *-*-vxworks7*] } { # Not supported by the target system. return 0 } - global et_arm_neon_fp16_flags - set et_arm_neon_fp16_flags "" + global et_arm_fp16_alternative_flags + set et_arm_fp16_alternative_flags "" if { [check_effective_target_arm32] } { foreach flags {"" "-mfloat-abi=softfp" "-mfpu=neon-fp16" "-mfpu=neon-fp16 -mfloat-abi=softfp"} { if { [check_no_compiler_messages_nocache \ arm_fp16_alternative_ok object { - #if !defined (__ARM_FP16_FORMAT_ALTERNATIVE) + #if !defined (__ARM_FP16_FORMAT_ALTERNATIVE) || ! (__ARM_FP & 2) #error __ARM_FP16_FORMAT_ALTERNATIVE not defined #endif } "$flags -mfp16-format=alternative"] } { - set et_arm_neon_fp16_flags "$flags -mfp16-format=alternative" + set et_arm_fp16_alternative_flags "$flags -mfp16-format=alternative" return 1 } } @@ -5404,11 +5404,11 @@ proc add_options_for_arm_fp16_ieee { flags } { # half-precision support. This is valid for ARM targets. proc add_options_for_arm_fp16_alternative { flags } { - if { ! [check_effective_target_arm_fp16_ok] } { + if { ! [check_effective_target_arm_fp16_alternative_ok] } { return "$flags" } - global et_arm_fp16_flags - return "$flags $et_arm_fp16_flags -mfp16-format=alternative" + global et_arm_fp16_alternative_flags + return "$flags $et_arm_fp16_alternative_flags" } # Return 1 if this is an ARM target that can support a VFP fp16 variant.