Patchwork Update libquadmath from GLIBC

login
register
mail settings
Submitter Tobias Burnus
Date Oct. 31, 2012, 4:17 p.m.
Message ID <50914F30.8010104@net-b.de>
Download mbox | patch
Permalink /patch/195919/
State New
Headers show

Comments

Tobias Burnus - Oct. 31, 2012, 4:17 p.m.
Jakub Jelinek:
> I think it would be nice if you also posted the changes you did to 
> test-ldouble.c and libm-test.inc, so that next time we could more 
> easily test it again.

See attachment. (I didn't do it properly at first, thus, I had to 
propagate the changes to the right files …)

Tobias
Andreas Schwab - Oct. 31, 2012, 4:32 p.m.
Tobias Burnus <burnus@net-b.de> writes:

> diff --git a/math/libm-test.inc b/math/libm-test.inc
> index 1e067fe..81b40b6 100644
> --- a/math/libm-test.inc
> +++ b/math/libm-test.inc
> @@ -226,5 +226,5 @@ static FLOAT max_error, real_max_error, imag_max_error;
>  
>  #define BUILD_COMPLEX(real, imag) \
> -  ({ __complex__ FLOAT __retval;					      \
> +  ({ COMPLEX __retval;					      \

Wouldn't it make sense for the compiler to support __complex__
__float128?

Andreas.
Joseph S. Myers - Oct. 31, 2012, 5:09 p.m.
On Wed, 31 Oct 2012, Tobias Burnus wrote:

> Jakub Jelinek:
> > I think it would be nice if you also posted the changes you did to
> > test-ldouble.c and libm-test.inc, so that next time we could more easily
> > test it again.
> 
> See attachment. (I didn't do it properly at first, thus, I had to propagate
> the changes to the right files )

Is there also a change to gen-libm-test.pl (or elsewhere) to change "l" or 
"L" suffixes on constants (inputs and expected results) to "Q"?  You 
define TEST_LDOUBLE, but don't seem to redefine LDBL_MANT_DIG - does this 
mean that the tests conditioned e.g. on LDBL_MANT_DIG >= 113 don't run?

(Really I'd like the tests in glibc to be conditioned on the particular 
features they need, e.g. at least a certain number of mantissa bits, 
rather than hardcoding conditions such as "defined TEST_LDOUBLE && 
LDBL_MANT_DIG >= 113".)

When the draft C floating-point TS is more advanced, it's expected to 
define standard names for standard IEEE 754 types, when the implementation 
supports them (such as _Float128), and standard function names (such as 
expf128) - at that point it might make sense to consider rearranging the 
glibc ldbl-128 code so that it can be used both to provide _Float128 
functions and "long double" functions, and making glibc provide these 
functions as they will now have standard C bindings.  (libquadmath will 
still make sense for non-glibc or older-glibc systems, but hopefully the 
implementations can be closer to the glibc versions then.  And supporting 
the various parts of the floating-point TS in glibc would be a lot of 
work.)

Patch

diff --git a/math/libm-test.inc b/math/libm-test.inc
index 1e067fe..81b40b6 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -226,5 +226,5 @@  static FLOAT max_error, real_max_error, imag_max_error;
 
 #define BUILD_COMPLEX(real, imag) \
-  ({ __complex__ FLOAT __retval;					      \
+  ({ COMPLEX __retval;					      \
      __real__ __retval = (real);					      \
      __imag__ __retval = (imag);					      \
@@ -401,5 +401,5 @@  print_max_error (const char *func_name, FLOAT allowed, int xfail)
 
 static void
-print_complex_max_error (const char *func_name, __complex__ FLOAT allowed,
+print_complex_max_error (const char *func_name, COMPLEX allowed,
 			 __complex__ int xfail)
 {
@@ -615,7 +615,7 @@  check_float (const char *test_name, FLOAT computed, FLOAT expected,
 
 static void
-check_complex (const char *test_name, __complex__ FLOAT computed,
-	       __complex__ FLOAT expected,
-	       __complex__ FLOAT max_ulp, __complex__ int xfail,
+check_complex (const char *test_name, COMPLEX computed,
+	       COMPLEX expected,
+	       COMPLEX max_ulp, __complex__ int xfail,
 	       int exception)
 {
@@ -4208,4 +4208,6 @@  exp_test_upward (void)
 
 
+/* FIXME: Not yet implemented in libquadmath.  */
+#if 0
 static void
 exp10_test (void)
@@ -4245,6 +4247,9 @@  exp10_test (void)
   END (exp10);
 }
+#endif
 
 
+/* FIXME: Not yet implemented in libquadmath.  */
+#if 0
 static void
 exp2_test (void)
@@ -4289,4 +4294,5 @@  exp2_test (void)
   END (exp2);
 }
+#endif
 
 
@@ -5064,4 +5070,6 @@  frexp_test (void)
 
 
+/* FIXME: Not implemented in libquadmath - use lgamma/tgamma.  */
+#if 0
 static void
 gamma_test (void)
@@ -5090,4 +5098,5 @@  gamma_test (void)
   END (gamma);
 }
+#endif
 
 static void
@@ -6620,4 +6629,6 @@  log2_test (void)
 
 
+/* FIXME: Not implemented in libquadmath.  */
+#if 0
 static void
 logb_test (void)
@@ -6691,4 +6702,5 @@  logb_test_downward (void)
   END (logb_downward);
 }
+#endif
 
 static void
@@ -7015,4 +7027,6 @@  nextafter_test (void)
 
 
+/* FIXME: Not implemented in libquadmath.  */
+#if 0
 static void
 nexttoward_test (void)
@@ -7103,4 +7117,5 @@  nexttoward_test (void)
   END (nexttoward);
 }
+#endif
 
 
@@ -8567,4 +8582,6 @@  round_test (void)
 
 
+/* FIXME: Not implemented in libquadmath.  */
+#if 0
 static void
 scalb_test (void)
@@ -8625,4 +8642,5 @@  scalb_test (void)
   END (scalb);
 }
+#endif
 
 
@@ -9700,4 +9718,6 @@  yn_test (void)
 
 
+/* FIXME: Not implemented in libquadmath.  */
+#if 0
 static void
 significand_test (void)
@@ -9712,4 +9732,5 @@  significand_test (void)
   END (significand);
 }
+#endif
 
 
@@ -9858,5 +9879,5 @@  main (int argc, char **argv)
     {
       fprintf (stderr, "wrong number of arguments");
-      argp_help (&argp, stdout, ARGP_HELP_SEE, program_invocation_short_name);
+      argp_help (&argp, stdout, ARGP_HELP_SEE, argv[0]);
       exit (EXIT_FAILURE);
     }
@@ -9942,6 +9963,6 @@  main (int argc, char **argv)
   exp_test_downward ();
   exp_test_upward ();
-  exp10_test ();
-  exp2_test ();
+/*  exp10_test ();
+  exp2_test ();*/
   expm1_test ();
   frexp_test ();
@@ -9951,12 +9972,12 @@  main (int argc, char **argv)
   log1p_test ();
   log2_test ();
-  logb_test ();
-  logb_test_downward ();
+/*  logb_test ();
+  logb_test_downward ();*/
   modf_test ();
   ilogb_test ();
-  scalb_test ();
+/*  scalb_test ();*/
   scalbn_test ();
   scalbln_test ();
-  significand_test ();
+/*  significand_test ();*/
 
   /* Power and absolute value functions:  */
@@ -9974,5 +9995,5 @@  main (int argc, char **argv)
   erf_test ();
   erfc_test ();
-  gamma_test ();
+/*  gamma_test ();*/
   lgamma_test ();
   tgamma_test ();
@@ -10010,5 +10031,5 @@  main (int argc, char **argv)
   copysign_test ();
   nextafter_test ();
-  nexttoward_test ();
+/*  nexttoward_test (); */
 
   /* maximum, minimum and positive difference functions */