unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Paul E. Murphy" <murphyp@linux.vnet.ibm.com>
To: libc-alpha@sourceware.org
Subject: [PATCHv3] ldbl-128ibm-compat: Add tests for IBM long double functions
Date: Tue, 18 Feb 2020 16:00:57 -0600	[thread overview]
Message-ID: <20200218220057.17930-1-murphyp@linux.vnet.ibm.com> (raw)
In-Reply-To: <20200217220609.26623-1-murphyp@linux.vnet.ibm.com>

From: Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>

Simplify this further.  As correctly pointed out by Joseph, compiler
_Float128 compiler flags should always be present where needed.  Thus,
I can greatly simplify this patch.  It had collected too much cruft from
my constant rebasing.

Likewise, defer the ppc64le makefile changes.  They really shouldn't be
here, and contained harmful rebasing noise.  They have been squashed
into later, more appropriate patches.

Similarly, the hack for gamma is removed.  `make regen-ulps` behaves
as expected and fills the missing entries correctly.  The ULP changes
will be included with the enablement patch.

Tested on x86-64 and ppc64le.

---8<---

This patch creates test-ibm128* tests from the long double function tests.
In order to explicitly test IBM long double functions -mabi=ibmlongdouble is
added to CFLAGS.

Likewise, update the test headers to correct choose ULPs when redirects
are enabled.

Co-Authored-By: Tulio Magno Quites Machado Filho  <tuliom@linux.ibm.com>
Co-Authored-By: Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
---
 math/Makefile                                 |  7 ++++++-
 math/test-ibm128.h                            | 19 +++++++++++++++++++
 math/test-ldouble.h                           |  7 +++++++
 sysdeps/ieee754/ldbl-128ibm-compat/Makeconfig |  3 +++
 4 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 math/test-ibm128.h
 create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/Makeconfig

diff --git a/math/Makefile b/math/Makefile
index 1d203e7ad5..84a8b94c74 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -145,10 +145,15 @@ type-float128-yes := float128
 # _Float64x may be supported, only as an alias type.
 type-float64x-yes := float64x
 
+# IBM long double support in additional to IEEE 128 long double support
+type-ibm128-suffix := l
+type-ibm128-yes := ibm128
+
 types = $(types-basic) $(type-float128-$(float128-fcts))
 test-types = $(test-types-basic) $(type-float128-$(float128-fcts)) \
 	     float32 float64 $(type-float128-$(float128-alias-fcts)) \
-	     float32x $(type-float64x-$(float64x-alias-fcts))
+	     float32x $(type-float64x-$(float64x-alias-fcts)) \
+	     $(type-ibm128-$(ibm128-fcts))
 
 # Pairs of types for which narrowing functions should be tested (this
 # variable has more entries than libm-narrow-types because it includes
diff --git a/math/test-ibm128.h b/math/test-ibm128.h
new file mode 100644
index 0000000000..fce6ef1376
--- /dev/null
+++ b/math/test-ibm128.h
@@ -0,0 +1,19 @@
+/* Common definitions for libm tests for ibm long double.
+   Copyright (C) 2020 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "test-ldouble.h"
diff --git a/math/test-ldouble.h b/math/test-ldouble.h
index 17c526bd71..5b72915008 100644
--- a/math/test-ldouble.h
+++ b/math/test-ldouble.h
@@ -27,6 +27,13 @@
 # define TYPE_STR "double"
 # define ULP_IDX ULP_DBL
 # define ULP_I_IDX ULP_I_DBL
+/* On architectures which redirect long double to _Float128 ABI, we must
+   choose the float128 ulps.  Similarly, on such architectures, the ABI
+   used may be dependent on how the compiler was invoked.  */
+#elif __LONG_DOUBLE_USES_FLOAT128 == 1
+# define TYPE_STR "float128"
+# define ULP_IDX ULP_FLT128
+# define ULP_I_IDX ULP_I_FLT128
 #else
 # define TYPE_STR "ldouble"
 # define ULP_IDX ULP_LDBL
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Makeconfig b/sysdeps/ieee754/ldbl-128ibm-compat/Makeconfig
new file mode 100644
index 0000000000..997f632319
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/Makeconfig
@@ -0,0 +1,3 @@
+# Include this earlier so it can be used earlier in Makefiles,
+# and sysdep/ makefiles.
+ibm128-fcts = yes
-- 
2.21.1


  parent reply	other threads:[~2020-02-18 22:01 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14 16:10 [PATCH 0/7] Remaining ldbl-128ibm-compat support Paul E. Murphy
2020-02-14 16:10 ` [PATCH 1/7] ldbl-128ibm-compat: Provide nexttoward functions Paul E. Murphy
2020-02-27 20:16   ` Tulio Magno Quites Machado Filho
2020-02-28 14:56     ` Paul E Murphy
2020-02-14 16:10 ` [PATCH 2/7] ldbl-128ibm-compat: enforce correct abi flags on internal file Paul E. Murphy
2020-02-21 14:35   ` Paul E Murphy
2020-02-14 16:10 ` [PATCH 3/7] ldbl-128ibm-compat: Add tests for IBM long double functions Paul E. Murphy
2020-02-14 17:31   ` Joseph Myers
2020-02-14 18:22     ` Paul E Murphy
2020-02-14 21:13       ` Joseph Myers
2020-02-17 22:06     ` [PATCHv2 " Paul E. Murphy
2020-02-17 22:24       ` Joseph Myers
2020-02-18 22:00       ` Paul E. Murphy [this message]
2020-02-28 15:33         ` [PATCHv3][Ping] " Paul E Murphy
2020-03-03 20:17           ` Paul E Murphy
2020-03-06 19:37             ` Paul E Murphy
2020-02-14 16:10 ` [PATCH 4/7] ldbl-128ibm-compat: fixup subdir location of several funcs Paul E. Murphy
2020-02-21 14:34   ` Paul E Murphy
2020-02-14 16:10 ` [PATCH 5/7] ldbl-128ibm-compat: enforce ibm128 on compat tests Paul E. Murphy
2020-02-27 20:39   ` Tulio Magno Quites Machado Filho
2020-02-27 22:45     ` Paul E Murphy
2020-02-28 14:57       ` Paul E Murphy
2020-02-14 16:10 ` [PATCH 6/7] ldbl-128ibm: Let long double files have specific compiler flags Paul E. Murphy
2020-03-03 20:18   ` Paul E Murphy
2020-03-06 19:38     ` Paul E Murphy
2020-02-14 16:10 ` [PATCH 7/7] RFC: ldbl-128ibm-compat: PLT redirects for using ldbl redirects internally Paul E. Murphy
2020-02-27 20:58   ` Tulio Magno Quites Machado Filho
2020-02-28 17:21   ` Paul E Murphy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200218220057.17930-1-murphyp@linux.vnet.ibm.com \
    --to=murphyp@linux.vnet.ibm.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).