From 9686a2e668aad033ef12b48c2d1e7f1ce6796838 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 8 Sep 2014 13:22:56 +0100 Subject: [PATCH] Remove no-longer-needed fp-bit target macros. gcc: * defaults.h (LARGEST_EXPONENT_IS_NORMAL, ROUND_TOWARDS_ZERO): Remove. * doc/tm.texi.in (ROUND_TOWARDS_ZERO, LARGEST_EXPONENT_IS_NORMAL): Remove. * doc/tm.texi: Regenerate. * system.h (LARGEST_EXPONENT_IS_NORMAL, ROUND_TOWARDS_ZERO): Poison. * config/arm/arm.h (LARGEST_EXPONENT_IS_NORMAL): Remove. * config/cris/cris.h (__make_dp): Remove. libgcc: * fp-bit.c (pack_d, unpack_d): Remove LARGEST_EXPONENT_IS_NORMAL and ROUND_TOWARDS_ZERO conditionals. From-SVN: r215013 --- gcc/ChangeLog | 12 +++++++++ gcc/config/arm/arm.h | 3 --- gcc/config/cris/cris.h | 8 ------ gcc/defaults.h | 8 ------ gcc/doc/tm.texi | 21 --------------- gcc/doc/tm.texi.in | 21 --------------- gcc/system.h | 3 ++- libgcc/ChangeLog | 5 ++++ libgcc/fp-bit.c | 60 ++++++++++++++---------------------------- 9 files changed, 39 insertions(+), 102 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f25d4e45915..4d882a16691 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2014-09-08 Joseph Myers + + * defaults.h (LARGEST_EXPONENT_IS_NORMAL, ROUND_TOWARDS_ZERO): + Remove. + * doc/tm.texi.in (ROUND_TOWARDS_ZERO, LARGEST_EXPONENT_IS_NORMAL): + Remove. + * doc/tm.texi: Regenerate. + * system.h (LARGEST_EXPONENT_IS_NORMAL, ROUND_TOWARDS_ZERO): + Poison. + * config/arm/arm.h (LARGEST_EXPONENT_IS_NORMAL): Remove. + * config/cris/cris.h (__make_dp): Remove. + 2014-09-08 Richard Biener PR bootstrap/63204 diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 96e8626c5cf..ff4ddace2b5 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -440,9 +440,6 @@ extern int arm_fpu_attr; #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT #endif -#define LARGEST_EXPONENT_IS_NORMAL(bits) \ - ((bits) == 16 && arm_fp16_format == ARM_FP16_FORMAT_ALTERNATIVE) - #ifndef ARM_DEFAULT_ABI #define ARM_DEFAULT_ABI ARM_ABI_APCS #endif diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h index 12b1ea88b05..fb8ec933cbd 100644 --- a/gcc/config/cris/cris.h +++ b/gcc/config/cris/cris.h @@ -80,14 +80,6 @@ along with GCC; see the file COPYING3. If not see /* Which CPU version this is. The parsed and adjusted cris_cpu_str. */ extern int cris_cpu_version; -/* Changing the order used to be necessary to put the fourth __make_dp - argument (a DImode parameter) in registers, to fit with the libfunc - parameter passing scheme used for intrinsic functions. FIXME: Check - performance. */ -#ifdef IN_LIBGCC2 -#define __make_dp(a,b,c,d) __cris_make_dp(d,a,b,c) -#endif - /* Node: Driver */ diff --git a/gcc/defaults.h b/gcc/defaults.h index 1a9950dd4f6..c1776b05690 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -926,14 +926,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define PREFERRED_DEBUGGING_TYPE NO_DEBUG #endif -#ifndef LARGEST_EXPONENT_IS_NORMAL -#define LARGEST_EXPONENT_IS_NORMAL(SIZE) 0 -#endif - -#ifndef ROUND_TOWARDS_ZERO -#define ROUND_TOWARDS_ZERO 0 -#endif - #ifndef FLOAT_LIB_COMPARE_RETURNS_BOOL #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) false #endif diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 94964771d52..904ee5af3ef 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -1341,27 +1341,6 @@ Return machine mode to be used for @code{_Unwind_Word} type. The default is to use @code{word_mode}. @end deftypefn -@defmac ROUND_TOWARDS_ZERO -If defined, this macro should be true if the prevailing rounding -mode is towards zero. - -Defining this macro only affects the way @file{libgcc.a} emulates -floating-point arithmetic. - -Not defining this macro is equivalent to returning zero. -@end defmac - -@defmac LARGEST_EXPONENT_IS_NORMAL (@var{size}) -This macro should return true if floats with @var{size} -bits do not have a NaN or infinity representation, but use the largest -exponent for normal numbers instead. - -Defining this macro only affects the way @file{libgcc.a} emulates -floating-point arithmetic. - -The default definition of this macro returns false for all sizes. -@end defmac - @deftypefn {Target Hook} bool TARGET_MS_BITFIELD_LAYOUT_P (const_tree @var{record_type}) This target hook returns @code{true} if bit-fields in the given @var{record_type} are to be laid out following the rules of Microsoft diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 152d37d8f55..50d1ac1cff8 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -1255,27 +1255,6 @@ pattern needs to support both a 32- and a 64-bit mode. @hook TARGET_UNWIND_WORD_MODE -@defmac ROUND_TOWARDS_ZERO -If defined, this macro should be true if the prevailing rounding -mode is towards zero. - -Defining this macro only affects the way @file{libgcc.a} emulates -floating-point arithmetic. - -Not defining this macro is equivalent to returning zero. -@end defmac - -@defmac LARGEST_EXPONENT_IS_NORMAL (@var{size}) -This macro should return true if floats with @var{size} -bits do not have a NaN or infinity representation, but use the largest -exponent for normal numbers instead. - -Defining this macro only affects the way @file{libgcc.a} emulates -floating-point arithmetic. - -The default definition of this macro returns false for all sizes. -@end defmac - @hook TARGET_MS_BITFIELD_LAYOUT_P @hook TARGET_DECIMAL_FLOAT_SUPPORTED_P diff --git a/gcc/system.h b/gcc/system.h index a2c8f7767cd..a1e89f4fb22 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -934,7 +934,8 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; REG_CLASS_FROM_CONSTRAINT REG_CLASS_FOR_CONSTRAINT \ EXTRA_CONSTRAINT_STR EXTRA_MEMORY_CONSTRAINT \ EXTRA_ADDRESS_CONSTRAINT CONST_DOUBLE_OK_FOR_CONSTRAINT_P \ - CALLER_SAVE_PROFITABLE + CALLER_SAVE_PROFITABLE LARGEST_EXPONENT_IS_NORMAL \ + ROUND_TOWARDS_ZERO /* Hooks that are no longer used. */ #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \ diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 4ab05ef8f94..8133025a648 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2014-09-08 Joseph Myers + + * fp-bit.c (pack_d, unpack_d): Remove LARGEST_EXPONENT_IS_NORMAL + and ROUND_TOWARDS_ZERO conditionals. + 2014-09-07 Nathan sidwell * libgcov-interface.c (STRONG_ALIAS): Rename to ... diff --git a/libgcc/fp-bit.c b/libgcc/fp-bit.c index 4155fae28ca..5f67e07d57a 100644 --- a/libgcc/fp-bit.c +++ b/libgcc/fp-bit.c @@ -202,15 +202,7 @@ pack_d (const fp_number_type *src) int sign = src->sign; int exp = 0; - if (LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) && (isnan (src) || isinf (src))) - { - /* We can't represent these values accurately. By using the - largest possible magnitude, we guarantee that the conversion - of infinity is at least as big as any finite number. */ - exp = EXPMAX; - fraction = ((fractype) 1 << FRACBITS) - 1; - } - else if (isnan (src)) + if (isnan (src)) { exp = EXPMAX; /* Restore the NaN's payload. */ @@ -291,8 +283,7 @@ pack_d (const fp_number_type *src) fraction >>= NGARDS; #endif /* NO_DENORMALS */ } - else if (!LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) - && __builtin_expect (src->normal_exp > EXPBIAS, 0)) + else if (__builtin_expect (src->normal_exp > EXPBIAS, 0)) { exp = EXPMAX; fraction = 0; @@ -300,35 +291,25 @@ pack_d (const fp_number_type *src) else { exp = src->normal_exp + EXPBIAS; - if (!ROUND_TOWARDS_ZERO) + /* IF the gard bits are the all zero, but the first, then we're + half way between two numbers, choose the one which makes the + lsb of the answer 0. */ + if ((fraction & GARDMASK) == GARDMSB) { - /* IF the gard bits are the all zero, but the first, then we're - half way between two numbers, choose the one which makes the - lsb of the answer 0. */ - if ((fraction & GARDMASK) == GARDMSB) - { - if (fraction & (1 << NGARDS)) - fraction += GARDROUND + 1; - } - else - { - /* Add a one to the guards to round up */ - fraction += GARDROUND; - } - if (fraction >= IMPLICIT_2) - { - fraction >>= 1; - exp += 1; - } + if (fraction & (1 << NGARDS)) + fraction += GARDROUND + 1; } - fraction >>= NGARDS; - - if (LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) && exp > EXPMAX) + else + { + /* Add a one to the guards to round up */ + fraction += GARDROUND; + } + if (fraction >= IMPLICIT_2) { - /* Saturate on overflow. */ - exp = EXPMAX; - fraction = ((fractype) 1 << FRACBITS) - 1; + fraction >>= 1; + exp += 1; } + fraction >>= NGARDS; } } @@ -556,8 +537,7 @@ unpack_d (FLO_union_type * src, fp_number_type * dst) dst->fraction.ll = fraction; } } - else if (!LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) - && __builtin_expect (exp == EXPMAX, 0)) + else if (__builtin_expect (exp == EXPMAX, 0)) { /* Huge exponent*/ if (fraction == 0) @@ -915,7 +895,7 @@ _fpmul_parts ( fp_number_type * a, low <<= 1; } - if (!ROUND_TOWARDS_ZERO && (high & GARDMASK) == GARDMSB) + if ((high & GARDMASK) == GARDMSB) { if (high & (1 << NGARDS)) { @@ -1035,7 +1015,7 @@ _fpdiv_parts (fp_number_type * a, numerator *= 2; } - if (!ROUND_TOWARDS_ZERO && (quotient & GARDMASK) == GARDMSB) + if ((quotient & GARDMASK) == GARDMSB) { if (quotient & (1 << NGARDS)) { -- 2.30.2