real.h (REAL_MODE_FORMAT): New macro.
authorZack Weinberg <zack@gcc.gnu.org>
Mon, 6 Oct 2003 22:47:32 +0000 (22:47 +0000)
committerZack Weinberg <zack@gcc.gnu.org>
Mon, 6 Oct 2003 22:47:32 +0000 (22:47 +0000)
* 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

16 files changed:
gcc/ChangeLog
gcc/c-cppbuiltin.c
gcc/config/alpha/alpha.c
gcc/config/c4x/c4x.c
gcc/config/i370/i370.c
gcc/config/i386/freebsd.h
gcc/config/i386/i386.c
gcc/config/i960/i960.c
gcc/config/ia64/ia64.c
gcc/config/m68k/m68k.c
gcc/config/mips/mips.c
gcc/config/rs6000/rs6000.c
gcc/config/vax/vax.c
gcc/optabs.c
gcc/real.c
gcc/real.h

index 6a6dc5d35f17fa25c09165231d4d7e47195b5250..a60682cb1fc59e9c4f0123a31a1ce6fb02f604fe 100644 (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.
 
 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.
 
        * 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.
 
index 879d731268a3f5a94320539785ee28550a98a381..19a9cf481069d63729a646334bad1077d8dacd9a 100644 (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)
index 2340358582169e778ba129f6cf8ed3c2a8d7dd3b..f7998cc994c6f7c5e2a00c0e7993aa0300985c9c 100644 (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;
     }
 }
 \f
index ef5860252bf1d03d112f9290f81d49791264a739..a50cbb8a88c00f9be39f0e2b5698d9946dd46d59 100644 (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;
 }
 
 
index eae8e347264ee26a7e866da5e7d60e54cc3a6a89..0dfa3c4559b185436136b64228952b9c0aa656cb 100644 (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;
 }
 
 /* ===================================================== */
index fb0438b8096c7ba7997e5ce88509a9eeb2127292..7396a47ce42bec1af8639d7352be064549c9766e 100644 (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)
index 6ca6ee2bb9c2116501456d4a4421a0fad70741fc..1c606df7694c2add18aa67a8c7716ed7c6a946fa 100644 (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.  */
index 88ac99ee6cc844d75d9c17ea8a8a6c9f5537f6f3..f62693a91765a51c06fcfb41495df5a6e467130a 100644 (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;
 }
 \f
 /* Return true if OP can be used as the source of an fp move insn.  */
index b10b9e9344c04e93afb8d5663ab5a5afefee9923..b632d8b8c641f9516679b9cb4b3115ec1234d755 100644 (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;
 }
 \f
 static enum attr_itanium_class ia64_safe_itanium_class (rtx);
index a20e129b8dc7ae1a4cd382738816139fbe9a485b..105f2417ce4c68494402f2c998f8ad0f728509a4 100644 (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;
 }
 \f
 /* Structure describing stack frame layout. */
index 6c9d5ec184d854e5854dcdb29bbd0cbe7173b230..9478ec1ad1e594fc5ac987b93a33d244d6dec44f 100644 (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;
index 1f037d9f91065f5cc143811ccfa20634623c066a..4316b23cf3927122cfe62a42af1c9a51c8c8495a 100644 (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 ();
index 4f8ffb0c4b2ae15927d081d4e67986bbaf3b565c..a4ec09191e638e8d0c5b60100fb53ba86c0bbd9e 100644 (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
index 7f8affc0ddf7aa08c05268b12df3d24426552d21..f05b999972ad89ca3be5a8926e30d9b50e418297 100644 (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;
 
index ea3d085afcf6466c88e2409a2645a2e2c769b70e..f902ebda82473a08462721dde10ecdf5a1dda960 100644 (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;
 
index 4799204de560adefeda285c0f4186d33116bee24..e897098507c561ef57d12234afbcef3df8bb51ea 100644 (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.  */