]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Support running libm tests for float128 as alias for long double.
authorJoseph Myers <joseph@codesourcery.com>
Mon, 16 Oct 2017 13:28:30 +0000 (13:28 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Mon, 16 Oct 2017 13:28:30 +0000 (13:28 +0000)
This patch adds support for running libm tests for float128 in the
case where the float128 functions are aliases of long double
functions.  In this case, the sysdeps Makeconfig file
(i.e. sysdeps/ieee754/ldbl-128/Makeconfig) will need to define
"float128-alias-fcts = yes" to enable the tests.

Tested for x86_64.  Also tested with build-many-glibcs.py; installed
stripped shared libraries are unchanged by the patch.  Also tested
together with changes to enable the float128 aliases.

* math/Makefile (test-types): Add
$(type-float128-$(float128-alias-fcts)).
* math/test-float128.h (TYPE_STR): Define conditional on
[FLT128_MANT_DIG == LDBL_MANT_DIG].
(ULP_IDX): Likewise.
(ULP_I_IDX): Likewise.

ChangeLog
math/Makefile
math/test-float128.h

index 52ea0d96aa9dda9eaec24a643da87987fc6f3d3d..e45b749a40e8da0918d42b44cc6526b6bb031c9b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2017-10-16  Joseph Myers  <joseph@codesourcery.com>
 
+       * math/Makefile (test-types): Add
+       $(type-float128-$(float128-alias-fcts)).
+       * math/test-float128.h (TYPE_STR): Define conditional on
+       [FLT128_MANT_DIG == LDBL_MANT_DIG].
+       (ULP_IDX): Likewise.
+       (ULP_I_IDX): Likewise.
+
        * stdlib/strtold.c: Include <bits/floatn.h>
        [__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (strtof128): Define
        and later undefine as macro.  Define as weak alias if
index 4014471f74d525c695bc700e9b95164ef57dba92..2d4720939c8a645ec66ebc4f2c78d6148a0d99b8 100644 (file)
@@ -127,7 +127,8 @@ type-float128-suffix := f128
 type-float128-routines := t_sincosf128 k_sincosf128
 type-float128-yes := float128
 types = $(types-basic) $(type-float128-$(float128-fcts))
-test-types = $(test-types-basic) $(type-float128-$(float128-fcts))
+test-types = $(test-types-basic) $(type-float128-$(float128-fcts)) \
+            $(type-float128-$(float128-alias-fcts))
 
 # For each of the basic types (float, double, long double), replace the
 # occurrences of 'F' in arg 1 with the appropriate suffix for the type.
index 3132766aa4619d23bf3594804f36758d5ebf2d27..3fd9f5448ef56969773b7ea59021c8df1fcb7cfa 100644 (file)
 #define CFLOAT __CFLOAT128
 #define BUILD_COMPLEX(real, imag) (CMPLXF128 ((real), (imag)))
 #define PREFIX FLT128
-#define TYPE_STR "float128"
-#define ULP_IDX ULP_FLT128
-#define ULP_I_IDX ULP_I_FLT128
+#if FLT128_MANT_DIG == LDBL_MANT_DIG
+# define TYPE_STR "ldouble"
+# define ULP_IDX ULP_LDBL
+# define ULP_I_IDX ULP_I_LDBL
+#else
+# define TYPE_STR "float128"
+# define ULP_IDX ULP_FLT128
+# define ULP_I_IDX ULP_I_FLT128
+#endif
 #define LIT(x) __f128 (x)
 #define LITM(x) x ## f128
 #define FTOSTR strfromf128