From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1005) id 96DCA3858D28; Tue, 17 Jan 2023 23:53:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 96DCA3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673999624; bh=h51McWiKJOhTgQWAiP3peFcQ3OXl2FGso9o0wU2DYCU=; h=From:To:Subject:Date:From; b=UwGNgUExx+xcnjwHZvhAZhV912kI86IGH0PPPHHdKHEf546PuXV3lyPRRsrgviyy5 t6mSpLrKVKvZ31kXiLw5Tyc64plbHcLtaj1D+C8fm8xKbOozXcffBxQ/l1xKa/2gH7 Spk6cPgYCHa/WO5mUBxm+x3ChY9zZM0veVYOrS4o= 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)] Revert patches X-Act-Checkin: gcc X-Git-Author: Michael Meissner X-Git-Refname: refs/users/meissner/heads/work106 X-Git-Oldrev: 9b3eddb60a24f54fd23f4564ef466c635cee2e1a X-Git-Newrev: 37ec4d01e48d4350c365a2edde01dc5a316b6bb5 Message-Id: <20230117235344.96DCA3858D28@sourceware.org> Date: Tue, 17 Jan 2023 23:53:44 +0000 (GMT) List-Id: https://gcc.gnu.org/g:37ec4d01e48d4350c365a2edde01dc5a316b6bb5 commit 37ec4d01e48d4350c365a2edde01dc5a316b6bb5 Author: Michael Meissner Date: Tue Jan 17 18:53:40 2023 -0500 Revert patches Diff: --- libgcc/config/rs6000/_divkc3.c | 18 +++++++++++------- libgcc/config/rs6000/_mulkc3.c | 8 ++------ libgcc/config/rs6000/float128-ifunc.c | 4 ---- libgcc/config/rs6000/quad-float128.h | 30 +++++++++++++++++------------- libgcc/config/rs6000/t-float128 | 1 - libgcc/config/rs6000/t-float128-hw | 1 - libgcc/libgcc2.h | 5 ----- libgcc/soft-fp/quad.h | 2 -- 8 files changed, 30 insertions(+), 39 deletions(-) diff --git a/libgcc/config/rs6000/_divkc3.c b/libgcc/config/rs6000/_divkc3.c index 4bc0e5bab63..59ab2137d1d 100644 --- a/libgcc/config/rs6000/_divkc3.c +++ b/libgcc/config/rs6000/_divkc3.c @@ -26,13 +26,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "soft-fp.h" #include "quad-float128.h" -#ifndef __LONG_DOUBLE_IEEE128__ -#error "_divkc3.c must be compiled with -mabi=ieeelongdouble" -#endif - -#define COPYSIGN(x,y) __builtin_copysignl (x, y) -#define INFINITY __builtin_infl () -#define FABS(x) __builtin_fabsl (x) +#define COPYSIGN(x,y) __builtin_copysignf128 (x, y) +#define INFINITY __builtin_inff128 () +#define FABS __builtin_fabsf128 #define isnan __builtin_isnan #define isinf __builtin_isinf #define isfinite __builtin_isfinite @@ -41,11 +37,19 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define __divkc3 __divkc3_sw #endif +#ifndef __LONG_DOUBLE_IEEE128__ +#define RBIG (__LIBGCC_KF_MAX__ / 2) +#define RMIN (__LIBGCC_KF_MIN__) +#define RMIN2 (__LIBGCC_KF_EPSILON__) +#define RMINSCAL (1 / __LIBGCC_KF_EPSILON__) +#define RMAX2 (RBIG * RMIN2) +#else #define RBIG (__LIBGCC_TF_MAX__ / 2) #define RMIN (__LIBGCC_TF_MIN__) #define RMIN2 (__LIBGCC_TF_EPSILON__) #define RMINSCAL (1 / __LIBGCC_TF_EPSILON__) #define RMAX2 (RBIG * RMIN2) +#endif TCtype __divkc3 (TFtype a, TFtype b, TFtype c, TFtype d) diff --git a/libgcc/config/rs6000/_mulkc3.c b/libgcc/config/rs6000/_mulkc3.c index 63b0f016b94..cfae81f8b5f 100644 --- a/libgcc/config/rs6000/_mulkc3.c +++ b/libgcc/config/rs6000/_mulkc3.c @@ -26,12 +26,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "soft-fp.h" #include "quad-float128.h" -#ifndef __LONG_DOUBLE_IEEE128__ -#error "_mulkc3.c must be compiled with -mabi=ieeelongdouble" -#endif - -#define COPYSIGN(x,y) __builtin_copysignl (x, y) -#define INFINITY __builtin_infl () +#define COPYSIGN(x,y) __builtin_copysignf128 (x, y) +#define INFINITY __builtin_inff128 () #define isnan __builtin_isnan #define isinf __builtin_isinf diff --git a/libgcc/config/rs6000/float128-ifunc.c b/libgcc/config/rs6000/float128-ifunc.c index 1466c733039..73cbca2fc9a 100644 --- a/libgcc/config/rs6000/float128-ifunc.c +++ b/libgcc/config/rs6000/float128-ifunc.c @@ -45,10 +45,6 @@ #error "This module must not be compiled with IEEE 128-bit hardware support" #endif -#ifndef __LONG_DOUBLE_IEEE128__ -#error "float128-ifunc.c needs to be compiled with -mabi=ieeelongdouble." -#endif - #define SW_OR_HW(SW, HW) (__builtin_cpu_supports ("ieee128") ? HW : SW) #ifdef FLOAT128_HW_INSNS_ISA3_1 #define SW_OR_HW_ISA3_1(SW, HW) (__builtin_cpu_supports ("arch_3_1") ? HW : SW) diff --git a/libgcc/config/rs6000/quad-float128.h b/libgcc/config/rs6000/quad-float128.h index c98c445d16b..ae0622c744c 100644 --- a/libgcc/config/rs6000/quad-float128.h +++ b/libgcc/config/rs6000/quad-float128.h @@ -27,14 +27,21 @@ License along with the GNU C Library; if not, see . */ -/* Override quad.h's definitions for 128-bit floating point type. */ +/* 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 TFtype _Float128 -#define TCtype _Complex _Float128 +#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 -#define TFtype long double -#define TCtype _Complex long double +typedef __complex float TCtype __attribute__ ((mode (TC))); #endif /* Force the use of the VSX instruction set. */ @@ -93,6 +100,8 @@ extern UTItype_ppc __fixunskfti_sw (TFtype); #endif extern IBM128_TYPE __extendkftf2_sw (TFtype); extern TFtype __trunctfkf2_sw (IBM128_TYPE); +extern TCtype __mulkc3_sw (TFtype, TFtype, TFtype, TFtype); +extern TCtype __divkc3_sw (TFtype, TFtype, TFtype, TFtype); #ifdef _ARCH_PPC64 extern TItype_ppc __fixkfti (TFtype); @@ -137,6 +146,8 @@ extern UTItype_ppc __fixunskfti_hw (TFtype); #endif extern IBM128_TYPE __extendkftf2_hw (TFtype); extern TFtype __trunctfkf2_hw (IBM128_TYPE); +extern TCtype __mulkc3_hw (TFtype, TFtype, TFtype, TFtype); +extern TCtype __divkc3_hw (TFtype, TFtype, TFtype, TFtype); /* Ifunc function declarations, to automatically switch between software emulation and hardware support. */ @@ -176,16 +187,9 @@ extern UTItype_ppc __fixunskfti (TFtype); extern IBM128_TYPE __extendkftf2 (TFtype); extern TFtype __trunctfkf2 (IBM128_TYPE); -#ifdef __LONG_DOUBLE_IEEE128__ -/* Only declare complex multiply/divide support functions if long double is - IEEE 128-bit. Otherwise the compiler will issue type mismatch warnings. */ -extern TCtype __mulkc3_sw (TFtype, TFtype, TFtype, TFtype); -extern TCtype __divkc3_sw (TFtype, TFtype, TFtype, TFtype); -extern TCtype __mulkc3_hw (TFtype, TFtype, TFtype, TFtype); -extern TCtype __divkc3_hw (TFtype, TFtype, TFtype, TFtype); +/* Complex __float128 built on __float128 interfaces. */ extern TCtype __mulkc3 (TFtype, TFtype, TFtype, TFtype); extern TCtype __divkc3 (TFtype, TFtype, TFtype, TFtype); -#endif /* Convert IEEE 128-bit floating point to/from string. We explicitly use _Float128 instead of TFmode because _strtokf and _strfromkf must be compiled diff --git a/libgcc/config/rs6000/t-float128 b/libgcc/config/rs6000/t-float128 index f46961dbc82..b09b5664af0 100644 --- a/libgcc/config/rs6000/t-float128 +++ b/libgcc/config/rs6000/t-float128 @@ -76,7 +76,6 @@ fp128_includes = $(srcdir)/soft-fp/double.h \ # Build the emulator without ISA 3.0 hardware support. FP128_CFLAGS_SW = -Wno-type-limits -mvsx -mfloat128 \ -mno-float128-hardware -mno-gnu-attribute \ - -mabi=ieeelongdouble \ -I$(srcdir)/soft-fp \ -I$(srcdir)/config/rs6000 \ $(FLOAT128_HW_INSNS) diff --git a/libgcc/config/rs6000/t-float128-hw b/libgcc/config/rs6000/t-float128-hw index 3450e0dfa39..d64ca4dd694 100644 --- a/libgcc/config/rs6000/t-float128-hw +++ b/libgcc/config/rs6000/t-float128-hw @@ -26,7 +26,6 @@ fp128_sed_hw = -hw FP128_CFLAGS_HW = -Wno-type-limits -mvsx -mfloat128 \ -mpower8-vector -mpower9-vector \ -mfloat128-hardware -mno-gnu-attribute \ - -mabi=ieeelongdouble -Wno-psabi \ -I$(srcdir)/soft-fp \ -I$(srcdir)/config/rs6000 \ $(FLOAT128_HW_INSNS) diff --git a/libgcc/libgcc2.h b/libgcc/libgcc2.h index a39c365d904..fc24ac34502 100644 --- a/libgcc/libgcc2.h +++ b/libgcc/libgcc2.h @@ -156,14 +156,9 @@ typedef float XFtype __attribute__ ((mode (XF))); typedef _Complex float XCtype __attribute__ ((mode (XC))); #endif #if LIBGCC2_HAS_TF_MODE -/* PowerPC would like to override this to be _Float128. */ -#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 71f87d36ba9..3889bb44f1f 100644 --- a/libgcc/soft-fp/quad.h +++ b/libgcc/soft-fp/quad.h @@ -65,9 +65,7 @@ #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