@@ -2560,6 +2560,10 @@ Target supports @file{fenv.h} with all the standard IEEE exceptions
and floating-point exceptions are raised by arithmetic operations for
decimal floating point.
+@item fenv_setround
+Target supports @file{fenv.h} and any standard IEEE rounding mode that is
+defined is implemented in the environment under test.
+
@item fileio
Target offers such file I/O library functions as @code{fopen},
@code{fclose}, @code{tmpnam}, and @code{remove}. This is a link-time
@@ -1,6 +1,6 @@
/* PR57245 */
/* { dg-do run } */
-/* { dg-require-effective-target fenv } */
+/* { dg-require-effective-target fenv_setround } */
/* { dg-additional-options "-frounding-math" } */
#include <fenv.h>
@@ -4,7 +4,7 @@
/* { dg-require-effective-target __float128 } */
/* { dg-require-effective-target base_quadfloat_support } */
/* { dg-require-effective-target int128 } */
-/* { dg-require-effective-target fenv } */
+/* { dg-require-effective-target fenv_setround } */
/* { dg-options "-frounding-math" } */
/* { dg-add-options __float128 } */
@@ -2,7 +2,7 @@
float. */
/* { dg-do run } */
/* { dg-require-effective-target int128 } */
-/* { dg-require-effective-target fenv } */
+/* { dg-require-effective-target fenv_setround } */
/* { dg-options "-frounding-math" } */
#include <fenv.h>
@@ -2,7 +2,7 @@
float. */
/* { dg-do run } */
/* { dg-require-effective-target int128 } */
-/* { dg-require-effective-target fenv } */
+/* { dg-require-effective-target fenv_setround } */
/* { dg-options "-frounding-math" } */
#include <fenv.h>
@@ -2,7 +2,7 @@
float. */
/* { dg-do run } */
/* { dg-require-effective-target int128 } */
-/* { dg-require-effective-target fenv } */
+/* { dg-require-effective-target fenv_setround } */
/* { dg-options "-frounding-math" } */
#include <fenv.h>
@@ -1,6 +1,6 @@
/* PR84407 */
/* { dg-do run } */
-/* { dg-require-effective-target fenv } */
+/* { dg-require-effective-target fenv_setround } */
/* { dg-additional-options "-frounding-math -fexcess-precision=standard" } */
#include <fenv.h>
@@ -1,6 +1,6 @@
/* PR84407 */
/* { dg-do run } */
-/* { dg-require-effective-target fenv } */
+/* { dg-require-effective-target fenv_setround } */
/* { dg-additional-options "-frounding-math" } */
#include <fenv.h>
@@ -10685,6 +10685,41 @@ proc check_effective_target_fenv_exceptions_dfp {} {
} [add_options_for_ieee "-std=gnu99"]]
}
+
+# Return 1 if <fenv.h> is availiable and supports fesetround.
+
+proc check_effective_target_fenv_setround {} {
+ return [check_runtime fenv_setround {
+ #include <fenv.h>
+ #include <stdlib.h>
+ int
+ main (void)
+ {
+ #ifdef FE_TONEAREST
+ if (fesetround (FE_TONEAREST) != 0)
+ abort ();
+ #endif
+
+ #ifdef FE_UPWARD
+ if (fesetround (FE_UPWARD) != 0)
+ abort ();
+ #endif
+
+ #ifdef FE_DOWNWARD
+ if (fesetround (FE_DOWNWARD) != 0)
+ abort ();
+ #endif
+
+ #ifdef FE_TOWARDZERO
+ if (fesetround (FE_TOWARDZERO) != 0)
+ abort ();
+ #endif
+
+ exit (0);
+ }
+ } [add_options_for_ieee "-std=gnu99"]]
+}
+
# Return 1 if -fexceptions is supported.
proc check_effective_target_exceptions {} {