PATCH [1/5] Vector math functions infrastructure

Message ID CAMXFM3trK8mqQfsKosRo5oku8kVKZvV85f4W3WPjtYpvtTooDQ@mail.gmail.com
State Committed
Headers

Commit Message

Andrew Senkevich April 27, 2015, 1:36 p.m. UTC
  Hi,

this is the beginning of series of patches (in the form suitable for
git am) with addition of common vector math functions infrastructure.

This patch is preparatory change in libm-test.c - splitting of macros
which form name of tested functions for ability to use separate name
for tested functions and for functions used in test suite
infrastructure.
It was discussed and approved, end of discussion is
https://sourceware.org/ml/libc-alpha/2014-11/msg00766.html
Attached copy.

Ok for trunk?

2015-04-27  Andrew Senkevich  <andrew.senkevich@intel.com>

        * math/test-double.c (FUNC_TEST): New macro.
        * math/test-float.c: Likewise.
        * math/test-idouble.c: Likewise.
        * math/test-ifloat.c: Likewise.
        * math/test-ildoubl.c: Likewise.
        * math/test-ldouble.c: Likewise.
        * math/libm-test.inc: Use FUNC_TEST for name of tested functions.

From 60982746531ae5debd88db019ef61cbff3ca3fe2 Mon Sep 17 00:00:00 2001
From: Andrew Senkevich <andrew.senkevich@intel.com>
Date: Mon, 27 Apr 2015 15:34:37 +0300
Subject: [PATCH 1/5]

This is the beginning of series of patches with addition of
vector math functions infrastructure. This patch is preparatory change
in libm-test.c - splitting of macros which form name of tested functions
for ability to use separate name for tested functions and for functions
used in test suite infrastructure.

2015-04-27  Andrew Senkevich  <andrew.senkevich@intel.com>

    * math/test-double.c (FUNC_TEST): New macro.
    * math/test-float.c: Likewise.
    * math/test-idouble.c: Likewise.
    * math/test-ifloat.c: Likewise.
    * math/test-ildoubl.c: Likewise.
    * math/test-ldouble.c: Likewise.
    * math/libm-test.inc: Use FUNC_TEST for name of tested functions.
---
 math/libm-test.inc  | 36 ++++++++++++++++++------------------
 math/test-double.c  |  1 +
 math/test-float.c   |  1 +
 math/test-idouble.c |  1 +
 math/test-ifloat.c  |  1 +
 math/test-ildoubl.c |  1 +
 math/test-ldouble.c |  1 +
 7 files changed, 24 insertions(+), 18 deletions(-)
  

Comments

Joseph Myers April 30, 2015, 3:34 p.m. UTC | #1
On Mon, 27 Apr 2015, Andrew Senkevich wrote:

> Hi,
> 
> this is the beginning of series of patches (in the form suitable for
> git am) with addition of common vector math functions infrastructure.
> 
> This patch is preparatory change in libm-test.c - splitting of macros
> which form name of tested functions for ability to use separate name
> for tested functions and for functions used in test suite
> infrastructure.
> It was discussed and approved, end of discussion is
> https://sourceware.org/ml/libc-alpha/2014-11/msg00766.html
> Attached copy.
> 
> Ok for trunk?

I'm not interested in re-reviewing patches that have already been 
approved.  If (a) the patch is identical to that previously reviewed (the 
previous patch applies cleanly), except for changing 2014 to 2014-2015 in 
the copyright notices of any new files, and (b) it still passes testing, 
then just commit it.  If there are differences (beyond copyright years) to 
the previously approved version, please post a diff between (glibc with 
approved patch applied) and (glibc with new patch applied) (or identify 
the places that needed changes to deal with merge conflicts, etc., if the 
previous patch no longer applies cleanly).

This applies to all the patches in the series.  Only repost if you did not 
previously post a patch version that received approval subject to 
copyright assignment, or where a previous version was approved but you 
want to make other changes to it anyway; otherwise just retest, update 
copyright years in new files and commit.
  

