summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2022-03-18 16:42:23 +0100
committerTom de Vries <tdevries@suse.de>2022-03-22 14:35:35 +0100
commitb57358cc71356c817500042f7d517ac3309195b1 (patch)
tree8b542631339ba607d92cc72a4db0ca80a708f334 /gcc
parenta4baa0d3c5ad66e5ec24b8b5db7042739f0290aa (diff)
[nvptx] Limit HFmode support to mexperimental
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/nvptx/nvptx.cc4
-rw-r--r--gcc/testsuite/gcc.target/nvptx/float16-1.c1
-rw-r--r--gcc/testsuite/gcc.target/nvptx/float16-2.c1
-rw-r--r--gcc/testsuite/gcc.target/nvptx/float16-3.c1
-rw-r--r--gcc/testsuite/gcc.target/nvptx/float16-4.c1
-rw-r--r--gcc/testsuite/gcc.target/nvptx/float16-5.c1
-rw-r--r--gcc/testsuite/gcc.target/nvptx/float16-6.c1
7 files changed, 8 insertions, 2 deletions
diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc
index b2f7b4af392..87efc23bd96 100644
--- a/gcc/config/nvptx/nvptx.cc
+++ b/gcc/config/nvptx/nvptx.cc
@@ -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);
diff --git a/gcc/testsuite/gcc.target/nvptx/float16-1.c b/gcc/testsuite/gcc.target/nvptx/float16-1.c
index 873a0543535..017774c2941 100644
--- a/gcc/testsuite/gcc.target/nvptx/float16-1.c
+++ b/gcc/testsuite/gcc.target/nvptx/float16-1.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math -misa=sm_53 -mptx=_" } */
+/* { dg-additional-options "-mexperimental" } */
_Float16 var;
diff --git a/gcc/testsuite/gcc.target/nvptx/float16-2.c b/gcc/testsuite/gcc.target/nvptx/float16-2.c
index 30a3092bc29..e15b685253b 100644
--- a/gcc/testsuite/gcc.target/nvptx/float16-2.c
+++ b/gcc/testsuite/gcc.target/nvptx/float16-2.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math -misa=sm_80 -mptx=_" } */
+/* { dg-additional-options "-mexperimental" } */
_Float16 x;
_Float16 y;
diff --git a/gcc/testsuite/gcc.target/nvptx/float16-3.c b/gcc/testsuite/gcc.target/nvptx/float16-3.c
index edd6514a976..1c646902055 100644
--- a/gcc/testsuite/gcc.target/nvptx/float16-3.c
+++ b/gcc/testsuite/gcc.target/nvptx/float16-3.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -misa=sm_53 -mptx=_" } */
+/* { dg-additional-options "-mexperimental" } */
_Float16 var;
diff --git a/gcc/testsuite/gcc.target/nvptx/float16-4.c b/gcc/testsuite/gcc.target/nvptx/float16-4.c
index 0a823971e75..1c24ec8c3b2 100644
--- a/gcc/testsuite/gcc.target/nvptx/float16-4.c
+++ b/gcc/testsuite/gcc.target/nvptx/float16-4.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math -misa=sm_53 -mptx=_" } */
+/* { dg-additional-options "-mexperimental" } */
_Float16 var;
diff --git a/gcc/testsuite/gcc.target/nvptx/float16-5.c b/gcc/testsuite/gcc.target/nvptx/float16-5.c
index 2261f42baac..9ae3365e1a6 100644
--- a/gcc/testsuite/gcc.target/nvptx/float16-5.c
+++ b/gcc/testsuite/gcc.target/nvptx/float16-5.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math -misa=sm_53 -mptx=_" } */
+/* { dg-additional-options "-mexperimental" } */
_Float16 a;
_Float16 b;
diff --git a/gcc/testsuite/gcc.target/nvptx/float16-6.c b/gcc/testsuite/gcc.target/nvptx/float16-6.c
index 9ca714ca76f..37c580429c5 100644
--- a/gcc/testsuite/gcc.target/nvptx/float16-6.c
+++ b/gcc/testsuite/gcc.target/nvptx/float16-6.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -misa=sm_53 -mptx=_" } */
+/* { dg-additional-options "-mexperimental" } */
_Float16 x;
_Float16 y;