1 # Copyright (C) 2006-2014 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 3, 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 COPYING3. If not see
17 # <http://www.gnu.org/licenses/>.
19 # Targets using soft-fp should define the following variables:
21 # softfp_float_modes: a list of soft-float floating-point modes,
23 # softfp_int_modes: a list of integer modes for which to define conversions,
25 # softfp_extensions: a list of extensions between floating-point modes,
27 # softfp_truncations: a list of truncations between floating-point modes,
30 # Extensions and truncations should include those where only one mode
31 # is a soft-float mode; for example, sftf where sf is hard-float and
34 # If the libgcc2.c functions should not be replaced, also define:
36 # softfp_exclude_libgcc2 := y
38 # Avoiding replacing the libgcc2.c functions is a temporary measure
39 # for targets with both hard-float and soft-float multilibs, since
40 # these variables apply for all multilibs. With toplevel libgcc,
41 # soft-fp can be used conditionally on the multilib instead.
43 # If the code should not be compiled at all for some multilibs, define:
45 # softfp_wrap_start: text to put at the start of wrapper source files,
47 # e.g. '#ifndef __powerpc64__'
48 # softfp_wrap_end: text to put at the end of wrapper source files,
51 # This is another temporary measure.
53 softfp_float_funcs = add$(m)3 div$(m)3 eq$(m)2 ge$(m)2 le$(m)2 mul$(m)3 \
54 neg$(m)2 sub$(m)3 unord$(m)2
55 softfp_floatint_funcs = fix$(m)$(i) fixuns$(m)$(i) \
56 float$(i)$(m) floatun$(i)$(m)
59 $(foreach m,$(softfp_float_modes), \
60 $(softfp_float_funcs) \
61 $(foreach i,$(softfp_int_modes), \
62 $(softfp_floatint_funcs))) \
63 $(foreach e,$(softfp_extensions),extend$(e)2) \
64 $(foreach t,$(softfp_truncations),trunc$(t)2)
66 ifeq ($(softfp_exclude_libgcc2),y)
67 # This list is taken from mklibgcc.in and doesn't presently allow for
68 # 64-bit targets where si should become di and di should become ti.
69 softfp_func_list := $(filter-out floatdidf floatdisf fixunsdfsi fixunssfsi \
70 fixunsdfdi fixdfdi fixunssfdi fixsfdi fixxfdi fixunsxfdi \
71 floatdixf fixunsxfsi fixtfdi fixunstfdi floatditf \
72 floatundidf floatundisf floatundixf floatunditf,$(softfp_func_list))
75 ifeq ($(softfp_wrap_start),)
77 $(addsuffix .c,$(addprefix $(srcdir)/soft-fp/,$(softfp_func_list)))
79 softfp_file_list := $(addsuffix .c,$(softfp_func_list))
82 echo $(softfp_wrap_start) > $@
83 echo '#include "soft-fp/$@"' >> $@
84 echo $(softfp_wrap_end) >> $@
87 # Disable missing prototype and type limit warnings. The prototypes
88 # for the functions in the soft-fp files have not been brought across
91 soft-fp-objects-base = $(basename $(notdir $(softfp_file_list)))
93 soft-fp-objects = $(addsuffix $(objext), $(soft-fp-objects-base)) \
94 $(addsuffix _s$(objext), $(soft-fp-objects-base))
96 $(soft-fp-objects) : INTERNAL_CFLAGS += -Wno-missing-prototypes -Wno-type-limits
98 LIB2ADD += $(softfp_file_list)
100 ifneq ($(softfp_exclude_libgcc2),y)
101 # Functions in libgcc2.c are excluded for each soft-float mode (a
102 # target may have both soft-float and hard-float modes), for the fixed
103 # list of integer modes (si and di) for which libgcc2.c defines any
104 # such functions. Depending on the target, the si and di symbols may
105 # in fact define di and ti functions.
107 LIB2FUNCS_EXCLUDE += \
108 $(addprefix _,$(foreach m,$(softfp_float_modes), \
110 $(softfp_floatint_funcs))))