From: Richard Sandiford Date: Mon, 21 Mar 2005 07:22:22 +0000 (+0000) Subject: libgcc2.h (LIBGCC2_HAS_SF_MODE): New macro. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cfa7bd9ca274bd8411558dee28375a83c965d0a6;p=gcc.git libgcc2.h (LIBGCC2_HAS_SF_MODE): New macro. * libgcc2.h (LIBGCC2_HAS_SF_MODE): New macro. (LIBGCC2_HAS_DF_MODE, LIBGCC2_HAS_TF_MODE, LIBGCC2_HAS_XF_MODE): Make the defaults false if BITS_PER_UNIT != 8. (SFtype, SCtype, __fixsfdi, __floatdisf, __fixunssfSI, __fixunssfDI) (__powisf2, __divsc3, __mulsc3): Guard with LIBGCC2_HAS_SF_MODE rather than BITS_PER_UNIT != 8. (L_fixdfdi, L_fixsfdi, L_fixtfdi, L_fixunsdfdi, L_fixunsdfsi) (L_fixunssfdi, L_fixunssfsi, L_fixunstfdi, L_fixunsxfdi, L_fixunsxfsi) (L_fixxfdi, L_floatdidf, L_floatdisf, L_floatditf, L_floatdixf): Remove #undefs. * libgcc2.c (__fixunssfDI, __fixsfdi, __floatdisf, __fixunssfSI) (__powisf2, __divsc3, __mulsc3): Guard with LIBGCC2_HAS_SF_MODE. From-SVN: r96778 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cf4a6c92cbd..ec5f53a84f8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2005-03-21 Richard Sandiford + + * libgcc2.h (LIBGCC2_HAS_SF_MODE): New macro. + (LIBGCC2_HAS_DF_MODE, LIBGCC2_HAS_TF_MODE, LIBGCC2_HAS_XF_MODE): Make + the defaults false if BITS_PER_UNIT != 8. + (SFtype, SCtype, __fixsfdi, __floatdisf, __fixunssfSI, __fixunssfDI) + (__powisf2, __divsc3, __mulsc3): Guard with LIBGCC2_HAS_SF_MODE rather + than BITS_PER_UNIT != 8. + (L_fixdfdi, L_fixsfdi, L_fixtfdi, L_fixunsdfdi, L_fixunsdfsi) + (L_fixunssfdi, L_fixunssfsi, L_fixunstfdi, L_fixunsxfdi, L_fixunsxfsi) + (L_fixxfdi, L_floatdidf, L_floatdisf, L_floatditf, L_floatdixf): Remove + #undefs. + * libgcc2.c (__fixunssfDI, __fixsfdi, __floatdisf, __fixunssfSI) + (__powisf2, __divsc3, __mulsc3): Guard with LIBGCC2_HAS_SF_MODE. + 2005-03-20 Roger Sayle PR middle-end/20539 diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c index 68623c37122..c8f6e51b043 100644 --- a/gcc/libgcc2.c +++ b/gcc/libgcc2.c @@ -1256,7 +1256,7 @@ __fixdfdi (DFtype a) } #endif -#ifdef L_fixunssfdi +#if defined(L_fixunssfdi) && LIBGCC2_HAS_SF_MODE DWtype __fixunssfDI (SFtype a) { @@ -1320,7 +1320,7 @@ __fixunssfDI (SFtype a) } #endif -#ifdef L_fixsfdi +#if defined(L_fixsfdi) && LIBGCC2_HAS_SF_MODE DWtype __fixsfdi (SFtype a) { @@ -1363,7 +1363,7 @@ __floatdidf (DWtype u) } #endif -#ifdef L_floatdisf +#if defined(L_floatdisf) && LIBGCC2_HAS_SF_MODE #define DI_SIZE (W_TYPE_SIZE * 2) #define SF_SIZE FLT_MANT_DIG @@ -1495,7 +1495,7 @@ __fixunsdfSI (DFtype a) } #endif -#ifdef L_fixunssfsi +#if defined(L_fixunssfsi) && LIBGCC2_HAS_SF_MODE /* Reenable the normal types, in case limits.h needs them. */ #undef char #undef short @@ -1520,7 +1520,7 @@ __fixunssfSI (SFtype a) /* Integer power helper used from __builtin_powi for non-constant exponents. */ -#if defined(L_powisf2) \ +#if (defined(L_powisf2) && LIBGCC2_HAS_SF_MODE) \ || (defined(L_powidf2) && LIBGCC2_HAS_DF_MODE) \ || (defined(L_powixf2) && LIBGCC2_HAS_XF_MODE) \ || (defined(L_powitf2) && LIBGCC2_HAS_TF_MODE) @@ -1554,7 +1554,7 @@ NAME (TYPE x, Wtype m) #endif -#if defined(L_mulsc3) || defined(L_divsc3) \ +#if ((defined(L_mulsc3) || defined(L_divsc3)) && LIBGCC2_HAS_SF_MODE) \ || ((defined(L_muldc3) || defined(L_divdc3)) && LIBGCC2_HAS_DF_MODE) \ || ((defined(L_mulxc3) || defined(L_divxc3)) && LIBGCC2_HAS_XF_MODE) \ || ((defined(L_multc3) || defined(L_divtc3)) && LIBGCC2_HAS_TF_MODE) diff --git a/gcc/libgcc2.h b/gcc/libgcc2.h index d1df220f9dd..11444ed9e45 100644 --- a/gcc/libgcc2.h +++ b/gcc/libgcc2.h @@ -58,17 +58,25 @@ extern short int __get_eh_table_version (struct exception_descriptor *); #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE LONG_DOUBLE_TYPE_SIZE #endif +#ifndef LIBGCC2_HAS_SF_MODE +#define LIBGCC2_HAS_SF_MODE (BITS_PER_UNIT == 8) +#endif + #ifndef LIBGCC2_HAS_DF_MODE #define LIBGCC2_HAS_DF_MODE \ - (LIBGCC2_DOUBLE_TYPE_SIZE == 64 || LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 64) + (BITS_PER_UNIT == 8 \ + && (LIBGCC2_DOUBLE_TYPE_SIZE == 64 \ + || LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 64)) #endif #ifndef LIBGCC2_HAS_XF_MODE -#define LIBGCC2_HAS_XF_MODE (LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 80) +#define LIBGCC2_HAS_XF_MODE \ + (BITS_PER_UNIT == 8 && LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 80) #endif #ifndef LIBGCC2_HAS_TF_MODE -#define LIBGCC2_HAS_TF_MODE (LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 128) +#define LIBGCC2_HAS_TF_MODE \ + (BITS_PER_UNIT == 8 && LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 128) #endif #ifndef MIN_UNITS_PER_WORD @@ -104,11 +112,10 @@ typedef unsigned int UTItype __attribute__ ((mode (TI))); #endif #endif -#if BITS_PER_UNIT == 8 - +#if LIBGCC2_HAS_SF_MODE typedef float SFtype __attribute__ ((mode (SF))); typedef _Complex float SCtype __attribute__ ((mode (SC))); - +#endif #if LIBGCC2_HAS_DF_MODE typedef float DFtype __attribute__ ((mode (DF))); typedef _Complex float DCtype __attribute__ ((mode (DC))); @@ -122,29 +129,6 @@ typedef float TFtype __attribute__ ((mode (TF))); typedef _Complex float TCtype __attribute__ ((mode (TC))); #endif -#else /* BITS_PER_UNIT != 8 */ - -/* On dsp's there are usually qf/hf/tqf modes used instead of the above. - For now we don't support them in libgcc2.c. */ - -#undef L_fixdfdi -#undef L_fixsfdi -#undef L_fixtfdi -#undef L_fixunsdfdi -#undef L_fixunsdfsi -#undef L_fixunssfdi -#undef L_fixunssfsi -#undef L_fixunstfdi -#undef L_fixunsxfdi -#undef L_fixunsxfsi -#undef L_fixxfdi -#undef L_floatdidf -#undef L_floatdisf -#undef L_floatditf -#undef L_floatdixf - -#endif /* BITS_PER_UNIT != 8 */ - typedef int word_type __attribute__ ((mode (__word__))); /* Make sure that we don't accidentally use any normal C language built-in @@ -330,7 +314,7 @@ extern SItype __mulvsi3 (SItype, SItype); extern SItype __negvsi2 (SItype); #endif /* COMPAT_SIMODE_TRAPPING_ARITHMETIC */ -#if BITS_PER_UNIT == 8 +#if LIBGCC2_HAS_SF_MODE extern DWtype __fixsfdi (SFtype); extern SFtype __floatdisf (DWtype); extern UWtype __fixunssfSI (SFtype); @@ -338,7 +322,7 @@ extern DWtype __fixunssfDI (SFtype); extern SFtype __powisf2 (SFtype, Wtype); extern SCtype __divsc3 (SFtype, SFtype, SFtype, SFtype); extern SCtype __mulsc3 (SFtype, SFtype, SFtype, SFtype); - +#endif #if LIBGCC2_HAS_DF_MODE extern DWtype __fixdfdi (DFtype); extern DFtype __floatdidf (DWtype); @@ -367,7 +351,6 @@ extern TFtype __powitf2 (TFtype, Wtype); extern TCtype __divtc3 (TFtype, TFtype, TFtype, TFtype); extern TCtype __multc3 (TFtype, TFtype, TFtype, TFtype); #endif -#endif /* BITS_PER_UNIT == 8 */ /* DWstructs are pairs of Wtype values in the order determined by LIBGCC2_WORDS_BIG_ENDIAN. */