]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[nvptx] Limit HFmode support to mexperimental
authorTom de Vries <tdevries@suse.de>
Fri, 18 Mar 2022 15:42:23 +0000 (16:42 +0100)
committerTom de Vries <tdevries@suse.de>
Tue, 22 Mar 2022 13:35:35 +0000 (14:35 +0100)
With PR104489 still open and end-of-stage-4 approaching, classify HFmode
support as experimental, which is not enabled by default but can be enabled
using -mexperimental.

This fixes the nvptx build when the default sm_xx is set to sm_53 or higher.

Note that we're not using -mfp16 or some such, because that might create
expectations about being able to switch support on or off in the future, and
at this point it's not clear why, once reaching non-experimental status, it
shouldn't always be enabled.

gcc/ChangeLog:

2022-03-19  Tom de Vries  <tdevries@suse.de>

* config/nvptx/nvptx.cc (nvptx_scalar_mode_supported_p)
(nvptx_libgcc_floating_mode_supported_p): Only enable HFmode for
mexperimental.

gcc/testsuite/ChangeLog:

2022-03-19  Tom de Vries  <tdevries@suse.de>

* gcc.target/nvptx/float16-1.c: Add additional-options -mexperimental.
* gcc.target/nvptx/float16-2.c: Same.
* gcc.target/nvptx/float16-3.c: Same.
* gcc.target/nvptx/float16-4.c: Same.
* gcc.target/nvptx/float16-5.c: Same.
* gcc.target/nvptx/float16-6.c: Same.

gcc/config/nvptx/nvptx.cc
gcc/testsuite/gcc.target/nvptx/float16-1.c
gcc/testsuite/gcc.target/nvptx/float16-2.c
gcc/testsuite/gcc.target/nvptx/float16-3.c
gcc/testsuite/gcc.target/nvptx/float16-4.c
gcc/testsuite/gcc.target/nvptx/float16-5.c
gcc/testsuite/gcc.target/nvptx/float16-6.c

index b2f7b4af392d401300e69a243cf7ec859daafa2b..87efc23bd96a5a9c3d9476c528ae1d3ed76b81a2 100644 (file)
@@ -7156,7 +7156,7 @@ nvptx_cannot_force_const_mem (machine_mode mode ATTRIBUTE_UNUSED,
 static bool
 nvptx_scalar_mode_supported_p (scalar_mode mode)
 {
-  if (mode == HFmode && TARGET_SM53)
+  if (nvptx_experimental && mode == HFmode && TARGET_SM53)
     return true;
 
   return default_scalar_mode_supported_p (mode);
@@ -7165,7 +7165,7 @@ nvptx_scalar_mode_supported_p (scalar_mode mode)
 static bool
 nvptx_libgcc_floating_mode_supported_p (scalar_float_mode mode)
 {
-  if (mode == HFmode && TARGET_SM53)
+  if (nvptx_experimental && mode == HFmode && TARGET_SM53)
     return true;
 
   return default_libgcc_floating_mode_supported_p (mode);
index 873a05435359f671afdfeb1a8ac229fdd8b04aad..017774c29415b3798d78936693e5fcdea280ce47 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -ffast-math -misa=sm_53 -mptx=_" } */
+/* { dg-additional-options "-mexperimental" } */
 
 _Float16 var;
 
index 30a3092bc29e009b98ca7913dd8c1be928c507ed..e15b685253bae501bfe0608dbdf885dd4465c07d 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -ffast-math -misa=sm_80 -mptx=_" } */
+/* { dg-additional-options "-mexperimental" } */
 
 _Float16 x;
 _Float16 y;
index edd6514a9763e18d0efc6fe09dd596935c0200f7..1c6469020555e5b2b2aaafa0a1ab73817a2ba9f3 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -misa=sm_53 -mptx=_" } */
+/* { dg-additional-options "-mexperimental" } */
 
 _Float16 var;
 
index 0a823971e75f8f15eb1e44622780e6c46c830660..1c24ec8c3b26c6ca8abc7ddba9048971f9110150 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -ffast-math -misa=sm_53 -mptx=_" } */
+/* { dg-additional-options "-mexperimental" } */
 
 _Float16 var;
 
index 2261f42baaccbce3a4722d7878440501810c3cbf..9ae3365e1a6e3c6685e6d41d11a897d8e1ad5625 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -ffast-math -misa=sm_53 -mptx=_" } */
+/* { dg-additional-options "-mexperimental" } */
 
 _Float16 a;
 _Float16 b;
index 9ca714ca76fd63d54f03eb1e3115d198ee85fa20..37c580429c559c6a593b6734359a7d9d5a6351ba 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -misa=sm_53 -mptx=_" } */
+/* { dg-additional-options "-mexperimental" } */
 
 _Float16 x;
 _Float16 y;