This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Convert TEST_f_f tests from code to data
- From: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Mon, 13 May 2013 09:08:12 -0300
- Subject: Re: Convert TEST_f_f tests from code to data
- References: <Pine dot LNX dot 4 dot 64 dot 1305102059161 dot 3435 at digraph dot polyomino dot org dot uk> <518DD395 dot 6040600 at suse dot com> <518FDFC7 dot 7030008 at linux dot vnet dot ibm dot com> <Pine dot LNX dot 4 dot 64 dot 1305121840570 dot 19219 at digraph dot polyomino dot org dot uk>
On 05/12/2013 03:42 PM, Joseph S. Myers wrote:
> On Sun, 12 May 2013, Adhemerval Zanella wrote:
>
>> I didn't dig into, but it shows on GCC 4.4.6, 4.7.4, and trunk (4.9). To
>> avoid more compiler ifdefs, I suggest just replace it to a constant.
>> Tested on PowerPC and PowerPC64.
> I suggest defining a macro with this constant value along with the other
> M_* macros defined in libc-test.inc (whose definitions I made into decimal
> constants to avoid this sort of issue with GCC bug 26374:
> <http://sourceware.org/ml/libc-alpha/2013-05/msg00221.html>), rather than
> using the long constant directly as a test input.
>
I updated the patch with a macro, ok to apply?
--
2013-05-13 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
* math/libm-test.inc (M_1_DIV_El): Define using decimal constant.
(log_test_data): Use M_1_DIV_El instead of 1.0 / M_El.
---
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 1f7c2e1..038caeb 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -212,6 +212,7 @@
#define M_PI2_LOG10El 0.682188176920920673742891812715677885L
#define M_PI4_LOG10El 0.341094088460460336871445906357838943L
#define M_PI_LOG10El 1.364376353841841347485783625431355770L
+#define M_1_DIV_El 0.367879441171442321595523770161460867L /* 1 div e */
#define ulps_file_name "ULPs" /* Name of the ULPs file. */
static FILE *ulps_file; /* File to document difference. */
@@ -10932,7 +10933,7 @@ static const struct test_f_f_data log_test_data[] =
TEST_f_f (log, qnan_value, qnan_value),
TEST_f_f (log, M_El, 1),
- TEST_f_f (log, 1.0 / M_El, -1),
+ TEST_f_f (log, M_1_DIV_El, -1),
TEST_f_f (log, 2, M_LN2l),
TEST_f_f (log, 10, M_LN10l),
TEST_f_f (log, 0.75L, -0.287682072451780927439219005993827432L),