From patchwork Tue Feb 18 22:00:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. Murphy" X-Patchwork-Id: 1240384 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-109898-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha1 header.s=default header.b=tiJOHmMk; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48MZYv4xcRz9sRN for ; Wed, 19 Feb 2020 09:01:22 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; q=dns; s= default; b=Q4IFa/azLxnVVBRNlm1foP2uoWOb4lcfsYrq2svnXlFTfpUE2xU1G wbMVbOBIFTj79VklHJtgi4n4hxhhhnqLmFiIKXKarry9qtOW/H6DhPAzgMhXy+fi h3n9mF+i2smH8nOtOFBkrQg8XLmxNVQEHd/tz3jLmk/j01uaAS68lg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; s=default; bh=VpVx54Y627hYc6nPWKnuJCVv1wQ=; b=tiJOHmMkFpI6HLRXmv5J+bLFAdmO bfpB4fL+NQGUlWnsURwiTQGyN6tGeZvjMI9r5ltjhpW4VxpTTwi6Tre/DNwTLDji y0Khv8xOfv8xuKtpTh+BGJczybvqwLEbipzi9wqrR8vh0IEK2w9Lxo7dkwBUqWpj 5Z6X7AVW7QvLPOY= Received: (qmail 24816 invoked by alias); 18 Feb 2020 22:01:14 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 24694 invoked by uid 89); 18 Feb 2020 22:01:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=harmful X-HELO: mx0a-001b2d01.pphosted.com From: "Paul E. Murphy" 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 Message-Id: <20200218220057.17930-1-murphyp@linux.vnet.ibm.com> In-Reply-To: <20200217220609.26623-1-murphyp@linux.vnet.ibm.com> References: MIME-Version: 1.0 From: Rajalakshmi Srinivasaraghavan 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 Co-Authored-By: Paul E. Murphy --- 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 + . */ + +#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