From 0efa6f8b9906cddf2da36722449c8e30fb698b37 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 10 Jun 2013 12:34:49 +0000 Subject: Add rounding mode information to math-tests.h and use it in libm-test.inc. --- sysdeps/generic/math-tests.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'sysdeps/generic') diff --git a/sysdeps/generic/math-tests.h b/sysdeps/generic/math-tests.h index da8747a944..b1e9fd72a7 100644 --- a/sysdeps/generic/math-tests.h +++ b/sysdeps/generic/math-tests.h @@ -40,3 +40,21 @@ #ifndef SNAN_TESTS_TYPE_CAST # define SNAN_TESTS_TYPE_CAST 1 #endif + +/* Indicate whether to run tests involving a given rounding mode for a + given floating-point type, given that fesetround succeeds for that + mode. All are run if fesetround succeeds unless overridden. */ +#ifndef ROUNDING_TESTS_float +# define ROUNDING_TESTS_float(MODE) 1 +#endif +#ifndef ROUNDING_TESTS_double +# define ROUNDING_TESTS_double(MODE) 1 +#endif +#ifndef ROUNDING_TESTS_long_double +# define ROUNDING_TESTS_long_double(MODE) 1 +#endif + +#define ROUNDING_TESTS(TYPE, MODE) \ + (sizeof (TYPE) == sizeof (float) ? ROUNDING_TESTS_float (MODE) \ + : sizeof (TYPE) == sizeof (double) ? ROUNDING_TESTS_double (MODE) \ + : ROUNDING_TESTS_long_double (MODE)) -- cgit 1.4.1