real.h (REAL_MODE_FORMAT): New macro.

* real.h (REAL_MODE_FORMAT): New macro.
	* c-cppbuiltin.c, optabs.c, real.c, config/alpha/alpha.c
	* config/c4x/c4x.c, config/i370/i370.c, config/i386/freebsd.h
	* config/i386/i386.c, config/i960/i960.c, config/ia64/ia64.c
	* config/m68k/m68k.c, config/mips/mips.c, config/rs6000/rs6000.c
	* config/vax/vax.c: Use REAL_MODE_FORMAT instead of referring
	directly to real_format_for_mode array, wherever possible.

From-SVN: r72168
This commit is contained in:
Zack Weinberg 2003-10-06 22:47:32 +00:00
parent ba9b12d1d2
commit 70a01792d8
16 changed files with 44 additions and 34 deletions

View File

@ -1,10 +1,20 @@
2003-10-06 Zack Weinberg <zack@codesourcery.com>
* real.h (REAL_MODE_FORMAT): New macro.
* c-cppbuiltin.c, optabs.c, real.c, config/alpha/alpha.c
* config/c4x/c4x.c, config/i370/i370.c, config/i386/freebsd.h
* config/i386/i386.c, config/i960/i960.c, config/ia64/ia64.c
* config/m68k/m68k.c, config/mips/mips.c, config/rs6000/rs6000.c
* config/vax/vax.c: Use REAL_MODE_FORMAT instead of referring
directly to real_format_for_mode array, wherever possible.
2003-10-06 Devang Patel <dpatel@apple.com>
* dwarf2out.c (is_main_source): Remove variable.
(dwarf2out_start_source_file): Do not check is_main_source.
Do not reset is_main_source.
(dwarf2out_init): Do not initialize is_main_source.
2003-10-06 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* fixinc/inclhack.def (stdio_va_list): Removed _ap fix.
@ -103,7 +113,7 @@
2003-10-05 Andrew Pinski <apinski@apple.com>
* config/darwin.c (machopic_non_lazy_ptr_name):
* config/darwin.c (machopic_non_lazy_ptr_name):
Change strcat to memcpy and add length together.
(machopic_stub_name): Likewise.
@ -191,7 +201,7 @@
* gengtype-lex.l: Recognize typedef of functions without PARAMS macro.
2003-10-04 Nathanael Nerode <neroden@gcc.gnu.org>
* config/v850/v850-c.c, config/v850/v850-protos.h, config/v850/v850.c:
Convert to ISO C90 function declarations and definitions.

View File

@ -85,7 +85,7 @@ builtin_define_float_constants (const char *name_prefix, const char *fp_suffix,
int dig, min_10_exp, max_10_exp;
int decimal_dig;
fmt = real_format_for_mode[TYPE_MODE (type) - QFmode];
fmt = REAL_MODE_FORMAT (TYPE_MODE (type));
/* The radix of the exponent representation. */
if (type == float_type_node)

View File

@ -472,9 +472,9 @@ override_options (void)
/* Tell the compiler when we're using VAX floating point. */
if (TARGET_FLOAT_VAX)
{
real_format_for_mode[SFmode - QFmode] = &vax_f_format;
real_format_for_mode[DFmode - QFmode] = &vax_g_format;
real_format_for_mode[TFmode - QFmode] = NULL;
REAL_MODE_FORMAT (SFmode) = &vax_f_format;
REAL_MODE_FORMAT (DFmode) = &vax_g_format;
REAL_MODE_FORMAT (TFmode) = NULL;
}
}

View File

@ -317,8 +317,8 @@ c4x_override_options (void)
/* We're C4X floating point, not IEEE floating point. */
memset (real_format_for_mode, 0, sizeof real_format_for_mode);
real_format_for_mode[QFmode - QFmode] = &c4x_single_format;
real_format_for_mode[HFmode - QFmode] = &c4x_extended_format;
REAL_MODE_FORMAT (QFmode) = &c4x_single_format;
REAL_MODE_FORMAT (HFmode) = &c4x_extended_format;
}

View File

