From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1005) id D40CD3858D35; Wed, 18 Jan 2023 00:09:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D40CD3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674000595; bh=oYkB5qcmMeNpL2iTzIDs3vtKQBr08C+Qk4FADXfkPao=; h=From:To:Subject:Date:From; b=PC8mmaCisHEOwHAssPXTwVVZqqZjBahFqGJOSqtyQZ1qYUIx4Y4zawzME58e81IqH NRvkZv0yozP4p3padTN9EkXK5Sxt49KyxgQRf4d8Jxz8HpUApeGcUnAYTSiMENlmTp JXm1M7ASN4/Ec4hHWnqm4wXHxlR2S5Rw1BzFCq3g= 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/work106)] Use _Float128 and _Complex _Float128 for PowerPC libgcc IEEE 128-bit X-Act-Checkin: gcc X-Git-Author: Michael Meissner X-Git-Refname: refs/users/meissner/heads/work106 X-Git-Oldrev: 37ec4d01e48d4350c365a2edde01dc5a316b6bb5 X-Git-Newrev: 22dd6dfc52ef1ab02426be4aa436511f53941be0 Message-Id: <20230118000955.D40CD3858D35@sourceware.org> Date: Wed, 18 Jan 2023 00:09:55 +0000 (GMT) List-Id: https://gcc.gnu.org/g:22dd6dfc52ef1ab02426be4aa436511f53941be0 commit 22dd6dfc52ef1ab02426be4aa436511f53941be0 Author: Michael Meissner Date: Tue Jan 17 19:09:34 2023 -0500 Use _Float128 and _Complex _Float128 for PowerPC libgcc IEEE 128-bit 2023-01-17 Michael Meissner PR target/107299 * config/rs6000/quad-float128.h (TF): Remove definition. (TFtype): New macro, use _Float128. (TCtype): Change to macro, use _Complex _Float128. (__mulkc3): Remove declaration. (__divkc3): Likewise. * libgcc2.h (TFtype): Allow md files to override this. (TCtype): Likewise. * soft-fp/quad.h (TFtype): Likewise. Diff: --- libgcc/config/rs6000/quad-float128.h | 23 +++-------------------- libgcc/libgcc2.h | 4 ++++ libgcc/soft-fp/quad.h | 2 ++ 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/libgcc/config/rs6000/quad-float128.h b/libgcc/config/rs6000/quad-float128.h index ae0622c744c..c3f9f48bf97 100644 --- a/libgcc/config/rs6000/quad-float128.h +++ b/libgcc/config/rs6000/quad-float128.h @@ -27,22 +27,9 @@ License along with the GNU C Library; if not, see . */ -/* quad.h defines the TFtype type by: - typedef float TFtype __attribute__ ((mode (TF))); - - This define forces it to use KFmode (aka, ieee 128-bit floating point). - However, when the compiler's default is changed so that long double is IEEE - 128-bit floating point, we need to go back to using TFmode and TCmode. */ -#ifndef __LONG_DOUBLE_IEEE128__ -#define TF KF - -/* We also need TCtype to represent complex ieee 128-bit float for - __mulkc3 and __divkc3. */ -typedef __complex float TCtype __attribute__ ((mode (KC))); - -#else -typedef __complex float TCtype __attribute__ ((mode (TC))); -#endif +/* Override quad.h's definitions for 128-bit floating point type. */ +#define TFtype _Float128 +#define TCtype _Complex _Float128 /* Force the use of the VSX instruction set. */ #if defined(_ARCH_PPC) && (!defined(__VSX__) || !defined(__FLOAT128__)) @@ -187,10 +174,6 @@ extern UTItype_ppc __fixunskfti (TFtype); extern IBM128_TYPE __extendkftf2 (TFtype); extern TFtype __trunctfkf2 (IBM128_TYPE); -/* Complex __float128 built on __float128 interfaces. */ -extern TCtype __mulkc3 (TFtype, TFtype, TFtype, TFtype); -extern TCtype __divkc3 (TFtype, TFtype, TFtype, TFtype); - /* Convert IEEE 128-bit floating point to/from string. We explicitly use _Float128 instead of TFmode because _strtokf and _strfromkf must be compiled with long double being IBM 128. */ diff --git a/libgcc/libgcc2.h b/libgcc/libgcc2.h index fc24ac34502..6a249877c7a 100644 --- a/libgcc/libgcc2.h +++ b/libgcc/libgcc2.h @@ -156,9 +156,13 @@ typedef float XFtype __attribute__ ((mode (XF))); typedef _Complex float XCtype __attribute__ ((mode (XC))); #endif #if LIBGCC2_HAS_TF_MODE +#ifndef TFtype typedef float TFtype __attribute__ ((mode (TF))); +#endif +#ifndef TCtype typedef _Complex float TCtype __attribute__ ((mode (TC))); #endif +#endif typedef int cmp_return_type __attribute__((mode (__libgcc_cmp_return__))); typedef int shift_count_type __attribute__((mode (__libgcc_shift_count__))); diff --git a/libgcc/soft-fp/quad.h b/libgcc/soft-fp/quad.h index 3889bb44f1f..71f87d36ba9 100644 --- a/libgcc/soft-fp/quad.h +++ b/libgcc/soft-fp/quad.h @@ -65,7 +65,9 @@ #define _FP_HIGHBIT_DW_Q \ ((_FP_W_TYPE) 1 << (_FP_WFRACBITS_DW_Q - 1) % _FP_W_TYPE_SIZE) +#ifndef TFtype typedef float TFtype __attribute__ ((mode (TF))); +#endif #if _FP_W_TYPE_SIZE < 64