Patch

diff --git a/math/libm-test.inc b/math/libm-test.inc
index 7acd29b..be5ec81 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -1302,8 +1302,8 @@  struct test_fFF_11_data
     if (enable_test (EXCEPTIONS)) \
       { \
  COMMON_TEST_SETUP (ARG_STR); \
- check_float (test_name, FUNC (FUNC_NAME) (ARG), EXPECTED, \
-     EXCEPTIONS); \
+ check_float (test_name, FUNC_TEST (FUNC_NAME) (ARG), \
+     EXPECTED, EXCEPTIONS); \
  COMMON_TEST_CLEANUP; \
       } \
   while (0)
@@ -1320,7 +1320,7 @@  struct test_fFF_11_data
     if (enable_test (EXCEPTIONS)) \
       { \
  COMMON_TEST_SETUP (ARG_STR); \
- check_float (test_name, FUNC (FUNC_NAME) (ARG1, ARG2), \
+ check_float (test_name, FUNC_TEST (FUNC_NAME) (ARG1, ARG2), \
      EXPECTED, EXCEPTIONS); \
  COMMON_TEST_CLEANUP; \
       } \
@@ -1347,7 +1347,7 @@  struct test_fFF_11_data
     if (enable_test (EXCEPTIONS)) \
       { \
  COMMON_TEST_SETUP (ARG_STR); \
- check_float (test_name, FUNC (FUNC_NAME) (ARG1, ARG2, ARG3), \
+ check_float (test_name, FUNC_TEST (FUNC_NAME) (ARG1, ARG2, ARG3), \
      EXPECTED, EXCEPTIONS); \
  COMMON_TEST_CLEANUP; \
       } \
@@ -1367,7 +1367,7 @@  struct test_fFF_11_data
       { \
  COMMON_TEST_SETUP (ARG_STR); \
  check_float (test_name, \
-     FUNC (FUNC_NAME) (BUILD_COMPLEX (ARG1, ARG2)), \
+     FUNC_TEST (FUNC_NAME) (BUILD_COMPLEX (ARG1, ARG2)),\
      EXPECTED, EXCEPTIONS); \
  COMMON_TEST_CLEANUP; \
       } \
@@ -1388,7 +1388,7 @@  struct test_fFF_11_data
       { \
  COMMON_TEST_SETUP (ARG_STR); \
  (EXTRA_VAR) = (EXTRA_EXPECTED) == 0 ? 1 : 0; \
- check_float (test_name, FUNC (FUNC_NAME) (ARG), EXPECTED, \
+ check_float (test_name, FUNC_TEST (FUNC_NAME) (ARG), EXPECTED, \
      EXCEPTIONS); \
  EXTRA_OUTPUT_TEST_SETUP (ARG_STR, 1); \
  if (EXTRA_TEST) \
@@ -1415,7 +1415,7 @@  struct test_fFF_11_data
       { \
  COMMON_TEST_SETUP (ARG_STR); \
  (EXTRA_VAR) = (EXTRA_EXPECTED) == 0 ? 1 : 0; \
- check_float (test_name, FUNC (FUNC_NAME) (ARG, &(EXTRA_VAR)), \
+ check_float (test_name, FUNC_TEST (FUNC_NAME) (ARG, &(EXTRA_VAR)), \
      EXPECTED, EXCEPTIONS); \
  EXTRA_OUTPUT_TEST_SETUP (ARG_STR, 1); \
  if (EXTRA_TEST) \
@@ -1442,7 +1442,7 @@  struct test_fFF_11_data
       { \
  COMMON_TEST_SETUP (ARG_STR); \
  (EXTRA_VAR) = (EXTRA_EXPECTED) == 0 ? 1 : 0; \
- check_float (test_name, FUNC (FUNC_NAME) (ARG, &(EXTRA_VAR)), \
+ check_float (test_name, FUNC_TEST (FUNC_NAME) (ARG, &(EXTRA_VAR)), \
      EXPECTED, EXCEPTIONS); \
  EXTRA_OUTPUT_TEST_SETUP (ARG_STR, 1); \
  if (EXTRA_TEST) \
@@ -1470,7 +1470,7 @@  struct test_fFF_11_data
  COMMON_TEST_SETUP (ARG_STR); \
  (EXTRA_VAR) = (EXTRA_EXPECTED) == 0 ? 1 : 0; \
  check_float (test_name, \
-     FUNC (FUNC_NAME) (ARG1, ARG2, &(EXTRA_VAR)), \
+     FUNC_TEST (FUNC_NAME) (ARG1, ARG2, &(EXTRA_VAR)), \
      EXPECTED, EXCEPTIONS); \
  EXTRA_OUTPUT_TEST_SETUP (ARG_STR, 1); \
  if (EXTRA_TEST) \
@@ -1498,7 +1498,7 @@  struct test_fFF_11_data
       { \
  COMMON_TEST_SETUP (ARG_STR); \
  check_complex (test_name, \
-       FUNC (FUNC_NAME) (BUILD_COMPLEX (ARGR, ARGC)), \
+       FUNC_TEST (FUNC_NAME) (BUILD_COMPLEX (ARGR, ARGC)), \
        BUILD_COMPLEX (EXPR, EXPC), EXCEPTIONS); \
  COMMON_TEST_CLEANUP; \
       } \
@@ -1519,8 +1519,8 @@  struct test_fFF_11_data
       { \
  COMMON_TEST_SETUP (ARG_STR); \
  check_complex (test_name, \
-       FUNC (FUNC_NAME) (BUILD_COMPLEX (ARG1R, ARG1C), \
- BUILD_COMPLEX (ARG2R, ARG2C)), \
+       FUNC_TEST (FUNC_NAME) (BUILD_COMPLEX (ARG1R, ARG1C), \
+      BUILD_COMPLEX (ARG2R, ARG2C)), \
        BUILD_COMPLEX (EXPR, EXPC), EXCEPTIONS); \
  COMMON_TEST_CLEANUP; \
       } \
@@ -1540,7 +1540,7 @@  struct test_fFF_11_data
     if (enable_test (EXCEPTIONS)) \
       { \
  COMMON_TEST_SETUP (ARG_STR); \
- check_int (test_name, FUNC (FUNC_NAME) (ARG), EXPECTED, \
+ check_int (test_name, FUNC_TEST (FUNC_NAME) (ARG), EXPECTED, \
    EXCEPTIONS); \
  COMMON_TEST_CLEANUP; \
       } \
@@ -1593,7 +1593,7 @@  struct test_fFF_11_data
     if (enable_test (EXCEPTIONS)) \
       { \
  COMMON_TEST_SETUP (ARG_STR); \
- check_bool (test_name, FUNC (FUNC_NAME) (ARG), EXPECTED, \
+ check_bool (test_name, FUNC_TEST (FUNC_NAME) (ARG), EXPECTED, \
     EXCEPTIONS); \
  COMMON_TEST_CLEANUP; \
       } \
@@ -1627,7 +1627,7 @@  struct test_fFF_11_data
     if (enable_test (EXCEPTIONS)) \
       { \
  COMMON_TEST_SETUP (ARG_STR); \
- check_long (test_name, FUNC (FUNC_NAME) (ARG), EXPECTED, \
+ check_long (test_name, FUNC_TEST (FUNC_NAME) (ARG), EXPECTED, \
     EXCEPTIONS); \
  COMMON_TEST_CLEANUP; \
       } \
@@ -1644,8 +1644,8 @@  struct test_fFF_11_data
     if (enable_test (EXCEPTIONS)) \
       { \
  COMMON_TEST_SETUP (ARG_STR); \
- check_longlong (test_name, FUNC (FUNC_NAME) (ARG), EXPECTED, \
- EXCEPTIONS); \
+ check_longlong (test_name, FUNC_TEST (FUNC_NAME) (ARG), \
+ EXPECTED, EXCEPTIONS); \
  COMMON_TEST_CLEANUP; \
       } \
   while (0)
@@ -1664,7 +1664,7 @@  struct test_fFF_11_data
     if (enable_test (EXCEPTIONS)) \
       { \
  COMMON_TEST_SETUP (ARG_STR); \
- FUNC (FUNC_NAME) (ARG, &(EXTRA1_VAR), &(EXTRA2_VAR)); \
+ FUNC_TEST (FUNC_NAME) (ARG, &(EXTRA1_VAR), &(EXTRA2_VAR)); \
  EXTRA_OUTPUT_TEST_SETUP (ARG_STR, 1); \
  if (EXTRA1_TEST) \
   check_float (extra1_name, EXTRA1_VAR, EXTRA1_EXPECTED, \
diff --git a/math/test-double.c b/math/test-double.c
index c8203a3..cbb81f9 100644
--- a/math/test-double.c
+++ b/math/test-double.c
@@ -17,6 +17,7 @@ 
    <http://www.gnu.org/licenses/>.  */

 #define FUNC(function) function
+#define FUNC_TEST(function) FUNC (function)
 #define FLOAT double
 #define TEST_MSG "testing double (without inline functions)\n"
 #define MATHCONST(x) x
diff --git a/math/test-float.c b/math/test-float.c
index 3f04e15..c54dd3c 100644
--- a/math/test-float.c
+++ b/math/test-float.c
@@ -17,6 +17,7 @@ 
    <http://www.gnu.org/licenses/>.  */

 #define FUNC(function) function ## f
+#define FUNC_TEST(function) FUNC (function)
 #define FLOAT float
 #define TEST_MSG "testing float (without inline functions)\n"
 #define MATHCONST(x) x
diff --git a/math/test-idouble.c b/math/test-idouble.c
index 1c11017..b23bd21 100644
--- a/math/test-idouble.c
+++ b/math/test-idouble.c
@@ -17,6 +17,7 @@ 
    <http://www.gnu.org/licenses/>.  */

 #define FUNC(function) function
+#define FUNC_TEST(function) FUNC (function)
 #define FLOAT double
 #define TEST_MSG "testing double (inline functions)\n"
 #define MATHCONST(x) x
diff --git a/math/test-ifloat.c b/math/test-ifloat.c
index e64f9ca..57a7a77 100644
--- a/math/test-ifloat.c
+++ b/math/test-ifloat.c
@@ -17,6 +17,7 @@ 
    <http://www.gnu.org/licenses/>.  */

 #define FUNC(function) function ## f
+#define FUNC_TEST(function) FUNC (function)
 #define FLOAT float
 #define TEST_MSG "testing float (inline functions)\n"
 #define MATHCONST(x) x
diff --git a/math/test-ildoubl.c b/math/test-ildoubl.c
index 2b98544..c38a109 100644
--- a/math/test-ildoubl.c
+++ b/math/test-ildoubl.c
@@ -17,6 +17,7 @@ 
    <http://www.gnu.org/licenses/>.  */

 #define FUNC(function) function##l
+#define FUNC_TEST(function) FUNC (function)
 #define FLOAT long double
 #define TEST_MSG "testing long double (inline functions)\n"
 #define MATHCONST(x) x##L
diff --git a/math/test-ldouble.c b/math/test-ldouble.c
index 94a71a2..20bf0a1 100644
--- a/math/test-ldouble.c
+++ b/math/test-ldouble.c
@@ -17,6 +17,7 @@ 
    <http://www.gnu.org/licenses/>.  */

 #define FUNC(function) function##l
+#define FUNC_TEST(function) FUNC (function)
 #define FLOAT long double
 #define TEST_MSG "testing long double (without inline functions)\n"
 #define MATHCONST(x) x##L