[x86_64,BZ,#20033] Use calls to finite scalar versions in vector log, pow, exp.

Message ID CAMXFM3sanmjayVBpZwjQXqWmQ1=i1=r61R-c0fHbYvQUGz9cYQ@mail.gmail.com
State New, archived
Headers

Commit Message

Andrew Senkevich July 27, 2016, 7:56 p.m. UTC
  2016-07-25 23:19 GMT+03:00 Joseph Myers <joseph@codesourcery.com>:
> On Mon, 25 Jul 2016, Andrew Senkevich wrote:
>
>> > No, such architecture conditionals on individual tests are not
>> > appropriate.  Maybe you need a NO_TEST_VECTOR handled like NO_TEST_INLINE
>> > in enable_test.
>>
>> Is patch below Ok for trunk?
>
> No, I said handled like NO_TEST_INLINE.  Exactly like NO_TEST_INLINE.  No
> architecture conditionals, no #if, just an "if" conditional exactly
> corresponding to how NO_TEST_INLINE and NON_FINITE are handled (the
> NON_FINITE if is actually better to follow since it follows the glibc
> convention of avoiding implicit boolean conversion).

Do you mean the following change for math/libm-test.inc?

     TEST_ff_f (pow, 1.1L, plus_infty, plus_infty,
ERRNO_UNCHANGED|NO_TEST_INLINE),
     TEST_ff_f (pow, plus_infty, plus_infty, plus_infty,
ERRNO_UNCHANGED|NO_TEST_INLINE),


--
WBR,
Andrew
  

Comments

Joseph Myers July 27, 2016, 9:34 p.m. UTC | #1
On Wed, 27 Jul 2016, Andrew Senkevich wrote:

> > No, I said handled like NO_TEST_INLINE.  Exactly like NO_TEST_INLINE.  No
> > architecture conditionals, no #if, just an "if" conditional exactly
> > corresponding to how NO_TEST_INLINE and NON_FINITE are handled (the
> > NON_FINITE if is actually better to follow since it follows the glibc
> > convention of avoiding implicit boolean conversion).
> 
> Do you mean the following change for math/libm-test.inc?

Yes (not until after 2.24, of course).
  

Patch

diff --git a/math/libm-test.inc b/math/libm-test.inc
index 4ac7a0c..117057c 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -179,6 +179,7 @@ 
 #define IGNORE_RESULT                  0x20000
 #define NON_FINITE                     0x40000
 #define TEST_SNAN                      0x80000
+#define NO_TEST_MATHVEC                        0x100000

 #define __CONCATX(a,b) __CONCAT(a,b)

@@ -1056,6 +1057,9 @@  enable_test (int exceptions)
     return 0;
   if (!SNAN_TESTS (FLOAT) && (exceptions & TEST_SNAN) != 0)
     return 0;
+  if (TEST_MATHVEC && (exceptions & NO_TEST_MATHVEC) != 0)
+    return 0;
+
   return 1;
 }

@@ -10631,10 +10635,10 @@  nexttoward_test (void)

 static const struct test_ff_f_data pow_test_data[] =
   {
-    TEST_ff_f (pow, qnan_value, 0, 1, ERRNO_UNCHANGED),
-    TEST_ff_f (pow, -qnan_value, 0, 1, ERRNO_UNCHANGED),
-    TEST_ff_f (pow, qnan_value, minus_zero, 1, ERRNO_UNCHANGED),
-    TEST_ff_f (pow, -qnan_value, minus_zero, 1, ERRNO_UNCHANGED),
+    TEST_ff_f (pow, qnan_value, 0, 1, ERRNO_UNCHANGED|NO_TEST_MATHVEC),
+    TEST_ff_f (pow, -qnan_value, 0, 1, ERRNO_UNCHANGED|NO_TEST_MATHVEC),
+    TEST_ff_f (pow, qnan_value, minus_zero, 1,
ERRNO_UNCHANGED|NO_TEST_MATHVEC),
+    TEST_ff_f (pow, -qnan_value, minus_zero, 1,
ERRNO_UNCHANGED|NO_TEST_MATHVEC),