Skip to content

Commit

Permalink
Remove no-longer-needed fp-bit target macros.
Browse files Browse the repository at this point in the history
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.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215013 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
jsm28 committed Sep 8, 2014
1 parent 21cf8b7 commit 2aeea85
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 102 deletions.
12 changes: 12 additions & 0 deletions gcc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
2014-09-08 Joseph Myers <joseph@codesourcery.com>

* 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 <rguenther@suse.de>

PR bootstrap/63204
Expand Down
3 changes: 0 additions & 3 deletions gcc/config/arm/arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions gcc/config/cris/cris.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
8 changes: 0 additions & 8 deletions gcc/defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 0 additions & 21 deletions gcc/doc/tm.texi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 0 additions & 21 deletions gcc/doc/tm.texi.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion gcc/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
5 changes: 5 additions & 0 deletions libgcc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2014-09-08 Joseph Myers <joseph@codesourcery.com>

* fp-bit.c (pack_d, unpack_d): Remove LARGEST_EXPONENT_IS_NORMAL
and ROUND_TOWARDS_ZERO conditionals.

2014-09-07 Nathan sidwell <nathan@acm.org>

* libgcov-interface.c (STRONG_ALIAS): Rename to ...
Expand Down
60 changes: 20 additions & 40 deletions libgcc/fp-bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down Expand Up @@ -291,44 +283,33 @@ 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;
}
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;
}
}

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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))
{
Expand Down Expand Up @@ -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))
{
Expand Down

0 comments on commit 2aeea85

Please sign in to comment.