[gcc]
[official-gcc.git] / libgcc / config / rs6000 / t-float128
blob41ad527c55bd9d80779aba08b7f44732ee65048e
1 # Support for adding __float128 to the powerpc.
3 # The standard 128-bit floating point support functions are TFmode.  Most
4 # PowerPC targets use a long double format that has a pair of doubles to give
5 # you more precision, but no extra expoenent range.  This long double format is
6 # mostly compatible with the format used by the IBM XL compilers.  Some of the
7 # names used by the IBM double-double format use TF in them, so we rename
8 # all of the functions provided for the new IEEE 128-bit support.
10 # We use the TF functions in soft-fp for 128-bit floating point support, using
11 # sed to transform the names in the files from TF names to KF names.
13 # Emulator functions from the soft-fp directory
14 fp128_softfp_funcs      = addkf3 subkf3 mulkf3 divkf3 negkf2 \
15                           unordkf2 eqkf2 gekf2 lekf2 \
16                           extendsfkf2 extenddfkf2 trunckfsf2 trunckfdf2 \
17                           fixkfsi fixkfdi fixunskfsi fixunskfdi \
18                           floatsikf floatdikf floatunsikf floatundikf
20 fp128_softfp_src        = $(addsuffix -sw.c,$(fp128_softfp_funcs))
21 fp128_softfp_static_obj = $(addsuffix -sw$(objext),$(fp128_softfp_funcs))
22 fp128_softfp_shared_obj = $(addsuffix -sw_s$(objext),$(fp128_softfp_funcs))
23 fp128_softfp_obj        = $(fp128_softfp_static_obj) $(fp128_softfp_shared_obj)
25 # New functions for software emulation
26 fp128_ppc_funcs         = floattikf floatuntikf fixkfti fixunskfti \
27                           extendkftf2-sw trunctfkf2-sw \
28                           sfp-exceptions _mulkc3 _divkc3
30 fp128_ppc_src           = $(addprefix $(srcdir)/config/rs6000/,$(addsuffix \
31                                 .c,$(fp128_ppc_funcs)))
32 fp128_ppc_static_obj    = $(addsuffix $(objext),$(fp128_ppc_funcs))
33 fp128_ppc_shared_obj    = $(addsuffix _s$(objext),$(fp128_ppc_funcs))
34 fp128_ppc_obj           = $(fp128_ppc_static_obj) $(fp128_ppc_shared_obj)
36 # All functions
37 fp128_funcs             = $(fp128_softfp_funcs) $(fp128_ppc_funcs) \
38                           $(fp128_hw_funcs) $(fp128_ifunc_funcs)
40 fp128_src               = $(fp128_softfp_src) $(fp128_ppc_src) \
41                           $(fp128_hw_src) $(fp128_ifunc_src)
43 fp128_obj               = $(fp128_softfp_obj) $(fp128_ppc_obj) \
44                           $(fp128_hw_obj) $(fp128_ifunc_obj)
46 fp128_sed               = $(srcdir)/config/rs6000/float128-sed$(fp128_sed_hw)
47 fp128_dep               = $(fp128_sed) $(srcdir)/config/rs6000/t-float128
49 fp128_includes          = $(srcdir)/soft-fp/double.h \
50                           $(srcdir)/soft-fp/op-1.h \
51                           $(srcdir)/soft-fp/op-4.h \
52                           $(srcdir)/soft-fp/op-common.h \
53                           $(srcdir)/soft-fp/single.h \
54                           $(srcdir)/soft-fp/extended.h \
55                           $(srcdir)/soft-fp/op-2.h \
56                           $(srcdir)/soft-fp/op-8.h \
57                           $(srcdir)/soft-fp/quad.h \
58                           $(srcdir)/soft-fp/soft-fp.h
60 # Build the emulator without ISA 3.0 hardware support.
61 FP128_CFLAGS_SW          = -Wno-type-limits -mvsx -mfloat128 \
62                            -mno-float128-hardware \
63                            -I$(srcdir)/soft-fp \
64                            -I$(srcdir)/config/rs6000 \
65                            $(FLOAT128_HW_INSNS)
67 $(fp128_softfp_obj)      : INTERNAL_CFLAGS += $(FP128_CFLAGS_SW)
68 $(fp128_ppc_obj)         : INTERNAL_CFLAGS += $(FP128_CFLAGS_SW)
69 $(fp128_obj)             : $(fp128_includes)
70 $(fp128_obj)             : $(srcdir)/config/rs6000/quad-float128.h
72 $(fp128_softfp_src) : $(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@)) $(fp128_dep)
73         @src="$(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@))"; \
74         echo "Create $@"; \
75         (echo "/* file created from $$src */"; \
76          echo; \
77          sed -f $(fp128_sed) < $$src) > $@
79 .PHONY: test clean-float128
81 test:
82         @echo "fp128_src:"; \
83         for x in $(fp128_src); do echo "    $$x"; done; \
84         echo; \
85         echo "fp128_obj:"; \
86         for x in $(fp128_obj); do echo "    $$x"; done;
88 clean-float128:
89         -rm -f $(fp128_softfp_src) $(fp128_hardfp_src)
90         @$(MULTICLEAN) multi-clean DO=clean-float128
92 # For now, only put it in the static library
93 # LIB2ADD += $(fp128_src)
95 LIB2ADD_ST += $(fp128_src)