Home | History | Annotate | Line # | Download | only in config
t-softfp revision 1.3
      1  1.3  mrg # Copyright (C) 2006-2013 Free Software Foundation, Inc.
      2  1.3  mrg 
      3  1.3  mrg # This file is part of GCC.
      4  1.3  mrg 
      5  1.3  mrg # GCC is free software; you can redistribute it and/or modify
      6  1.3  mrg # it under the terms of the GNU General Public License as published by
      7  1.3  mrg # the Free Software Foundation; either version 3, or (at your option)
      8  1.3  mrg # any later version.
      9  1.3  mrg 
     10  1.3  mrg # GCC is distributed in the hope that it will be useful,
     11  1.3  mrg # but WITHOUT ANY WARRANTY; without even the implied warranty of
     12  1.3  mrg # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13  1.3  mrg # GNU General Public License for more details.
     14  1.3  mrg 
     15  1.3  mrg # You should have received a copy of the GNU General Public License
     16  1.3  mrg # along with GCC; see the file COPYING3.  If not see
     17  1.3  mrg # <http://www.gnu.org/licenses/>.
     18  1.3  mrg 
     19  1.3  mrg # Targets using soft-fp should define the following variables:
     20  1.3  mrg #
     21  1.3  mrg # softfp_float_modes: a list of soft-float floating-point modes,
     22  1.3  mrg #                     e.g. sf df
     23  1.3  mrg # softfp_int_modes: a list of integer modes for which to define conversions,
     24  1.3  mrg #                   e.g. si di
     25  1.3  mrg # softfp_extensions: a list of extensions between floating-point modes,
     26  1.3  mrg #                    e.g. sfdf
     27  1.3  mrg # softfp_truncations: a list of truncations between floating-point modes,
     28  1.3  mrg #                     e.g. dfsf
     29  1.3  mrg #
     30  1.3  mrg # Extensions and truncations should include those where only one mode
     31  1.3  mrg # is a soft-float mode; for example, sftf where sf is hard-float and
     32  1.3  mrg # tf is soft-float.
     33  1.3  mrg #
     34  1.3  mrg # If the libgcc2.c functions should not be replaced, also define:
     35  1.3  mrg #
     36  1.3  mrg # softfp_exclude_libgcc2 := y
     37  1.3  mrg #
     38  1.3  mrg # Avoiding replacing the libgcc2.c functions is a temporary measure
     39  1.3  mrg # for targets with both hard-float and soft-float multilibs, since
     40  1.3  mrg # these variables apply for all multilibs.  With toplevel libgcc,
     41  1.3  mrg # soft-fp can be used conditionally on the multilib instead.
     42  1.3  mrg #
     43  1.3  mrg # If the code should not be compiled at all for some multilibs, define:
     44  1.3  mrg #
     45  1.3  mrg # softfp_wrap_start: text to put at the start of wrapper source files,
     46  1.3  mrg #                    output with echo
     47  1.3  mrg #                    e.g. '#ifndef __powerpc64__'
     48  1.3  mrg # softfp_wrap_end: text to put at the end of wrapper source files,
     49  1.3  mrg #                  e.g. '#endif'
     50  1.3  mrg #
     51  1.3  mrg # This is another temporary measure.
     52  1.3  mrg 
     53  1.3  mrg softfp_float_funcs = add$(m)3 div$(m)3 eq$(m)2 ge$(m)2 le$(m)2 mul$(m)3 \
     54  1.3  mrg   neg$(m)2 sub$(m)3 unord$(m)2
     55  1.3  mrg softfp_floatint_funcs = fix$(m)$(i) fixuns$(m)$(i) \
     56  1.3  mrg   float$(i)$(m) floatun$(i)$(m)
     57  1.3  mrg 
     58  1.3  mrg softfp_func_list := \
     59  1.3  mrg   $(foreach m,$(softfp_float_modes), \
     60  1.3  mrg               $(softfp_float_funcs) \
     61  1.3  mrg               $(foreach i,$(softfp_int_modes), \
     62  1.3  mrg                           $(softfp_floatint_funcs))) \
     63  1.3  mrg   $(foreach e,$(softfp_extensions),extend$(e)2) \
     64  1.3  mrg   $(foreach t,$(softfp_truncations),trunc$(t)2)
     65  1.3  mrg 
     66  1.3  mrg ifeq ($(softfp_exclude_libgcc2),y)
     67  1.3  mrg # This list is taken from mklibgcc.in and doesn't presently allow for
     68  1.3  mrg # 64-bit targets where si should become di and di should become ti.
     69  1.3  mrg softfp_func_list := $(filter-out floatdidf floatdisf fixunsdfsi fixunssfsi \
     70  1.3  mrg   fixunsdfdi fixdfdi fixunssfdi fixsfdi fixxfdi fixunsxfdi \
     71  1.3  mrg   floatdixf fixunsxfsi fixtfdi fixunstfdi floatditf \
     72  1.3  mrg   floatundidf floatundisf floatundixf floatunditf,$(softfp_func_list))
     73  1.3  mrg endif
     74  1.3  mrg 
     75  1.3  mrg ifeq ($(softfp_wrap_start),)
     76  1.3  mrg softfp_file_list := \
     77  1.3  mrg   $(addsuffix .c,$(addprefix $(srcdir)/soft-fp/,$(softfp_func_list)))
     78  1.3  mrg else
     79  1.3  mrg softfp_file_list := $(addsuffix .c,$(softfp_func_list))
     80  1.3  mrg 
     81  1.3  mrg $(softfp_file_list):
     82  1.3  mrg 	echo $(softfp_wrap_start) > $@
     83  1.3  mrg 	echo '#include "soft-fp/$@"' >> $@
     84  1.3  mrg 	echo $(softfp_wrap_end) >> $@
     85  1.3  mrg endif
     86  1.3  mrg 
     87  1.1  mrg # Disable missing prototype and type limit warnings.  The prototypes
     88  1.1  mrg # for the functions in the soft-fp files have not been brought across
     89  1.1  mrg # from glibc.
     90  1.1  mrg 
     91  1.3  mrg soft-fp-objects = $(addsuffix $(objext), $(softfp_file_list)) \
     92  1.3  mrg   $(addsuffix _s$(objext), $(softfp_file_list))
     93  1.1  mrg 
     94  1.3  mrg $(soft-fp-objects) : INTERNAL_CFLAGS += -Wno-missing-prototypes -Wno-type-limits
     95  1.3  mrg 
     96  1.3  mrg LIB2ADD += $(softfp_file_list)
     97  1.1  mrg 
     98  1.3  mrg ifneq ($(softfp_exclude_libgcc2),y)
     99  1.3  mrg # Functions in libgcc2.c are excluded for each soft-float mode (a
    100  1.3  mrg # target may have both soft-float and hard-float modes), for the fixed
    101  1.3  mrg # list of integer modes (si and di) for which libgcc2.c defines any
    102  1.3  mrg # such functions.  Depending on the target, the si and di symbols may
    103  1.3  mrg # in fact define di and ti functions.
    104  1.1  mrg 
    105  1.3  mrg LIB2FUNCS_EXCLUDE += \
    106  1.3  mrg   $(addprefix _,$(foreach m,$(softfp_float_modes), \
    107  1.3  mrg                             $(foreach i,si di, \
    108  1.3  mrg                                         $(softfp_floatint_funcs))))
    109  1.3  mrg endif
    110