gcc/libgcc/config/rs6000/t-float128-hw
Michael Meissner 6a8886e45f 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 19:10:08 +00:00

50 lines
1.9 KiB
Plaintext

# Support for adding __float128 hardware support to the powerpc.
# Tell the float128 functions that the ISA 3.0 hardware support can
# be compiled it to be selected via IFUNC functions.
FLOAT128_HW_INSNS = -DFLOAT128_HW_INSNS
# New functions for hardware support
fp128_hardfp_src = _mulkc3-hw.c _divkc3-hw.c
fp128_hw_funcs = float128-hw _mulkc3-hw _divkc3-hw _powikf2-hw
fp128_hw_src = $(srcdir)/config/rs6000/float128-hw.c _mulkc3-hw.c \
_divkc3-hw.c _powikf2-hw.c
fp128_hw_static_obj = $(addsuffix $(objext),$(fp128_hw_funcs))
fp128_hw_shared_obj = $(addsuffix _s$(objext),$(fp128_hw_funcs))
fp128_hw_obj = $(fp128_hw_static_obj) $(fp128_hw_shared_obj)
fp128_ifunc_funcs = float128-ifunc
fp128_ifunc_src = $(srcdir)/config/rs6000/float128-ifunc.c
fp128_ifunc_static_obj = float128-ifunc$(objext)
fp128_ifunc_shared_obj = float128-ifunc_s$(objext)
fp128_ifunc_obj = $(fp128_ifunc_static_obj) $(fp128_ifunc_shared_obj)
# Add _sw suffix to names to allow ifunc support.
fp128_sed_hw = -hw
# Build the hardware support functions with appropriate hardware support
FP128_CFLAGS_HW = -Wno-type-limits -mvsx -mfloat128 \
-mpower8-vector -mpower9-vector \
-mfloat128-hardware -mno-gnu-attribute \
-I$(srcdir)/soft-fp \
-I$(srcdir)/config/rs6000 \
$(FLOAT128_HW_INSNS)
$(fp128_hw_obj) : INTERNAL_CFLAGS += $(FP128_CFLAGS_HW)
$(fp128_hw_obj) : $(srcdir)/config/rs6000/t-float128-hw
$(fp128_ifunc_obj) : INTERNAL_CFLAGS += $(FP128_CFLAGS_SW)
$(fp128_ifunc_obj) : $(srcdir)/config/rs6000/t-float128-hw
_mulkc3-hw.c: $(srcdir)/config/rs6000/_mulkc3.c
(echo "#define __mulkc3 __mulkc3_hw"; \
cat $(srcdir)/config/rs6000/_mulkc3.c) > _mulkc3-hw.c
_divkc3-hw.c: $(srcdir)/config/rs6000/_divkc3.c
(echo "#define __divkc3 __divkc3_hw"; \
cat $(srcdir)/config/rs6000/_divkc3.c) > _divkc3-hw.c
_powikf2-hw.c: $(srcdir)/config/rs6000/_powikf2.c
(echo "#define __powikf2 __powikf2_hw"; \
cat $(srcdir)/config/rs6000/_powikf2.c) > _powikf2-hw.c