diff options
Diffstat (limited to 'libgcc/config')
-rw-r--r-- | libgcc/config/avr/avr-lib.h | 6 | ||||
-rw-r--r-- | libgcc/config/h8300/h8300-lib.h | 7 | ||||
-rw-r--r-- | libgcc/config/mips/t-irix6 | 12 | ||||
-rw-r--r-- | libgcc/config/mips/t-mips | 4 | ||||
-rw-r--r-- | libgcc/config/mips/t-sdemtk | 3 | ||||
-rw-r--r-- | libgcc/config/mips/t-tpbit | 4 | ||||
-rw-r--r-- | libgcc/config/rs6000/ppc64-fp.c | 239 | ||||
-rw-r--r-- | libgcc/config/rs6000/t-darwin | 2 | ||||
-rw-r--r-- | libgcc/config/rs6000/t-ppc64-fp | 2 | ||||
-rw-r--r-- | libgcc/config/rx/rx-lib.h | 6 | ||||
-rw-r--r-- | libgcc/config/rx/t-rx | 20 | ||||
-rw-r--r-- | libgcc/config/sparc/t-softfp | 29 | ||||
-rw-r--r-- | libgcc/config/spu/t-elf | 3 | ||||
-rw-r--r-- | libgcc/config/t-fdpbit | 2 | ||||
-rw-r--r-- | libgcc/config/t-fpbit | 2 |
15 files changed, 285 insertions, 56 deletions
diff --git a/libgcc/config/avr/avr-lib.h b/libgcc/config/avr/avr-lib.h new file mode 100644 index 00000000000..daca4d81f9a --- /dev/null +++ b/libgcc/config/avr/avr-lib.h @@ -0,0 +1,6 @@ +#ifdef FLOAT +#define CMPtype QItype +#define DF SF +#define DI SI +typedef int QItype __attribute__ ((mode (QI))); +#endif diff --git a/libgcc/config/h8300/h8300-lib.h b/libgcc/config/h8300/h8300-lib.h new file mode 100644 index 00000000000..cff664a54ce --- /dev/null +++ b/libgcc/config/h8300/h8300-lib.h @@ -0,0 +1,7 @@ +#ifdef FLOAT +#ifdef __H8300__ +#define CMPtype HItype +#else +#define CMPtype SItype +#endif +#endif diff --git a/libgcc/config/mips/t-irix6 b/libgcc/config/mips/t-irix6 index 77dd41da276..c9bd3cdcb0a 100644 --- a/libgcc/config/mips/t-irix6 +++ b/libgcc/config/mips/t-irix6 @@ -22,15 +22,3 @@ irix-crti.o: $(srcdir)/config/mips/irix-crti.S irix-crtn.o: $(srcdir)/config/mips/irix-crtn.S $(crt_compile) -c $< - -TPBIT = tp-bit.c - -$(gcc_objdir)/tp-bit.c: $(gcc_srcdir)/config/fp-bit.c - echo '#ifdef __MIPSEL__' > $@ - echo '# define FLOAT_BIT_ORDER_MISMATCH' >> $@ - echo '#endif' >> $@ - echo '#define QUIET_NAN_NEGATED' >> $@ - echo '#if __LDBL_MANT_DIG__ == 106' >> $@ - echo '# define TFLOAT' >> $@ - cat $< >> $@ - echo '#endif' >> $@ diff --git a/libgcc/config/mips/t-mips b/libgcc/config/mips/t-mips new file mode 100644 index 00000000000..b7d13b3ddb3 --- /dev/null +++ b/libgcc/config/mips/t-mips @@ -0,0 +1,4 @@ +FPBIT = true +FPBIT_CFLAGS = -DQUIET_NAN_NEGATED +DPBIT = true +DPBIT_CFLAGS = -DQUIET_NAN_NEGATED diff --git a/libgcc/config/mips/t-sdemtk b/libgcc/config/mips/t-sdemtk new file mode 100644 index 00000000000..a06e828b545 --- /dev/null +++ b/libgcc/config/mips/t-sdemtk @@ -0,0 +1,3 @@ +# Don't build FPBIT and DPBIT; we'll be using the SDE soft-float library. +FPBIT = +DPBIT = diff --git a/libgcc/config/mips/t-tpbit b/libgcc/config/mips/t-tpbit new file mode 100644 index 00000000000..1670ef3ffd6 --- /dev/null +++ b/libgcc/config/mips/t-tpbit @@ -0,0 +1,4 @@ +ifeq ($(long_double_type_size),128) +TPBIT = true +TPBIT_CFLAGS = -DQUIET_NAN_NEGATED +endif diff --git a/libgcc/config/rs6000/ppc64-fp.c b/libgcc/config/rs6000/ppc64-fp.c new file mode 100644 index 00000000000..ab18d2d94b5 --- /dev/null +++ b/libgcc/config/rs6000/ppc64-fp.c @@ -0,0 +1,239 @@ +/* Functions needed for soft-float on powerpc64-linux, copied from + libgcc2.c with macros expanded to force the use of specific types. + + Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001, 2002, 2003, 2004, 2006, 2009, 2011 + Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +Under Section 7 of GPL version 3, you are granted additional +permissions described in the GCC Runtime Library Exception, version +3.1, as published by the Free Software Foundation. + +You should have received a copy of the GNU General Public License and +a copy of the GCC Runtime Library Exception along with this program; +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +<http://www.gnu.org/licenses/>. */ + +#if defined(__powerpc64__) || defined (__64BIT__) || defined(__ppc64__) +#define TMODES +#include "fp-bit.h" + +extern DItype __fixtfdi (TFtype); +extern DItype __fixdfdi (DFtype); +extern DItype __fixsfdi (SFtype); +extern USItype __fixunsdfsi (DFtype); +extern USItype __fixunssfsi (SFtype); +extern TFtype __floatditf (DItype); +extern TFtype __floatunditf (UDItype); +extern DFtype __floatdidf (DItype); +extern DFtype __floatundidf (UDItype); +extern SFtype __floatdisf (DItype); +extern SFtype __floatundisf (UDItype); +extern DItype __fixunstfdi (TFtype); + +static DItype local_fixunssfdi (SFtype); +static DItype local_fixunsdfdi (DFtype); + +DItype +__fixtfdi (TFtype a) +{ + if (a < 0) + return - __fixunstfdi (-a); + return __fixunstfdi (a); +} + +DItype +__fixdfdi (DFtype a) +{ + if (a < 0) + return - local_fixunsdfdi (-a); + return local_fixunsdfdi (a); +} + +DItype +__fixsfdi (SFtype a) +{ + if (a < 0) + return - local_fixunssfdi (-a); + return local_fixunssfdi (a); +} + +USItype +__fixunsdfsi (DFtype a) +{ + if (a >= - (DFtype) (- ((SItype)(((USItype)1 << ((4 * 8) - 1)) - 1)) - 1)) + return (SItype) (a + (- ((SItype)(((USItype)1 << ((4 * 8) - 1)) - 1)) - 1)) + - (- ((SItype)(((USItype)1 << ((4 * 8) - 1)) - 1)) - 1); + return (SItype) a; +} + +USItype +__fixunssfsi (SFtype a) +{ + if (a >= - (SFtype) (- ((SItype)(((USItype)1 << ((4 * 8) - 1)) - 1)) - 1)) + return (SItype) (a + (- ((SItype)(((USItype)1 << ((4 * 8) - 1)) - 1)) - 1)) + - (- ((SItype)(((USItype)1 << ((4 * 8) - 1)) - 1)) - 1); + return (SItype) a; +} + +TFtype +__floatditf (DItype u) +{ + DFtype dh, dl; + + dh = (SItype) (u >> (sizeof (SItype) * 8)); + dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); + dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); + + return (TFtype) dh + (TFtype) dl; +} + +TFtype +__floatunditf (UDItype u) +{ + DFtype dh, dl; + + dh = (USItype) (u >> (sizeof (SItype) * 8)); + dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); + dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); + + return (TFtype) dh + (TFtype) dl; +} + +DFtype +__floatdidf (DItype u) +{ + DFtype d; + + d = (SItype) (u >> (sizeof (SItype) * 8)); + d *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); + d += (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); + + return d; +} + +DFtype +__floatundidf (UDItype u) +{ + DFtype d; + + d = (USItype) (u >> (sizeof (SItype) * 8)); + d *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); + d += (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); + + return d; +} + +SFtype +__floatdisf (DItype u) +{ + DFtype f; + + if (53 < (sizeof (DItype) * 8) + && 53 > ((sizeof (DItype) * 8) - 53 + 24)) + { + if (! (- ((DItype) 1 << 53) < u + && u < ((DItype) 1 << 53))) + { + if ((UDItype) u & (((UDItype) 1 << ((sizeof (DItype) * 8) - 53)) - 1)) + { + u &= ~ (((UDItype) 1 << ((sizeof (DItype) * 8) - 53)) - 1); + u |= ((UDItype) 1 << ((sizeof (DItype) * 8) - 53)); + } + } + } + f = (SItype) (u >> (sizeof (SItype) * 8)); + f *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); + f += (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); + + return (SFtype) f; +} + +SFtype +__floatundisf (UDItype u) +{ + DFtype f; + + if (53 < (sizeof (DItype) * 8) + && 53 > ((sizeof (DItype) * 8) - 53 + 24)) + { + if (u >= ((UDItype) 1 << 53)) + { + if ((UDItype) u & (((UDItype) 1 << ((sizeof (DItype) * 8) - 53)) - 1)) + { + u &= ~ (((UDItype) 1 << ((sizeof (DItype) * 8) - 53)) - 1); + u |= ((UDItype) 1 << ((sizeof (DItype) * 8) - 53)); + } + } + } + f = (USItype) (u >> (sizeof (SItype) * 8)); + f *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); + f += (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); + + return (SFtype) f; +} + +DItype +__fixunstfdi (TFtype a) +{ + if (a < 0) + return 0; + + /* Compute high word of result, as a flonum. */ + const TFtype b = (a / (((UDItype) 1) << (sizeof (SItype) * 8))); + /* Convert that to fixed (but not to DItype!), + and shift it into the high word. */ + UDItype v = (USItype) b; + v <<= (sizeof (SItype) * 8); + /* Remove high part from the TFtype, leaving the low part as flonum. */ + a -= (TFtype) v; + /* Convert that to fixed (but not to DItype!) and add it in. + Sometimes A comes out negative. This is significant, since + A has more bits than a long int does. */ + if (a < 0) + v -= (USItype) (-a); + else + v += (USItype) a; + return v; +} + +/* This version is needed to prevent recursion; fixunsdfdi in libgcc + calls fixdfdi, which in turn calls calls fixunsdfdi. */ + +static DItype +local_fixunsdfdi (DFtype a) +{ + USItype hi, lo; + + hi = a / (((UDItype) 1) << (sizeof (SItype) * 8)); + lo = (a - ((DFtype) hi) * (((UDItype) 1) << (sizeof (SItype) * 8))); + return ((UDItype) hi << (sizeof (SItype) * 8)) | lo; +} + +/* This version is needed to prevent recursion; fixunssfdi in libgcc + calls fixsfdi, which in turn calls calls fixunssfdi. */ + +static DItype +local_fixunssfdi (SFtype original_a) +{ + DFtype a = original_a; + USItype hi, lo; + + hi = a / (((UDItype) 1) << (sizeof (SItype) * 8)); + lo = (a - ((DFtype) hi) * (((UDItype) 1) << (sizeof (SItype) * 8))); + return ((UDItype) hi << (sizeof (SItype) * 8)) | lo; +} + +#endif /* __powerpc64__ */ diff --git a/libgcc/config/rs6000/t-darwin b/libgcc/config/rs6000/t-darwin index 404df85870f..4464fd7d6e6 100644 --- a/libgcc/config/rs6000/t-darwin +++ b/libgcc/config/rs6000/t-darwin @@ -3,6 +3,8 @@ DARWIN_EXTRA_CRT_BUILD_CFLAGS = -mlongcall -mmacosx-version-min=10.4 crt2.o: $(srcdir)/config/rs6000/darwin-crt2.c $(crt_compile) $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) -c $< +LIB2ADD += $(srcdir)/config/rs6000/ppc64-fp.c + LIB2ADDEH += $(srcdir)/config/rs6000/darwin-fallback.c SHLIB_VERPFX = $(gcc_srcdir)/config/rs6000/darwin-libgcc diff --git a/libgcc/config/rs6000/t-ppc64-fp b/libgcc/config/rs6000/t-ppc64-fp new file mode 100644 index 00000000000..26d1730bcdb --- /dev/null +++ b/libgcc/config/rs6000/t-ppc64-fp @@ -0,0 +1,2 @@ +# Can be used unconditionally, wrapped in __powerpc64__ || __64BIT__ __ppc64__. +LIB2ADD += $(srcdir)/config/rs6000/ppc64-fp.c diff --git a/libgcc/config/rx/rx-lib.h b/libgcc/config/rx/rx-lib.h new file mode 100644 index 00000000000..fb1d14632a6 --- /dev/null +++ b/libgcc/config/rx/rx-lib.h @@ -0,0 +1,6 @@ +#ifdef FLOAT +#ifndef __RX_64BIT_DOUBLES__ +#define DF SF +#define FLOAT_ONLY +#endif +#endif diff --git a/libgcc/config/rx/t-rx b/libgcc/config/rx/t-rx index 1e66af0c8d3..3ca7dc069fa 100644 --- a/libgcc/config/rx/t-rx +++ b/libgcc/config/rx/t-rx @@ -1,5 +1,5 @@ # Makefile fragment for building LIBGCC for the Renesas RX target. -# Copyright (C) 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 2008, 2009, 2011 Free Software Foundation, Inc. # Contributed by Red Hat. # # This file is part of GCC. @@ -28,17 +28,7 @@ LIB2ADD = $(srcdir)/config/rx/rx-abi-functions.c # We need special handling of the floating point conversion # routines, to allow for the varying size of a double: -FPBIT = fp-bit.c -$(gcc_objdir)/fp-bit.c: $(gcc_srcdir)/config/fp-bit.c - echo '#define FLOAT' > $@ - echo '#ifndef __RX_64BIT_DOUBLES__' >> $@ - echo '#define DF SF' >> $@ - echo '#define FLOAT_ONLY' >> $@ - echo '#endif' >> $@ - cat $(gcc_srcdir)/config/fp-bit.c >> $@ - -DPBIT = dp-bit.c -$(gcc_objdir)/dp-bit.c: $(gcc_srcdir)/config/fp-bit.c - echo '#ifdef __RX_64BIT_DOUBLES__' > $@ - cat $(gcc_srcdir)/config/fp-bit.c >> $@ - echo '#endif' >> $@ +FPBIT = true +ifeq ($(double_type_size),64) +DPBIT = true +endif diff --git a/libgcc/config/sparc/t-softfp b/libgcc/config/sparc/t-softfp deleted file mode 100644 index 94dfcfae0a1..00000000000 --- a/libgcc/config/sparc/t-softfp +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (C) 2010, 2011 Free Software Foundation, Inc. -# -# This file is part of GCC. -# -# GCC is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GCC is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GCC; see the file COPYING3. If not see -# <http://www.gnu.org/licenses/>. - -# We want fine grained libraries, so use the new code to build the -# floating point emulation libraries. -FPBIT = fp-bit.c -DPBIT = dp-bit.c - -$(gcc_objdir)/dp-bit.c: $(gcc_srcdir)/config/fp-bit.c - cat $< > $@ - -$(gcc_objdir)/fp-bit.c: $(gcc_srcdir)/config/fp-bit.c - echo '#define FLOAT' > $@ - cat $< >> $@ diff --git a/libgcc/config/spu/t-elf b/libgcc/config/spu/t-elf new file mode 100644 index 00000000000..7094da526bb --- /dev/null +++ b/libgcc/config/spu/t-elf @@ -0,0 +1,3 @@ +# We provide our own version of __divdf3 that performs better and has +# better support for non-default rounding modes. +DPBIT_FUNCS := $(filter-out _div_df, $(DPBIT_FUNCS)) diff --git a/libgcc/config/t-fdpbit b/libgcc/config/t-fdpbit new file mode 100644 index 00000000000..0e7119adeaf --- /dev/null +++ b/libgcc/config/t-fdpbit @@ -0,0 +1,2 @@ +FPBIT = true +DPBIT = true diff --git a/libgcc/config/t-fpbit b/libgcc/config/t-fpbit new file mode 100644 index 00000000000..e56e34d91c8 --- /dev/null +++ b/libgcc/config/t-fpbit @@ -0,0 +1,2 @@ +FPBIT = true +FPBIT_CFLAGS = -DFLOAT_ONLY -DSMALL_MACHINE |