diff options
-rw-r--r-- | gas/ChangeLog | 7 | ||||
-rw-r--r-- | gas/config/atof-ieee.c | 19 | ||||
-rw-r--r-- | gas/doc/internals.texi | 10 |
3 files changed, 23 insertions, 13 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 57da62d..f0d019c 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2002-04-11 Richard Sandiford <rsandifo@redhat.com> + + * doc/invoke.texi (TC_LARGEST_EXPONENT_IS_NORMAL): Document. + * config/atof-ieee.c (TC_LARGEST_EXPONENT_IS_NORMAL): Add an + argument for the precision. + (gen_to_words): Update accordingly. + 2002-04-10 Alan Modra <amodra@bigpond.net.au> * as.c (parse_args <OPTION_VERSION>): Use VERSION is diff --git a/gas/config/atof-ieee.c b/gas/config/atof-ieee.c index ce6afbb..4459066 100644 --- a/gas/config/atof-ieee.c +++ b/gas/config/atof-ieee.c @@ -19,13 +19,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Some float formats are based on the IEEE standard, but use the - largest exponent for normal numbers instead of NaNs and infinites. - The macro TC_LARGEST_EXPONENT_IS_NORMAL should evaluate to true - if the target machine uses such a format. The macro can depend on - command line flags if necessary. There is no need to define the - macro if it would always be 0. */ - #include "as.h" /* Flonums returned here. */ @@ -47,8 +40,8 @@ extern const char EXP_CHARS[]; /* Length in LittleNums of guard bits. */ #define GUARD (2) -#ifndef TC_LARGEST_EXPONENT_IS_NORMAL -#define TC_LARGEST_EXPONENT_IS_NORMAL 0 +#ifndef TC_LARGEST_EXPONENT_IS_NORMAL(PRECISION) +#define TC_LARGEST_EXPONENT_IS_NORMAL(PRECISION) 0 #endif static const unsigned long mask[] = @@ -302,7 +295,7 @@ gen_to_words (words, precision, exponent_bits) /* NaN: Do the right thing. */ if (generic_floating_point_number.sign == 0) { - if (TC_LARGEST_EXPONENT_IS_NORMAL) + if (TC_LARGEST_EXPONENT_IS_NORMAL (precision)) as_warn ("NaNs are not supported by this target\n"); if (precision == F_PRECISION) { @@ -341,7 +334,7 @@ gen_to_words (words, precision, exponent_bits) } else if (generic_floating_point_number.sign == 'P') { - if (TC_LARGEST_EXPONENT_IS_NORMAL) + if (TC_LARGEST_EXPONENT_IS_NORMAL (precision)) as_warn ("Infinities are not supported by this target\n"); /* +INF: Do the right thing. */ @@ -382,7 +375,7 @@ gen_to_words (words, precision, exponent_bits) } else if (generic_floating_point_number.sign == 'N') { - if (TC_LARGEST_EXPONENT_IS_NORMAL) + if (TC_LARGEST_EXPONENT_IS_NORMAL (precision)) as_warn ("Infinities are not supported by this target\n"); /* Negative INF. */ @@ -598,7 +591,7 @@ gen_to_words (words, precision, exponent_bits) return return_value; } else if ((unsigned long) exponent_4 > mask[exponent_bits] - || (! TC_LARGEST_EXPONENT_IS_NORMAL + || (! TC_LARGEST_EXPONENT_IS_NORMAL (precision) && (unsigned long) exponent_4 == mask[exponent_bits])) { /* Exponent overflow. Lose immediately. */ diff --git a/gas/doc/internals.texi b/gas/doc/internals.texi index e7d3009..6bd3277 100644 --- a/gas/doc/internals.texi +++ b/gas/doc/internals.texi @@ -1151,6 +1151,16 @@ a pointer to a integer that should be filled in with the number of gas/bignum.h). The function should return NULL upon success or an error string upon failure. +@item TC_LARGEST_EXPONENT_IS_NORMAL +@cindex TC_LARGEST_EXPONENT_IS_NORMAL (@var{precision}) +This macro is used only by @file{atof-ieee.c}. It should evaluate to true +if floats of the given precision use the largest exponent for normal numbers +instead of NaNs and infinities. @var{precision} is @samp{F_PRECISION} for +single precision, @samp{D_PRECISION} for double precision, or +@samp{X_PRECISION} for extended double precision. + +The macro has a default definition which returns 0 for all cases. + @item md_reloc_size @cindex md_reloc_size This variable is only used in the original version of gas (not |