gcc/libgcc/config/rs6000/t-float128

96 lines
3.5 KiB
Plaintext
Raw Normal View History

float128-sed: New files to convert TF names to KF names for PowerPC IEEE 128-bit floating... 2016-01-21 Michael Meissner <meissner@linux.vnet.ibm.com> Steven Munroe <munroesj@linux.vnet.ibm.com> Tulio Magno Quites Machado Filho <tulioqm@br.ibm.com> * config/rs6000/float128-sed: New files to convert TF names to KF names for PowerPC IEEE 128-bit floating point support. * config/rs6000/float128-sed-hw: Likewise. * config/rs6000/float128-hw.c: New file for ISA 3.0 IEEE 128-bit floating point hardware support. * config/rs6000/float128-ifunc.c: New file to pick either IEEE 128-bit floating point software emulation or use ISA 3.0 hardware support if it is available. * config/rs6000/quad-float128.h: New file to support IEEE 128-bit floating point. * config/rs6000/extendkftf2-sw.c: New file, convert IEEE 128-bit floating point to IBM extended double. * config/rs6000/trunctfkf2-sw.c: New file, convert IBM extended double to IEEE 128-bit floating point. * config/rs6000/t-float128: New Makefile fragments to enable building __float128 emulation support. * config/rs6000/t-float128-hw: Likewise. * config/rs6000/sfp-exceptions.c: New file to provide exception support for IEEE 128-bit floating point. * config/rs6000/floattikf.c: New files for converting between IEEE 128-bit floating point and signed/unsigned 128-bit integers. * config/rs6000/fixunskfti.c: Likewise. * config/rs6000/fixkfti.c: Likewise. * config/rs6000/floatuntikf.c: Likewise. * config/rs6000/sfp-machine.h (_FP_W_TYPE_SIZE): Use 64-bit types when building on 64-bit systems, or when VSX is enabled. (_FP_W_TYPE): Likewise. (_FP_WS_TYPE): Likewise. (_FP_I_TYPE): Likewise. (TItype): Define on 64-bit systems. (UTItype): Likewise. (TI_BITS): Likewise. (_FP_MUL_MEAT_D): Add support for using 64-bit types. (_FP_MUL_MEAT_Q): Likewise. (_FP_DIV_MEAT_D): Likewise. (_FP_DIV_MEAT_Q): Likewise. (_FP_NANFRAC_D): Likewise. (_FP_NANFRAC_Q): Likewise. (ISA_BIT): Add exception support if we are being compiled on a machine with hardware floating point support to build the IEEE 128-bit emulation functions. (FP_EX_INVALID): Likewise. (FP_EX_OVERFLOW): Likewise. (FP_EX_UNDERFLOW): Likewise. (FP_EX_DIVZERO): Likewise. (FP_EX_INEXACT): Likewise. (FP_EX_ALL): Likewise. (__sfp_handle_exceptions): Likewise. (FP_HANDLE_EXCEPTIONS): Likewise. (FP_RND_NEAREST): Likewise. (FP_RND_ZERO): Likewise. (FP_RND_PINF): Likewise. (FP_RND_MINF): Likewise. (FP_RND_MASK): Likewise. (_FP_DECL_EX): Likewise. (FP_INIT_ROUNDMODE): Likewise. (FP_ROUNDMODE): Likewise. * libgcc/config.host (powerpc*-*-linux*): If compiler can compile VSX code, enable IEEE 128-bit floating point. If the compiler can compile IEEE 128-bit floating point code with ISA 3.0 IEEE 128-bit floating point hardware instructions and it supports declaring functions with the ifunc attribute, enable ifunc functions to switch between software and hardware support. * configure.ac (powerpc*-*-linux*): Likewise. * configure: Regenerate. Co-Authored-By: Steven Munroe <munroesj@linux.vnet.ibm.com> Co-Authored-By: Tulio Magno Quites Machado Filho <tulioqm@br.ibm.com> From-SVN: r232685
2016-01-21 18:52:33 +01:00
# Support for adding __float128 to the powerpc.
# The standard 128-bit floating point support functions are TFmode. Most
# PowerPC targets use a long double format that has a pair of doubles to give
# you more precision, but no extra expoenent range. This long double format is
# mostly compatible with the format used by the IBM XL compilers. Some of the
# names used by the IBM double-double format use TF in them, so we rename
# all of the functions provided for the new IEEE 128-bit support.
#
# We use the TF functions in soft-fp for 128-bit floating point support, using
# sed to transform the names in the files from TF names to KF names.
# Emulator functions from the soft-fp directory
fp128_softfp_funcs = addkf3 subkf3 mulkf3 divkf3 negkf2 \
unordkf2 eqkf2 gekf2 lekf2 \
extendsfkf2 extenddfkf2 trunckfsf2 trunckfdf2 \
fixkfsi fixkfdi fixunskfsi fixunskfdi \
floatsikf floatdikf floatunsikf floatundikf
fp128_softfp_src = $(addsuffix -sw.c,$(fp128_softfp_funcs))
fp128_softfp_static_obj = $(addsuffix -sw$(objext),$(fp128_softfp_funcs))
fp128_softfp_shared_obj = $(addsuffix -sw_s$(objext),$(fp128_softfp_funcs))
fp128_softfp_obj = $(fp128_softfp_static_obj) $(fp128_softfp_shared_obj)
# New functions for software emulation
fp128_ppc_funcs = floattikf floatuntikf fixkfti fixunskfti \
extendkftf2-sw trunctfkf2-sw \
sfp-exceptions _mulkc3 _divkc3 _powikf2
float128-sed: New files to convert TF names to KF names for PowerPC IEEE 128-bit floating... 2016-01-21 Michael Meissner <meissner@linux.vnet.ibm.com> Steven Munroe <munroesj@linux.vnet.ibm.com> Tulio Magno Quites Machado Filho <tulioqm@br.ibm.com> * config/rs6000/float128-sed: New files to convert TF names to KF names for PowerPC IEEE 128-bit floating point support. * config/rs6000/float128-sed-hw: Likewise. * config/rs6000/float128-hw.c: New file for ISA 3.0 IEEE 128-bit floating point hardware support. * config/rs6000/float128-ifunc.c: New file to pick either IEEE 128-bit floating point software emulation or use ISA 3.0 hardware support if it is available. * config/rs6000/quad-float128.h: New file to support IEEE 128-bit floating point. * config/rs6000/extendkftf2-sw.c: New file, convert IEEE 128-bit floating point to IBM extended double. * config/rs6000/trunctfkf2-sw.c: New file, convert IBM extended double to IEEE 128-bit floating point. * config/rs6000/t-float128: New Makefile fragments to enable building __float128 emulation support. * config/rs6000/t-float128-hw: Likewise. * config/rs6000/sfp-exceptions.c: New file to provide exception support for IEEE 128-bit floating point. * config/rs6000/floattikf.c: New files for converting between IEEE 128-bit floating point and signed/unsigned 128-bit integers. * config/rs6000/fixunskfti.c: Likewise. * config/rs6000/fixkfti.c: Likewise. * config/rs6000/floatuntikf.c: Likewise. * config/rs6000/sfp-machine.h (_FP_W_TYPE_SIZE): Use 64-bit types when building on 64-bit systems, or when VSX is enabled. (_FP_W_TYPE): Likewise. (_FP_WS_TYPE): Likewise. (_FP_I_TYPE): Likewise. (TItype): Define on 64-bit systems. (UTItype): Likewise. (TI_BITS): Likewise. (_FP_MUL_MEAT_D): Add support for using 64-bit types. (_FP_MUL_MEAT_Q): Likewise. (_FP_DIV_MEAT_D): Likewise. (_FP_DIV_MEAT_Q): Likewise. (_FP_NANFRAC_D): Likewise. (_FP_NANFRAC_Q): Likewise. (ISA_BIT): Add exception support if we are being compiled on a machine with hardware floating point support to build the IEEE 128-bit emulation functions. (FP_EX_INVALID): Likewise. (FP_EX_OVERFLOW): Likewise. (FP_EX_UNDERFLOW): Likewise. (FP_EX_DIVZERO): Likewise. (FP_EX_INEXACT): Likewise. (FP_EX_ALL): Likewise. (__sfp_handle_exceptions): Likewise. (FP_HANDLE_EXCEPTIONS): Likewise. (FP_RND_NEAREST): Likewise. (FP_RND_ZERO): Likewise. (FP_RND_PINF): Likewise. (FP_RND_MINF): Likewise. (FP_RND_MASK): Likewise. (_FP_DECL_EX): Likewise. (FP_INIT_ROUNDMODE): Likewise. (FP_ROUNDMODE): Likewise. * libgcc/config.host (powerpc*-*-linux*): If compiler can compile VSX code, enable IEEE 128-bit floating point. If the compiler can compile IEEE 128-bit floating point code with ISA 3.0 IEEE 128-bit floating point hardware instructions and it supports declaring functions with the ifunc attribute, enable ifunc functions to switch between software and hardware support. * configure.ac (powerpc*-*-linux*): Likewise. * configure: Regenerate. Co-Authored-By: Steven Munroe <munroesj@linux.vnet.ibm.com> Co-Authored-By: Tulio Magno Quites Machado Filho <tulioqm@br.ibm.com> From-SVN: r232685
2016-01-21 18:52:33 +01:00
fp128_ppc_src = $(addprefix $(srcdir)/config/rs6000/,$(addsuffix \
.c,$(fp128_ppc_funcs)))
fp128_ppc_static_obj = $(addsuffix $(objext),$(fp128_ppc_funcs))
fp128_ppc_shared_obj = $(addsuffix _s$(objext),$(fp128_ppc_funcs))
fp128_ppc_obj = $(fp128_ppc_static_obj) $(fp128_ppc_shared_obj)
# All functions
fp128_funcs = $(fp128_softfp_funcs) $(fp128_ppc_funcs) \
$(fp128_hw_funcs) $(fp128_ifunc_funcs)
fp128_src = $(fp128_softfp_src) $(fp128_ppc_src) \
$(fp128_hw_src) $(fp128_ifunc_src)
fp128_obj = $(fp128_softfp_obj) $(fp128_ppc_obj) \
$(fp128_hw_obj) $(fp128_ifunc_obj)
fp128_sed = $(srcdir)/config/rs6000/float128-sed$(fp128_sed_hw)
fp128_dep = $(fp128_sed) $(srcdir)/config/rs6000/t-float128
fp128_includes = $(srcdir)/soft-fp/double.h \
$(srcdir)/soft-fp/op-1.h \
$(srcdir)/soft-fp/op-4.h \
$(srcdir)/soft-fp/op-common.h \
$(srcdir)/soft-fp/single.h \
$(srcdir)/soft-fp/extended.h \
$(srcdir)/soft-fp/op-2.h \
$(srcdir)/soft-fp/op-8.h \
$(srcdir)/soft-fp/quad.h \
$(srcdir)/soft-fp/soft-fp.h
# Build the emulator without ISA 3.0 hardware support.
FP128_CFLAGS_SW = -Wno-type-limits -mvsx -mfloat128 \
re PR target/85358 (PowerPC: Using -mabi=ieeelongdouble -mcpu=power9 breaks __ibm128) [gcc] 2018-06-18 Michael Meissner <meissner@linux.ibm.com> PR target/85358 * config/rs6000/rs6000-modes.def (toplevel): Rework the 128-bit floating point modes, so that IFmode is numerically greater than TFmode, which is greater than KFmode using FRACTIONAL_FLOAT_MODE to declare the ordering. This prevents IFmode from being converted to TFmode when long double is IEEE 128-bit on an ISA 3.0 machine. Include rs6000-modes.h to share the fractional values between genmodes* and the rest of the compiler. (IFmode): Likewise. (KFmode): Likewise. (TFmode): Likewise. * config/rs6000/rs6000-modes.h: New file. * config/rs6000/rs6000.c (rs6000_debug_reg_global): Change the meaning of rs6000_long_double_size so that 126..128 selects an appropriate 128-bit floating point type. (rs6000_option_override_internal): Likewise. * config/rs6000/rs6000.h (toplevel): Include rs6000-modes.h. (TARGET_LONG_DOUBLE_128): Change the meaning of rs6000_long_double_size so that 126..128 selects an appropriate 128-bit floating point type. (LONG_DOUBLE_TYPE_SIZE): Update comment. * config/rs6000/rs6000.md (trunciftf2): Correct the modes of the source and destination to match the standard usage. (truncifkf2): Likewise. (copysign<mode>3, IEEE iterator): Rework copysign of float128 on ISA 2.07 to use an explicit clobber, instead of passing in a temporary. (copysign<mode>3_soft): Likewise. [libgcc] 2018-06-18 Michael Meissner <meissner@linux.ibm.com> * config/rs6000/t-float128 (FP128_CFLAGS_SW): Compile float128 support modules with -mno-gnu-attribute. * config/rs6000/t-float128-hw (FP128_CFLAGS_HW): Likewise. From-SVN: r261712
2018-06-18 21:10:08 +02:00
-mno-float128-hardware -mno-gnu-attribute \
float128-sed: New files to convert TF names to KF names for PowerPC IEEE 128-bit floating... 2016-01-21 Michael Meissner <meissner@linux.vnet.ibm.com> Steven Munroe <munroesj@linux.vnet.ibm.com> Tulio Magno Quites Machado Filho <tulioqm@br.ibm.com> * config/rs6000/float128-sed: New files to convert TF names to KF names for PowerPC IEEE 128-bit floating point support. * config/rs6000/float128-sed-hw: Likewise. * config/rs6000/float128-hw.c: New file for ISA 3.0 IEEE 128-bit floating point hardware support. * config/rs6000/float128-ifunc.c: New file to pick either IEEE 128-bit floating point software emulation or use ISA 3.0 hardware support if it is available. * config/rs6000/quad-float128.h: New file to support IEEE 128-bit floating point. * config/rs6000/extendkftf2-sw.c: New file, convert IEEE 128-bit floating point to IBM extended double. * config/rs6000/trunctfkf2-sw.c: New file, convert IBM extended double to IEEE 128-bit floating point. * config/rs6000/t-float128: New Makefile fragments to enable building __float128 emulation support. * config/rs6000/t-float128-hw: Likewise. * config/rs6000/sfp-exceptions.c: New file to provide exception support for IEEE 128-bit floating point. * config/rs6000/floattikf.c: New files for converting between IEEE 128-bit floating point and signed/unsigned 128-bit integers. * config/rs6000/fixunskfti.c: Likewise. * config/rs6000/fixkfti.c: Likewise. * config/rs6000/floatuntikf.c: Likewise. * config/rs6000/sfp-machine.h (_FP_W_TYPE_SIZE): Use 64-bit types when building on 64-bit systems, or when VSX is enabled. (_FP_W_TYPE): Likewise. (_FP_WS_TYPE): Likewise. (_FP_I_TYPE): Likewise. (TItype): Define on 64-bit systems. (UTItype): Likewise. (TI_BITS): Likewise. (_FP_MUL_MEAT_D): Add support for using 64-bit types. (_FP_MUL_MEAT_Q): Likewise. (_FP_DIV_MEAT_D): Likewise. (_FP_DIV_MEAT_Q): Likewise. (_FP_NANFRAC_D): Likewise. (_FP_NANFRAC_Q): Likewise. (ISA_BIT): Add exception support if we are being compiled on a machine with hardware floating point support to build the IEEE 128-bit emulation functions. (FP_EX_INVALID): Likewise. (FP_EX_OVERFLOW): Likewise. (FP_EX_UNDERFLOW): Likewise. (FP_EX_DIVZERO): Likewise. (FP_EX_INEXACT): Likewise. (FP_EX_ALL): Likewise. (__sfp_handle_exceptions): Likewise. (FP_HANDLE_EXCEPTIONS): Likewise. (FP_RND_NEAREST): Likewise. (FP_RND_ZERO): Likewise. (FP_RND_PINF): Likewise. (FP_RND_MINF): Likewise. (FP_RND_MASK): Likewise. (_FP_DECL_EX): Likewise. (FP_INIT_ROUNDMODE): Likewise. (FP_ROUNDMODE): Likewise. * libgcc/config.host (powerpc*-*-linux*): If compiler can compile VSX code, enable IEEE 128-bit floating point. If the compiler can compile IEEE 128-bit floating point code with ISA 3.0 IEEE 128-bit floating point hardware instructions and it supports declaring functions with the ifunc attribute, enable ifunc functions to switch between software and hardware support. * configure.ac (powerpc*-*-linux*): Likewise. * configure: Regenerate. Co-Authored-By: Steven Munroe <munroesj@linux.vnet.ibm.com> Co-Authored-By: Tulio Magno Quites Machado Filho <tulioqm@br.ibm.com> From-SVN: r232685
2016-01-21 18:52:33 +01:00
-I$(srcdir)/soft-fp \
-I$(srcdir)/config/rs6000 \
$(FLOAT128_HW_INSNS)
$(fp128_softfp_obj) : INTERNAL_CFLAGS += $(FP128_CFLAGS_SW)
$(fp128_ppc_obj) : INTERNAL_CFLAGS += $(FP128_CFLAGS_SW)
$(fp128_obj) : $(fp128_includes)
$(fp128_obj) : $(srcdir)/config/rs6000/quad-float128.h
$(fp128_softfp_src) : $(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@)) $(fp128_dep)
@src="$(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@))"; \
echo "Create $@"; \
(echo "/* file created from $$src */"; \
echo; \
sed -f $(fp128_sed) < $$src) > $@
.PHONY: test clean-float128
test:
@echo "fp128_src:"; \
for x in $(fp128_src); do echo " $$x"; done; \
echo; \
echo "fp128_obj:"; \
for x in $(fp128_obj); do echo " $$x"; done;
clean-float128:
re PR libgcc/83112 (Silence warnings from PowerPC libgcc float128-ifunc.c compilation) 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. From-SVN: r255282
2017-11-30 21:52:27 +01:00
-rm -f $(fp128_softfp_src) $(fp128_hardfp_src)
float128-sed: New files to convert TF names to KF names for PowerPC IEEE 128-bit floating... 2016-01-21 Michael Meissner <meissner@linux.vnet.ibm.com> Steven Munroe <munroesj@linux.vnet.ibm.com> Tulio Magno Quites Machado Filho <tulioqm@br.ibm.com> * config/rs6000/float128-sed: New files to convert TF names to KF names for PowerPC IEEE 128-bit floating point support. * config/rs6000/float128-sed-hw: Likewise. * config/rs6000/float128-hw.c: New file for ISA 3.0 IEEE 128-bit floating point hardware support. * config/rs6000/float128-ifunc.c: New file to pick either IEEE 128-bit floating point software emulation or use ISA 3.0 hardware support if it is available. * config/rs6000/quad-float128.h: New file to support IEEE 128-bit floating point. * config/rs6000/extendkftf2-sw.c: New file, convert IEEE 128-bit floating point to IBM extended double. * config/rs6000/trunctfkf2-sw.c: New file, convert IBM extended double to IEEE 128-bit floating point. * config/rs6000/t-float128: New Makefile fragments to enable building __float128 emulation support. * config/rs6000/t-float128-hw: Likewise. * config/rs6000/sfp-exceptions.c: New file to provide exception support for IEEE 128-bit floating point. * config/rs6000/floattikf.c: New files for converting between IEEE 128-bit floating point and signed/unsigned 128-bit integers. * config/rs6000/fixunskfti.c: Likewise. * config/rs6000/fixkfti.c: Likewise. * config/rs6000/floatuntikf.c: Likewise. * config/rs6000/sfp-machine.h (_FP_W_TYPE_SIZE): Use 64-bit types when building on 64-bit systems, or when VSX is enabled. (_FP_W_TYPE): Likewise. (_FP_WS_TYPE): Likewise. (_FP_I_TYPE): Likewise. (TItype): Define on 64-bit systems. (UTItype): Likewise. (TI_BITS): Likewise. (_FP_MUL_MEAT_D): Add support for using 64-bit types. (_FP_MUL_MEAT_Q): Likewise. (_FP_DIV_MEAT_D): Likewise. (_FP_DIV_MEAT_Q): Likewise. (_FP_NANFRAC_D): Likewise. (_FP_NANFRAC_Q): Likewise. (ISA_BIT): Add exception support if we are being compiled on a machine with hardware floating point support to build the IEEE 128-bit emulation functions. (FP_EX_INVALID): Likewise. (FP_EX_OVERFLOW): Likewise. (FP_EX_UNDERFLOW): Likewise. (FP_EX_DIVZERO): Likewise. (FP_EX_INEXACT): Likewise. (FP_EX_ALL): Likewise. (__sfp_handle_exceptions): Likewise. (FP_HANDLE_EXCEPTIONS): Likewise. (FP_RND_NEAREST): Likewise. (FP_RND_ZERO): Likewise. (FP_RND_PINF): Likewise. (FP_RND_MINF): Likewise. (FP_RND_MASK): Likewise. (_FP_DECL_EX): Likewise. (FP_INIT_ROUNDMODE): Likewise. (FP_ROUNDMODE): Likewise. * libgcc/config.host (powerpc*-*-linux*): If compiler can compile VSX code, enable IEEE 128-bit floating point. If the compiler can compile IEEE 128-bit floating point code with ISA 3.0 IEEE 128-bit floating point hardware instructions and it supports declaring functions with the ifunc attribute, enable ifunc functions to switch between software and hardware support. * configure.ac (powerpc*-*-linux*): Likewise. * configure: Regenerate. Co-Authored-By: Steven Munroe <munroesj@linux.vnet.ibm.com> Co-Authored-By: Tulio Magno Quites Machado Filho <tulioqm@br.ibm.com> From-SVN: r232685
2016-01-21 18:52:33 +01:00
@$(MULTICLEAN) multi-clean DO=clean-float128
# For now, only put it in the static library
# LIB2ADD += $(fp128_src)
LIB2ADD_ST += $(fp128_src)