+2017-11-30 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR libgcc/83112
+ * config/rs6000/float128-ifunc.c (__addkf3_resolve): Use the
+ correct type for all ifunc resolvers to silence -Wattribute-alias
+ warnings. Eliminate the forward declaration of the resolver
+ functions which is no longer needed.
+ (__subkf3_resolve): Likewise.
+ (__mulkf3_resolve): Likewise.
+ (__divkf3_resolve): Likewise.
+ (__negkf2_resolve): Likewise.
+ (__eqkf2_resolve): Likewise.
+ (__nekf2_resolve): Likewise.
+ (__gekf2_resolve): Likewise.
+ (__gtkf2_resolve): Likewise.
+ (__lekf2_resolve): Likewise.
+ (__ltkf2_resolve): Likewise.
+ (__unordkf2_resolve): Likewise.
+ (__extendsfkf2_resolve): Likewise.
+ (__extenddfkf2_resolve): Likewise.
+ (__trunckfsf2_resolve): Likewise.
+ (__trunckfdf2_resolve): Likewise.
+ (__fixkfsi_resolve): Likewise.
+ (__fixkfdi_resolve): Likewise.
+ (__fixunskfsi_resolve): Likewise.
+ (__fixunskfdi_resolve): Likewise.
+ (__floatsikf_resolve): Likewise.
+ (__floatdikf_resolve): Likewise.
+ (__floatunsikf_resolve): Likewise.
+ (__floatundikf_resolve): Likewise.
+ (__extendkftf2_resolve): Likewise.
+ (__trunctfkf2_resolve): Likewise.
+
+ PR libgcc/83103
+ * config/rs6000/quad-float128.h (TF): Don't define if long double
+ is IEEE 128-bit floating point.
+ (TCtype): Define as either TCmode or KCmode, depending on whether
+ long double is IEEE 128-bit floating point.
+ (__mulkc3_sw): Add declarations for software/hardware versions of
+ complex multiply/divide.
+ (__divkc3_sw): Likewise.
+ (__mulkc3_hw): Likewise.
+ (__divkc3_hw): Likewise.
+ * config/rs6000/_mulkc3.c (_mulkc3): If we are building ifunc
+ handlers to switch between using software emulation and hardware
+ float128 instructions, build the complex multiply/divide functions
+ for both software and hardware support.
+ * config/rs6000/_divkc3.c (_divkc3): Likewise.
+ * config/rs6000/float128-ifunc.c (__mulkc3_resolve): Likewise.
+ (__divkc3_resolve): Likewise.
+ (__mulkc3): Likewise.
+ (__divkc3): Likewise.
+ * config/rs6000/t-float128-hw (fp128_hardfp_src): Likewise.
+ (fp128_hw_src): Likewise.
+ (fp128_hw_static_obj): Likewise.
+ (fp128_hw_shared_obj): Likewise.
+ (_mulkc3-hw.c): Create _mulkc3-hw.c and _divkc3-hw.c from
+ _mulkc3.c and _divkc3.c, changing the function name.
+ (_divkc3-hw.c): Likewise.
+ * config/rs6000/t-float128 (clean-float128): Delete _mulkc3-hw.c
+ and _divkc3-hw.c.
+
2017-11-26 Julia Koval <julia.koval@intel.com>
* config/i386/cpuinfo.c (get_intel_cpu): Handle cannonlake.
128-bit integer types and 128-bit IEEE floating point, or vice versa. So
use the emulator functions for these conversions. */
-static void *__addkf3_resolve (void);
-static void *__subkf3_resolve (void);
-static void *__mulkf3_resolve (void);
-static void *__divkf3_resolve (void);
-static void *__negkf2_resolve (void);
-static void *__eqkf2_resolve (void);
-static void *__nekf2_resolve (void);
-static void *__gekf2_resolve (void);
-static void *__gtkf2_resolve (void);
-static void *__lekf2_resolve (void);
-static void *__ltkf2_resolve (void);
-static void *__unordkf2_resolve (void);
-static void *__extendsfkf2_resolve (void);
-static void *__extenddfkf2_resolve (void);
-static void *__trunckfsf2_resolve (void);
-static void *__trunckfdf2_resolve (void);
-static void *__fixkfsi_resolve (void);
-static void *__fixkfdi_resolve (void);
-static void *__fixunskfsi_resolve (void);
-static void *__fixunskfdi_resolve (void);
-static void *__floatsikf_resolve (void);
-static void *__floatdikf_resolve (void);
-static void *__floatunsikf_resolve (void);
-static void *__floatundikf_resolve (void);
-static void *__extendkftf2_resolve (void);
-static void *__trunctfkf2_resolve (void);
-
-static void *
+static __typeof__ (__addkf3_sw) *
__addkf3_resolve (void)
{
- return (void *) SW_OR_HW (__addkf3_sw, __addkf3_hw);
+ return SW_OR_HW (__addkf3_sw, __addkf3_hw);
}
-static void *
+static __typeof__ (__subkf3_sw) *
__subkf3_resolve (void)
{
- return (void *) SW_OR_HW (__subkf3_sw, __subkf3_hw);
+ return SW_OR_HW (__subkf3_sw, __subkf3_hw);
}
-static void *
+static __typeof__ (__mulkf3_sw) *
__mulkf3_resolve (void)
{
- return (void *) SW_OR_HW (__mulkf3_sw, __mulkf3_hw);
+ return SW_OR_HW (__mulkf3_sw, __mulkf3_hw);
}
-static void *
+static __typeof__ (__divkf3_sw) *
__divkf3_resolve (void)
{
- return (void *) SW_OR_HW (__divkf3_sw, __divkf3_hw);
+ return SW_OR_HW (__divkf3_sw, __divkf3_hw);
}
-static void *
+static __typeof__ (__negkf2_sw) *
__negkf2_resolve (void)
{
- return (void *) SW_OR_HW (__negkf2_sw, __negkf2_hw);
+ return SW_OR_HW (__negkf2_sw, __negkf2_hw);
}
-static void *
+static __typeof__ (__floatsikf_sw) *
__floatsikf_resolve (void)
{
- return (void *) SW_OR_HW (__floatsikf_sw, __floatsikf_hw);
+ return SW_OR_HW (__floatsikf_sw, __floatsikf_hw);
}
-static void *
+static __typeof__ (__floatdikf_sw) *
__floatdikf_resolve (void)
{
- return (void *) SW_OR_HW (__floatdikf_sw, __floatdikf_hw);
+ return SW_OR_HW (__floatdikf_sw, __floatdikf_hw);
}
-static void *
+static __typeof__ (__floatunsikf_sw) *
__floatunsikf_resolve (void)
{
- return (void *) SW_OR_HW (__floatunsikf_sw, __floatunsikf_hw);
+ return SW_OR_HW (__floatunsikf_sw, __floatunsikf_hw);
}
-static void *
+static __typeof__ (__floatundikf_sw) *
__floatundikf_resolve (void)
{
- return (void *) SW_OR_HW (__floatundikf_sw, __floatundikf_hw);
+ return SW_OR_HW (__floatundikf_sw, __floatundikf_hw);
}
-static void *
+static __typeof__ (__fixkfsi_sw) *
__fixkfsi_resolve (void)
{
- return (void *) SW_OR_HW (__fixkfsi_sw, __fixkfsi_hw);
+ return SW_OR_HW (__fixkfsi_sw, __fixkfsi_hw);
}
-static void *
+static __typeof__ (__fixkfdi_sw) *
__fixkfdi_resolve (void)
{
- return (void *) SW_OR_HW (__fixkfdi_sw, __fixkfdi_hw);
+ return SW_OR_HW (__fixkfdi_sw, __fixkfdi_hw);
}
-static void *
+static __typeof__ (__fixunskfsi_sw) *
__fixunskfsi_resolve (void)
{
- return (void *) SW_OR_HW (__fixunskfsi_sw, __fixunskfsi_hw);
+ return SW_OR_HW (__fixunskfsi_sw, __fixunskfsi_hw);
}
-static void *
+static __typeof__ (__fixunskfdi_sw) *
__fixunskfdi_resolve (void)
{
- return (void *) SW_OR_HW (__fixunskfdi_sw, __fixunskfdi_hw);
+ return SW_OR_HW (__fixunskfdi_sw, __fixunskfdi_hw);
}
-static void *
+static __typeof__ (__extendsfkf2_sw) *
__extendsfkf2_resolve (void)
{
- return (void *) SW_OR_HW (__extendsfkf2_sw, __extendsfkf2_hw);
+ return SW_OR_HW (__extendsfkf2_sw, __extendsfkf2_hw);
}
-static void *
+static __typeof__ (__extenddfkf2_sw) *
__extenddfkf2_resolve (void)
{
- return (void *) SW_OR_HW (__extenddfkf2_sw, __extenddfkf2_hw);
+ return SW_OR_HW (__extenddfkf2_sw, __extenddfkf2_hw);
}
-static void *
+static __typeof__ (__trunckfsf2_sw) *
__trunckfsf2_resolve (void)
{
- return (void *) SW_OR_HW (__trunckfsf2_sw, __trunckfsf2_hw);
+ return SW_OR_HW (__trunckfsf2_sw, __trunckfsf2_hw);
}
-static void *
+static __typeof__ (__trunckfdf2_sw) *
__trunckfdf2_resolve (void)
{
return (void *) SW_OR_HW (__trunckfdf2_sw, __trunckfdf2_hw);
}
-static void *
+static __typeof__ (__extendkftf2_sw) *
__extendkftf2_resolve (void)
{
- return (void *) SW_OR_HW (__extendkftf2_sw, __extendkftf2_hw);
+ return SW_OR_HW (__extendkftf2_sw, __extendkftf2_hw);
}
-static void *
+static __typeof__ (__trunctfkf2_sw) *
__trunctfkf2_resolve (void)
{
- return (void *) SW_OR_HW (__trunctfkf2_sw, __trunctfkf2_hw);
+ return SW_OR_HW (__trunctfkf2_sw, __trunctfkf2_hw);
}
-static void *
+static __typeof__ (__mulkc3_sw) *
+__mulkc3_resolve (void)
+{
+ return SW_OR_HW (__mulkc3_sw, __mulkc3_hw);
+}
+
+static __typeof__ (__divkc3_sw) *
+__divkc3_resolve (void)
+{
+ return SW_OR_HW (__divkc3_sw, __divkc3_hw);
+}
+
+static __typeof__ (__eqkf2_sw) *
__eqkf2_resolve (void)
{
- return (void *) SW_OR_HW (__eqkf2_sw, __eqkf2_hw);
+ return SW_OR_HW (__eqkf2_sw, __eqkf2_hw);
}
-static void *
+static __typeof__ (__gekf2_sw) *
__gekf2_resolve (void)
{
- return (void *) SW_OR_HW (__gekf2_sw, __gekf2_hw);
+ return SW_OR_HW (__gekf2_sw, __gekf2_hw);
}
-static void *
+static __typeof__ (__lekf2_sw) *
__lekf2_resolve (void)
{
- return (void *) SW_OR_HW (__lekf2_sw, __lekf2_hw);
+ return SW_OR_HW (__lekf2_sw, __lekf2_hw);
}
-static void *
+static __typeof__ (__unordkf2_sw) *
__unordkf2_resolve (void)
{
- return (void *) SW_OR_HW (__unordkf2_sw, __unordkf2_hw);
+ return SW_OR_HW (__unordkf2_sw, __unordkf2_hw);
}
/* Resolve __nekf2, __gtkf2, __ltkf2 like __eqkf2, __gekf2, and __lekf2, since
the functions return the same values. */
-static void *
+static __typeof__ (__eqkf2_sw) *
__nekf2_resolve (void)
{
- return (void *) SW_OR_HW (__eqkf2_sw, __eqkf2_hw);
+ return SW_OR_HW (__eqkf2_sw, __eqkf2_hw);
}
-static void *
+static __typeof__ (__eqkf2_sw) *
__gtkf2_resolve (void)
{
- return (void *) SW_OR_HW (__gekf2_sw, __gekf2_hw);
+ return SW_OR_HW (__gekf2_sw, __gekf2_hw);
}
-static void *
+static __typeof__ (__eqkf2_sw) *
__ltkf2_resolve (void)
{
- return (void *) SW_OR_HW (__lekf2_sw, __lekf2_hw);
+ return SW_OR_HW (__lekf2_sw, __lekf2_hw);
}
TFtype __trunctfkf2 (IBM128_TYPE)
__attribute__ ((__ifunc__ ("__trunctfkf2_resolve")));
+
+TCtype __mulkc3 (TFtype, TFtype, TFtype, TFtype)
+ __attribute__ ((__ifunc__ ("__mulkc3_resolve")));
+
+TCtype __divkc3 (TFtype, TFtype, TFtype, TFtype)
+ __attribute__ ((__ifunc__ ("__divkc3_resolve")));
/* 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). */
+ 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
+
/* Force the use of the VSX instruction set. */
#if defined(_ARCH_PPC) && (!defined(__VSX__) || !defined(__FLOAT128__))
#pragma GCC target ("vsx,float128")
extern TFtype __floatundikf_sw (UDItype_ppc);
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
/* We do not provide ifunc resolvers for __fixkfti, __fixunskfti, __floattikf,
extern TFtype __floatundikf_hw (UDItype_ppc);
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. */