Message ID | 1630015543-9604-1-git-send-email-patrick.mcgehearty@oracle.com |
---|---|
State | New |
Headers | show |
Series | [v4] Fix for powerpc64 long double complex divide failure | expand |
On Thu, 26 Aug 2021, Patrick McGehearty via Gcc-patches wrote: > The revision retains the use of __LIBGCC_DF_* in .../rs6000/_divkc3.c > instead of __LIBGCC_KF_* since some older but still supported environments > do not recognize the KF floating point mode properly. This change has a That part of the patch is still wrong and should not be applied. I don't know where the actual problem is in the compiler causing __LIBGCC_KF_* not to be defined, but using a DFmode macro there is incorrect.
I will prepare a patch without the changes to .../rs6000/_divkc3.c but I have no way of testing it to confirm it fixes the original complaint. On 8/26/2021 5:09 PM, Joseph Myers wrote: > On Thu, 26 Aug 2021, Patrick McGehearty via Gcc-patches wrote: > >> The revision retains the use of __LIBGCC_DF_* in .../rs6000/_divkc3.c >> instead of __LIBGCC_KF_* since some older but still supported environments >> do not recognize the KF floating point mode properly. This change has a > That part of the patch is still wrong and should not be applied. I don't > know where the actual problem is in the compiler causing __LIBGCC_KF_* not > to be defined, but using a DFmode macro there is incorrect. >
diff --git a/libgcc/config/rs6000/_divkc3.c b/libgcc/config/rs6000/_divkc3.c index a1d29d2..2b229c8 100644 --- a/libgcc/config/rs6000/_divkc3.c +++ b/libgcc/config/rs6000/_divkc3.c @@ -38,10 +38,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #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 RBIG (__LIBGCC_DF_MAX__ / 2) +#define RMIN (__LIBGCC_DF_MIN__) +#define RMIN2 (__LIBGCC_DF_EPSILON__) +#define RMINSCAL (1 / __LIBGCC_DF_EPSILON__) #define RMAX2 (RBIG * RMIN2) #else #define RBIG (__LIBGCC_TF_MAX__ / 2) diff --git a/libgcc/libgcc2.c b/libgcc/libgcc2.c index 38f935e..a0fc724 100644 --- a/libgcc/libgcc2.c +++ b/libgcc/libgcc2.c @@ -1906,8 +1906,13 @@ NAME (TYPE x, int m) # define NOTRUNC (!__LIBGCC_TF_EXCESS_PRECISION__) # define RBIG (__LIBGCC_TF_MAX__ / 2) # define RMIN (__LIBGCC_TF_MIN__) +#if __LIBGCC_TF_MANT_DIG__ == 106 +# define RMIN2 (__LIBGCC_DF_EPSILON__) +# define RMINSCAL (1 / __LIBGCC_DF_EPSILON__) +# else # define RMIN2 (__LIBGCC_TF_EPSILON__) # define RMINSCAL (1 / __LIBGCC_TF_EPSILON__) +#endif # define RMAX2 (RBIG * RMIN2) #else # error