@ -213,8 +213,8 @@ override_options ()
{
/* We're 370 floating point, not IEEE floating point. */
memset (real_format_for_mode, 0, sizeof real_format_for_mode);
real_format_for_mode[SFmode - QFmode] = &i370_single_format;
real_format_for_mode[DFmode - QFmode] = &i370_double_format;
REAL_MODE_FORMAT (SFmode) = &i370_single_format;
REAL_MODE_FORMAT (DFmode) = &i370_double_format;
}
/* ===================================================== */

View File

@ -137,9 +137,9 @@ Boston, MA 02111-1307, USA. */
#define SUBTARGET_OVERRIDE_OPTIONS \
do { \
if (!TARGET_64BIT) { \
real_format_for_mode[XFmode - QFmode] \
REAL_MODE_FORMAT (XFmode) \
= &ieee_extended_intel_96_round_53_format; \
real_format_for_mode[TFmode - QFmode] \
REAL_MODE_FORMAT (TFmode) \
= &ieee_extended_intel_96_round_53_format; \
} \
} while (0)

View File

@ -1113,8 +1113,8 @@ override_options (void)
/* By default our XFmode is the 80-bit extended format. If we have
use TFmode instead, it's also the 80-bit format, but with padding. */
real_format_for_mode[XFmode - QFmode] = &ieee_extended_intel_96_format;
real_format_for_mode[TFmode - QFmode] = &ieee_extended_intel_128_format;
REAL_MODE_FORMAT (XFmode) = &ieee_extended_intel_96_format;
REAL_MODE_FORMAT (TFmode) = &ieee_extended_intel_128_format;
/* Set the default values for switches whose default depends on TARGET_64BIT
in case they weren't overwritten by command line options. */

View File

@ -169,7 +169,7 @@ i960_initialize ()
}
/* Tell the compiler which flavor of TFmode we're using. */
real_format_for_mode[TFmode - QFmode] = &ieee_extended_intel_128_format;
REAL_MODE_FORMAT (TFmode) = &ieee_extended_intel_128_format;
}
/* Return true if OP can be used as the source of an fp move insn. */

View File

@ -4509,7 +4509,7 @@ ia64_override_options (void)
/* Tell the compiler which flavor of TFmode we're using. */
if (INTEL_EXTENDED_IEEE_FORMAT)
real_format_for_mode[TFmode - QFmode] = &ieee_extended_intel_128_format;
REAL_MODE_FORMAT (TFmode) = &ieee_extended_intel_128_format;
}
static enum attr_itanium_class ia64_safe_itanium_class (rtx);

View File

@ -212,7 +212,7 @@ override_options (void)
SUBTARGET_OVERRIDE_OPTIONS;
/* Tell the compiler which flavor of XFmode we're using. */
real_format_for_mode[XFmode - QFmode] = &ieee_extended_motorola_format;
REAL_MODE_FORMAT (XFmode) = &ieee_extended_motorola_format;
}
/* Structure describing stack frame layout. */

View File

@ -4859,12 +4859,12 @@ override_options (void)
flag_delayed_branch = 0;
}
real_format_for_mode[SFmode - QFmode] = &mips_single_format;
real_format_for_mode[DFmode - QFmode] = &mips_double_format;
REAL_MODE_FORMAT (SFmode) = &mips_single_format;
REAL_MODE_FORMAT (DFmode) = &mips_double_format;
#ifdef MIPS_TFMODE_FORMAT
real_format_for_mode[TFmode - QFmode] = &MIPS_TFMODE_FORMAT;
REAL_MODE_FORMAT (TFmode) = &MIPS_TFMODE_FORMAT;
#else
real_format_for_mode[TFmode - QFmode] = &mips_quad_format;
REAL_MODE_FORMAT (TFmode) = &mips_quad_format;
#endif
mips_print_operand_punct['?'] = 1;

View File

@ -845,7 +845,7 @@ rs6000_override_options (const char *default_cpu)
if (TARGET_LONG_DOUBLE_128
&& (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN))
real_format_for_mode[TFmode - QFmode] = &ibm_extended_format;
REAL_MODE_FORMAT (TFmode) = &ibm_extended_format;
/* Allocate an alias set for register saves & restores from stack. */
rs6000_sr_alias_set = new_alias_set ();

