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.
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);
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);
/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math -misa=sm_53 -mptx=_" } */
+/* { dg-additional-options "-mexperimental" } */
_Float16 var;
/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math -misa=sm_80 -mptx=_" } */
+/* { dg-additional-options "-mexperimental" } */
_Float16 x;
_Float16 y;
/* { dg-do compile } */
/* { dg-options "-O2 -misa=sm_53 -mptx=_" } */
+/* { dg-additional-options "-mexperimental" } */
_Float16 var;
/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math -misa=sm_53 -mptx=_" } */
+/* { dg-additional-options "-mexperimental" } */
_Float16 var;
/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math -misa=sm_53 -mptx=_" } */
+/* { dg-additional-options "-mexperimental" } */
_Float16 a;
_Float16 b;
/* { dg-do compile } */
/* { dg-options "-O2 -misa=sm_53 -mptx=_" } */
+/* { dg-additional-options "-mexperimental" } */
_Float16 x;
_Float16 y;