about summary refs log tree commit diff
path: root/math/gen-auto-libm-tests.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2013-12-19 17:21:01 +0000
committerJoseph Myers <joseph@codesourcery.com>2013-12-19 17:21:01 +0000
commit6f6fc48226fa2144379d394b0ac91447a27c1639 (patch)
treebe015217a5315e2a2347028ead4352f4c1183395 /math/gen-auto-libm-tests.c
parent83f5c32d21f7616e1833ca0f8a1555990d9b7a68 (diff)
downloadglibc-6f6fc48226fa2144379d394b0ac91447a27c1639.tar.gz
glibc-6f6fc48226fa2144379d394b0ac91447a27c1639.tar.xz
glibc-6f6fc48226fa2144379d394b0ac91447a27c1639.zip
Move tests of sincos from libm-test.inc to auto-libm-test-in.
This patch moves tests of sincos to auto-libm-test-in, adding the
required support to gen-auto-libm-tests.

Tested x86_64 and x86 and ulps updated accordingly.

(auto-libm-test-out diffs omitted below.)

	* math/auto-libm-test-in: Add tests of sincos.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (sincos_test_data): Use AUTO_TESTS_fFF_11.
	* math/gen-auto-libm-tests.c (func_calc_method): Add value
	mpfr_f_11.
	(func_calc_desc): Add mpfr_f_11 union field.
	(test_functions): Add sincos.
	(calc_generic_results): Handle mpfr_f_11.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
Diffstat (limited to 'math/gen-auto-libm-tests.c')
-rw-r--r--math/gen-auto-libm-tests.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/math/gen-auto-libm-tests.c b/math/gen-auto-libm-tests.c
index 8a02b60bbf..9c8394e967 100644
--- a/math/gen-auto-libm-tests.c
+++ b/math/gen-auto-libm-tests.c
@@ -400,6 +400,9 @@ typedef enum
     /* MPFR function with integer and floating-point arguments and one
        result.  */
     mpfr_if_f,
+    /* MPFR function with a single argument and two floating-point
+       results.  */
+    mpfr_f_11,
   } func_calc_method;
 
 /* Description of how to calculate a function.  */
@@ -414,6 +417,7 @@ typedef struct
     int (*mpfr_ff_f) (mpfr_t, const mpfr_t, const mpfr_t, mpfr_rnd_t);
     int (*mpfr_f_f1) (mpfr_t, int *, const mpfr_t, mpfr_rnd_t);
     int (*mpfr_if_f) (mpfr_t, long, const mpfr_t, mpfr_rnd_t);
+    int (*mpfr_f_11) (mpfr_t, mpfr_t, const mpfr_t, mpfr_rnd_t);
   } func;
 } func_calc_desc;
 
@@ -499,6 +503,8 @@ static test_function test_functions[] =
     FUNC_mpfr_f_f ("log2", mpfr_log2, false),
     FUNC_mpfr_ff_f ("pow", mpfr_pow, false),
     FUNC_mpfr_f_f ("sin", mpfr_sin, false),
+    FUNC ("sincos", ARGS1 (type_fp), RET2 (type_fp, type_fp), false, false,
+	  CALC (mpfr_f_11, mpfr_sin_cos)),
     FUNC_mpfr_f_f ("sinh", mpfr_sinh, false),
     FUNC_mpfr_f_f ("sqrt", mpfr_sqrt, true),
     FUNC_mpfr_f_f ("tan", mpfr_tan, false),
@@ -1359,6 +1365,20 @@ calc_generic_results (generic_value *outputs, generic_value *inputs,
       adjust_real (outputs[0].value.f, inexact);
       break;
 
+    case mpfr_f_11:
+      assert (inputs[0].type == gtype_fp);
+      outputs[0].type = gtype_fp;
+      mpfr_init (outputs[0].value.f);
+      outputs[1].type = gtype_fp;
+      mpfr_init (outputs[1].value.f);
+      int comb_ternary = calc->func.mpfr_f_11 (outputs[0].value.f,
+					       outputs[1].value.f,
+					       inputs[0].value.f,
+					       MPFR_RNDZ);
+      adjust_real (outputs[0].value.f, (comb_ternary & 0x3) != 0);
+      adjust_real (outputs[1].value.f, (comb_ternary & 0xc) != 0);
+      break;
+
     default:
       abort ();
     }