From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1005) id 7F5193858D20; Fri, 20 Jan 2023 20:34:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7F5193858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674246854; bh=UCVFRVm//NnQovr9hcNIA54RgPVQMv09qBPVW1K8/eI=; h=From:To:Subject:Date:From; b=Q9Y7KeDbyLTgZe9HdeEXJBzHv6cQcYbTz+DtLE5R+SVo1McQL59bYTeJ0peXfZGKa pZ9+hq3TML2wQDw03vEeyMiI0aSmDhlLkSY/5dNIgy6CBOgCnQbOp2YEnuaJCbmNV+ pujLSaeD+9BP9JpzS1O6Zc/hKSLkM0PKkf8LkrB4= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Michael Meissner To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/meissner/heads/work107)] Update ChangeLog.meissner X-Act-Checkin: gcc X-Git-Author: Michael Meissner X-Git-Refname: refs/users/meissner/heads/work107 X-Git-Oldrev: e28ec590bdd0f7745856ad78a90adb6aa7737a75 X-Git-Newrev: 16d92e2fddc2e80ba6634df75b11e68204cfd73e Message-Id: <20230120203414.7F5193858D20@sourceware.org> Date: Fri, 20 Jan 2023 20:34:14 +0000 (GMT) List-Id: https://gcc.gnu.org/g:16d92e2fddc2e80ba6634df75b11e68204cfd73e commit 16d92e2fddc2e80ba6634df75b11e68204cfd73e Author: Michael Meissner Date: Fri Jan 20 15:34:11 2023 -0500 Update ChangeLog.meissner Diff: --- gcc/ChangeLog.meissner | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/gcc/ChangeLog.meissner b/gcc/ChangeLog.meissner index fda09a48c25..188ac07d434 100644 --- a/gcc/ChangeLog.meissner +++ b/gcc/ChangeLog.meissner @@ -1,3 +1,72 @@ +==================== work107, patch #1 ==================== + +PR target/107299: Fix build issue when long double is IEEE 128-bit + +This patch updates the IEEE 128-bit types used in libgcc. + +At the moment, we cannot build GCC when the target uses IEEE 128-bit long +doubles, such as building the compiler for a native Fedora 36 system. The +build dies when it is trying to build the _mulkc3.c and _divkc3 modules. + +This patch changes libgcc to use long double for the IEEE 128-bit base type if +long double is IEEE 128-bit, and it uses _Float128 otherwise. The built-in +functions are adjusted to be the correct version based on the IEEE 128-bit base +type used. + +While it is desirable to ultimately have __float128 and _Float128 use the same +internal type and mode within GCC, at present if you use the option +-mabi=ieeelongdouble, the __float128 type will use the long double type and not +the _Float128 type. We get an internal compiler error if we combine the +signbitf128 built-in with a long double type. + +I've gone through several iterations of trying to fix this within GCC, and +there are various problems that have come up. I developed this alternative +patch that changes libgcc so that it does not tickle the issue. I hope we can +fix the compiler at some point, but right now, this is preventing people on +Fedora 36 systems from building compilers where the default long double is IEEE +128-bit. + +I have built a GCC compiler tool chain on the following platforms and there +were no regressions caused by these patches. + + * Power10 little endian, IBM long double, --with-cpu=power10 + + * Power9 little endian, IBM long double, --with-cpu=power9 + + * Power8 big endian, IBM long double, --with-cpu=power8, both + 32-bit/64-bit tests. + +In addition, I have built a GCC compiler tool chain on the following systems +with IEEE 128-bit long double as the default. Comparing the test suite runs to +the runs for the toolchain with IBM long double as the default, I only get the +expected differences (C++ modules test fail on IEEE long double, 3 Fortran +tests pass on IEEE long double that fail on IBM long double, C test pr105334.c +fails, and C test fp128_conversions.c fails on power10): + + * Power10 little endian, IEEE long double, --with-cpu=power10 + + * Power9 little endian, IEEE long double, --with-cpu=power9 + +Can I check this change into the master branch? + +2023-01-20 Michael Meissner + + PR target/107299 + * config/rs6000/_divkc3.c (COPYSIGN): Use the correct built-in based on + whether long double is IBM or IEEE. + (INFINITY): Likewise. + (FABS): Likewise. + * config/rs6000/_mulkc3.c (COPYSIGN): Likewise. + (INFINITY): Likewise. + * config/rs6000/quad-float128.h (TF): Remove definition. + (TFtype): Define to be long double or _Float128. + (TCtype): Define to be _Complex long double or _Complex _Float128. + * libgcc2.h (TFtype): Allow machine config files to override this. + (TCtype): Likewise. + * soft-fp/quad.h (TFtype): Likewise. + +==================== work107, branch head ==================== + 2023-01-20 Michael Meissner Clone branch