View File

@ -86,9 +86,8 @@ override_options (void)
{
/* We're VAX floating point, not IEEE floating point. */
memset (real_format_for_mode, 0, sizeof real_format_for_mode);
real_format_for_mode[SFmode - QFmode] = &vax_f_format;
real_format_for_mode[DFmode - QFmode]
= (TARGET_G_FLOAT ? &vax_g_format : &vax_d_format);
REAL_MODE_FORMAT (SFmode) = &vax_f_format;
REAL_MODE_FORMAT (DFmode) = (TARGET_G_FLOAT ? &vax_g_format : &vax_d_format);
}
/* Generate the assembly code for function entry. FILE is a stdio

View File

@ -2582,7 +2582,7 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target,
if (unoptab->code == NEG && class == MODE_FLOAT
&& GET_MODE_BITSIZE (mode) <= 2 * HOST_BITS_PER_WIDE_INT)
{
const struct real_format *fmt = real_format_for_mode[mode - QFmode];
const struct real_format *fmt = REAL_MODE_FORMAT (mode);
enum machine_mode imode = int_mode_for_mode (mode);
int bitpos = (fmt != 0) ? fmt->signbit : -1;
@ -2756,7 +2756,7 @@ expand_abs_nojump (enum machine_mode mode, rtx op0, rtx target,
if (GET_MODE_CLASS (mode) == MODE_FLOAT
&& GET_MODE_BITSIZE (mode) <= 2 * HOST_BITS_PER_WIDE_INT)
{
const struct real_format *fmt = real_format_for_mode[mode - QFmode];
const struct real_format *fmt = REAL_MODE_FORMAT (mode);
enum machine_mode imode = int_mode_for_mode (mode);
int bitpos = (fmt != 0) ? fmt->signbit : -1;

View File

@ -2105,7 +2105,7 @@ real_nan (REAL_VALUE_TYPE *r, const char *str, int quiet,
{
const struct real_format *fmt;
fmt = real_format_for_mode[mode - QFmode];
fmt = REAL_MODE_FORMAT (mode);
if (fmt == NULL)
abort ();
@ -2195,7 +2195,7 @@ real_maxval (REAL_VALUE_TYPE *r, int sign, enum machine_mode mode)
const struct real_format *fmt;
int np2;
fmt = real_format_for_mode[mode - QFmode];
fmt = REAL_MODE_FORMAT (mode);
if (fmt == NULL)
abort ();
@ -2368,7 +2368,7 @@ real_convert (REAL_VALUE_TYPE *r, enum machine_mode mode,
{
const struct real_format *fmt;
fmt = real_format_for_mode[mode - QFmode];
fmt = REAL_MODE_FORMAT (mode);
if (fmt == NULL)
abort ();
@ -2430,7 +2430,7 @@ real_to_target (long *buf, const REAL_VALUE_TYPE *r, enum machine_mode mode)
{
const struct real_format *fmt;
fmt = real_format_for_mode[mode - QFmode];
fmt = REAL_MODE_FORMAT (mode);
if (fmt == NULL)
abort ();
@ -2455,7 +2455,7 @@ real_from_target (REAL_VALUE_TYPE *r, const long *buf, enum machine_mode mode)
{
const struct real_format *fmt;
fmt = real_format_for_mode[mode - QFmode];
fmt = REAL_MODE_FORMAT (mode);
if (fmt == NULL)
abort ();
@ -2470,7 +2470,7 @@ significand_size (enum machine_mode mode)
{
const struct real_format *fmt;
fmt = real_format_for_mode[mode - QFmode];
fmt = REAL_MODE_FORMAT (mode);
if (fmt == NULL)
return 0;

View File

@ -145,6 +145,7 @@ struct real_format
Indexed by MODE - QFmode. */
extern const struct real_format *real_format_for_mode[TFmode - QFmode + 1];
#define REAL_MODE_FORMAT(MODE) (real_format_for_mode[(MODE) - QFmode])
/* Declare functions in real.c. */