From patchwork Fri Mar 27 21:17:55 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: 38643 X-Patchwork-Delegate: tuliom@linux.vnet.ibm.com Return-Path: X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 26349389907B for ; Fri, 27 Mar 2020 21:18:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 26349389907B Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02RL4Br4097282 for ; Fri, 27 Mar 2020 17:18:23 -0400 Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ywdra2aek-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 27 Mar 2020 17:18:23 -0400 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 02RLFDiL001456 for ; Fri, 27 Mar 2020 21:18:22 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma03wdc.us.ibm.com with ESMTP id 2ywawan80n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 27 Mar 2020 21:18:22 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02RLI7rD13435420 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 27 Mar 2020 21:18:08 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 209E613605E for ; Fri, 27 Mar 2020 21:18:07 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4C7F6136055 for ; Fri, 27 Mar 2020 21:18:06 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.85.139.44]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP for ; Fri, 27 Mar 2020 21:18:06 +0000 (GMT) From: "Paul E. Murphy" To: libc-alpha@sourceware.org Subject: [PATCH v2 04/10] powerpc64le: Enforce -mabi=ibmlongdouble when -mfloat128 used Date: Fri, 27 Mar 2020 16:17:55 -0500 Message-Id: <20200327211801.31234-5-murphyp@linux.vnet.ibm.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200327211801.31234-1-murphyp@linux.vnet.ibm.com> References: <20200327211801.31234-1-murphyp@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-27_08:2020-03-27, 2020-03-27 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 adultscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 clxscore=1015 suspectscore=1 mlxlogscore=999 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003270169 X-Spam-Status: No, score=-25.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Mar 2020 21:18:25 -0000 I have observed a bug on 7.4.0 whereby __mulkc3 calls are swapped with __multc3 depending on ABI selection. For the sake of being overly cautious, build all _Float128 files with ibm128 to workaround these compilers. This has been noted in GCC BZ 84914, and will not be fixed for GCC 7. Likewise, non-math files built with _Float128 are assumed to have ibm long double. Explicilty preserve this assumption. Finally, add some bootstrapping code to avoid applying these options until IEEE long double is enabled as they require GCC 7 and above. Reviewed-by: Tulio Magno Quites Machado Filho --- sysdeps/powerpc/powerpc64/le/Makefile | 88 +++++++++++-------- .../powerpc64/le/fpu/multiarch/Makefile | 4 +- 2 files changed, 51 insertions(+), 41 deletions(-) diff --git a/sysdeps/powerpc/powerpc64/le/Makefile b/sysdeps/powerpc/powerpc64/le/Makefile index d79ad222fc..441a8a14e5 100644 --- a/sysdeps/powerpc/powerpc64/le/Makefile +++ b/sysdeps/powerpc/powerpc64/le/Makefile @@ -1,5 +1,6 @@ # When building float128 we need to ensure -mfloat128 is # passed to all such object files. +type-float128-CFLAGS := -mfloat128 # Bootstrapping code for enabling IEEE 128. This can be removed and # any indirections simplified once IEEE 128 long double is enabled. @@ -11,28 +12,33 @@ type-ldouble-CFLAGS += $(ibm128-abi-CFLAGS) no-gnu-attribute-CFLAGS = -mno-gnu-attribute endif +# All _Float128 files should be built assuming an ibm128 long double. +# Likewise, this avoids some old GCC 7 compiler bugs whereby calls +# to __mulkc3 are swapped with __multc3, or worse. This is noted in +# GCC BZ 84914, and marked as will-not-fix. +type-float128-CFLAGS += $(type-ldouble-CFLAGS) + ifeq ($(subdir),math) # sqrtf128 requires emulation before POWER9. CPPFLAGS += -I../soft-fp # float128 requires adding a handful of extra flags. # Similarly, disable -$(foreach suf,$(all-object-suffixes),%f128$(suf)): CFLAGS += -mfloat128 $(no-gnu-attribute-CFLAGS) -$(foreach suf,$(all-object-suffixes),%f128_r$(suf)): CFLAGS += -mfloat128 $(no-gnu-attribute-CFLAGS) -$(foreach suf,$(all-object-suffixes),$(objpfx)test-float128%$(suf)): CFLAGS += -mfloat128 -$(foreach suf,$(all-object-suffixes),$(objpfx)test-float64x%$(suf)): CFLAGS += -mfloat128 +$(foreach suf,$(all-object-suffixes),%f128$(suf)): CFLAGS += $(type-float128-CFLAGS) $(no-gnu-attribute-CFLAGS) +$(foreach suf,$(all-object-suffixes),%f128_r$(suf)): CFLAGS += $(type-float128-CFLAGS) $(no-gnu-attribute-CFLAGS) +$(foreach suf,$(all-object-suffixes),$(objpfx)test-float128%$(suf)): CFLAGS += $(type-float128-CFLAGS) +$(foreach suf,$(all-object-suffixes),$(objpfx)test-float64x%$(suf)): CFLAGS += $(type-float128-CFLAGS) # Pairs of types with _Float128 / _Float64x as the wider type but not # the narrower one. f128-pairs = float32-float64x float32-float128 float64-float64x \ float64-float128 float32x-float64x float32x-float128 -$(foreach suf,$(all-object-suffixes),$(foreach pair,$(f128-pairs),$(objpfx)test-$(pair)%$(suf))): CFLAGS += -mfloat128 - -CFLAGS-libm-test-support-float128.c += -mfloat128 -CFLAGS-libm-test-support-float64x.c += -mfloat128 -CFLAGS-test-math-iscanonical.cc += -mfloat128 -CFLAGS-test-math-iseqsig.cc += -mfloat128 -CFLAGS-test-math-issignaling.cc += -mfloat128 -CFLAGS-test-math-iszero.cc += -mfloat128 +$(foreach suf,$(all-object-suffixes),$(foreach pair,$(f128-pairs),$(objpfx)test-$(pair)%$(suf))): CFLAGS += $(type-float128-CFLAGS) +CFLAGS-libm-test-support-float128.c += $(type-float128-CFLAGS) +CFLAGS-libm-test-support-float64x.c += $(type-float128-CFLAGS) +CFLAGS-test-math-iscanonical.cc += $(type-float128-CFLAGS) +CFLAGS-test-math-iseqsig.cc += $(type-float128-CFLAGS) +CFLAGS-test-math-issignaling.cc += $(type-float128-CFLAGS) +CFLAGS-test-math-iszero.cc += $(type-float128-CFLAGS) CFLAGS-s_logbl-power7.c += $(type-ldouble-CFLAGS) CFLAGS-s_logbl-ppc64.c += $(type-ldouble-CFLAGS) @@ -71,45 +77,49 @@ $(foreach suf,$(all-object-suffixes),\ ): sysdep-CFLAGS := $(filter-out -mabi=ieeelongdouble,$(sysdep-CFLAGS)) endif + # Append flags to string <-> _Float128 routines. ifneq ($(filter $(subdir),wcsmbs stdlib),) -$(foreach suf,$(all-object-suffixes),%f128$(suf)): CFLAGS += -mfloat128 $(no-gnu-attribute-CFLAGS) -$(foreach suf,$(all-object-suffixes),%f128_l$(suf)): CFLAGS += -mfloat128 $(no-gnu-attribute-CFLAGS) -$(foreach suf,$(all-object-suffixes),%f128_nan$(suf)): CFLAGS += -mfloat128 $(no-gnu-attribute-CFLAGS) -$(foreach suf,$(all-object-suffixes),%float1282mpn$(suf)): CFLAGS += -mfloat128 $(no-gnu-attribute-CFLAGS) -$(foreach suf,$(all-object-suffixes),%mpn2float128$(suf)): CFLAGS += -mfloat128 $(no-gnu-attribute-CFLAGS) -CFLAGS-bug-strtod.c += -mfloat128 -CFLAGS-bug-strtod2.c += -mfloat128 -CFLAGS-tst-strtod-round.c += -mfloat128 -CFLAGS-tst-wcstod-round.c += -mfloat128 -CFLAGS-tst-strtod-nan-locale.c += -mfloat128 -CFLAGS-tst-wcstod-nan-locale.c += -mfloat128 -CFLAGS-tst-strtod6.c += -mfloat128 -CFLAGS-tst-strfrom.c += -mfloat128 -CFLAGS-tst-strfrom-locale.c += -mfloat128 -CFLAGS-strfrom-skeleton.c += -mfloat128 -CFLAGS-tst-strtod-nan-sign.c += -mfloat128 -CFLAGS-tst-wcstod-nan-sign.c += -mfloat128 +$(foreach suf,$(all-object-suffixes),%f128$(suf)): CFLAGS += $(type-float128-CFLAGS) $(no-gnu-attribute-CFLAGS) +$(foreach suf,$(all-object-suffixes),%f128_l$(suf)): CFLAGS += $(type-float128-CFLAGS) $(no-gnu-attribute-CFLAGS) +$(foreach suf,$(all-object-suffixes),%f128_nan$(suf)): CFLAGS += $(type-float128-CFLAGS) $(no-gnu-attribute-CFLAGS) +$(foreach suf,$(all-object-suffixes),%float1282mpn$(suf)): CFLAGS += $(type-float128-CFLAGS) $(no-gnu-attribute-CFLAGS) +$(foreach suf,$(all-object-suffixes),%mpn2float128$(suf)): CFLAGS += $(type-float128-CFLAGS) $(no-gnu-attribute-CFLAGS) +CFLAGS-bug-strtod.c += $(type-float128-CFLAGS) +CFLAGS-bug-strtod2.c += $(type-float128-CFLAGS) +CFLAGS-tst-strtod-round.c += $(type-float128-CFLAGS) +CFLAGS-tst-wcstod-round.c += $(type-float128-CFLAGS) +CFLAGS-tst-strtod-nan-locale.c += $(type-float128-CFLAGS) +CFLAGS-tst-wcstod-nan-locale.c += $(type-float128-CFLAGS) +CFLAGS-tst-strtod6.c += $(type-float128-CFLAGS) +CFLAGS-tst-strfrom.c += $(type-float128-CFLAGS) +CFLAGS-tst-strfrom-locale.c += $(type-float128-CFLAGS) +CFLAGS-strfrom-skeleton.c += $(type-float128-CFLAGS) +CFLAGS-tst-strtod-nan-sign.c += $(type-float128-CFLAGS) +CFLAGS-tst-wcstod-nan-sign.c += $(type-float128-CFLAGS) # When building glibc with support for _Float128, the powers of ten tables in # fpioconst.c and in the string conversion functions must be extended. Some # Makefiles (e.g.: wcsmbs/Makefile) override CFLAGS defined by the Makefiles in # sysdeps. This is avoided with the use sysdep-CFLAGS instead of CFLAGS. sysdep-CFLAGS += $(sysdep-CFLAGS-$(