1 # Copyright (C) 2006 Free Software Foundation, Inc.
3 # This file is part of GCC.
5 # GCC is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
10 # GCC is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with GCC; see the file COPYING. If not, write to
17 # the Free Software Foundation, 51 Franklin Street, Fifth Floor,
18 # Boston MA 02110-1301, USA.
20 # Targets using soft-fp should define the following variables:
22 # softfp_float_modes: a list of soft-float floating-point modes,
24 # softfp_int_modes: a list of integer modes for which to define conversions,
26 # softfp_extensions: a list of extensions between floating-point modes,
28 # softfp_truncations: a list of truncations between floating-point modes,
30 # softfp_machine_header: the target sfp-machine.h file (relative to config/),
31 # e.g. rs6000/sfp-machine.h
33 # Extensions and truncations should include those where only one mode
34 # is a soft-float mode; for example, sftf where sf is hard-float and
37 # If the libgcc2.c functions should not be replaced, also define:
39 # softfp_exclude_libgcc2 := y
41 # Avoiding replacing the libgcc2.c functions is a temporary measure
42 # for targets with both hard-float and soft-float multilibs, since
43 # these variables apply for all multilibs. With toplevel libgcc,
44 # soft-fp can be used conditionally on the multilib instead.
46 # If the code should not be compiled at all for some multilibs, define:
48 # softfp_wrap_start: text to put at the start of wrapper source files,
50 # e.g. '#ifndef __powerpc64__'
51 # softfp_wrap_end: text to put at the end of wrapper source files,
54 # This is another temporary measure.
56 softfp_float_funcs = add$(m)3 div$(m)3 eq$(m)2 ge$(m)2 le$(m)2 mul$(m)3 \
57 neg$(m)2 sub$(m)3 unord$(m)2
58 softfp_floatint_funcs = fix$(m)$(i) fixuns$(m)$(i) \
59 float$(i)$(m) floatun$(i)$(m)
62 $(foreach m,$(softfp_float_modes), \
63 $(softfp_float_funcs) \
64 $(foreach i,$(softfp_int_modes), \
65 $(softfp_floatint_funcs))) \
66 $(foreach e,$(softfp_extensions),extend$(e)2) \
67 $(foreach t,$(softfp_truncations),trunc$(t)2)
69 ifeq ($(softfp_exclude_libgcc2),y)
70 # This list is taken from mklibgcc.in and doesn't presently allow for
71 # 64-bit targets where si should become di and di should become ti.
72 softfp_func_list := $(filter-out floatdidf floatdisf fixunsdfsi fixunssfsi \
73 fixunsdfdi fixdfdi fixunssfdi fixsfdi fixxfdi fixunsxfdi \
74 floatdixf fixunsxfsi fixtfdi fixunstfdi floatditf \
75 floatundidf floatundisf floatundixf floatunditf,$(softfp_func_list))
78 ifeq ($(softfp_wrap_start),)
80 $(addsuffix .c,$(addprefix $(srcdir)/config/soft-fp/,$(softfp_func_list)))
82 softfp_file_list := $(addsuffix .c,$(softfp_func_list))
85 echo $(softfp_wrap_start) > $@
86 echo '#include "config/soft-fp/$@"' >> $@
87 echo $(softfp_wrap_end) >> $@
90 LIB2FUNCS_EXTRA += $(softfp_file_list)
92 ifneq ($(softfp_exclude_libgcc2),y)
93 # Functions in libgcc2.c are excluded for each soft-float mode (a
94 # target may have both soft-float and hard-float modes), for the fixed
95 # list of integer modes (si and di) for which libgcc2.c defines any
96 # such functions. Depending on the target, the si and di symbols may
97 # in fact define di and ti functions.
99 LIB2FUNCS_EXCLUDE += \
100 $(addprefix _,$(foreach m,$(softfp_float_modes), \
102 $(softfp_floatint_funcs))))
105 SFP_MACHINE := sfp-machine.h
107 $(SFP_MACHINE): $(srcdir)/config/$(softfp_machine_header)
108 cp $(srcdir)/config/$(softfp_machine_header) $(SFP_MACHINE)