rtl.c: Define CONST_DOUBLE_FORMAT to the appropriate format for a CONST_DOUBLE...
authorZack Weinberg <zack@bitmover.com>
Fri, 27 Aug 1999 20:37:06 +0000 (20:37 +0000)
committerZack Weinberg <zack@gcc.gnu.org>
Fri, 27 Aug 1999 20:37:06 +0000 (20:37 +0000)
1999-08-27 13:27 -0700  Zack Weinberg  <zack@bitmover.com>

* rtl.c: Define CONST_DOUBLE_FORMAT to the appropriate format
for a CONST_DOUBLE, at compile time.  Initialize rtx_length
and class_narrowest_mode at compile time.  Kill init_rtl.
Mark rtx_length, mode_class, mode_size, mode_unit_size,
mode_wider_mode, mode_mask_array, class_narrowest_mode, and
rtx_format as const.  Kill all references to EXTRA_CC_MODES or
EXTRA_CC_NAMES.
* rtl.def (CONST_DOUBLE): Use CONST_DOUBLE_FORMAT macro for
format.
* rtl.h: Declare rtx_length and rtx_format as const.
* machmode.def: Define CC().  Use CC() to define CCmode.  If
EXTRA_CC_MODES is defined, expand it here.
* machmode.h: Declare mode_class, mode_size, mode_unit_size,
mode_wider_mode, mode_mask_array, and class_narrowest_mode as
const.  Kill all references to EXTRA_CC_MODES.

* toplev.c: Don't prototype or call init_rtl.
* optabs.c: Don't call init_mov_optab.
* genemit.c: Don't generate init_mov_optab.  Don't call
init_rtl.
* gengenrtl.c: Duplicate calculation of CONST_DOUBLE_FORMAT
here.
* genattr.c, genattrtab.c, gencodes.c, genconfig.c,
genextract.c, genflags.c, genopinit.c, genoutput.c, genpeep.c,
genrecog.c: Don't call init_rtl.

* arc.h, arm.h, c4x.h, i386.h, i960.h, m88k.h, pa.h, pdp11.h,
rs6000.h, sparc.h: Don't define EXTRA_CC_NAMES.  Use CC() in
definition of EXTRA_CC_MODES.

* md.texi: Kill ref to EXTRA_CC_NAMES.
* tm.texi: Document new way to define EXTRA_CC_MODES.

* genrecog.c: Do not look up the name of a define_split.
(Unrelated bugfix.)

From-SVN: r28937

32 files changed:
gcc/ChangeLog
gcc/config/arc/arc.h
gcc/config/arm/arm.h
gcc/config/c4x/c4x.h
gcc/config/i386/i386.h
gcc/config/i960/i960.h
gcc/config/m88k/m88k.h
gcc/config/pa/pa.h
gcc/config/pdp11/pdp11.h
gcc/config/rs6000/rs6000.h
gcc/config/sparc/sparc.h
gcc/genattr.c
gcc/genattrtab.c
gcc/gencodes.c
gcc/genconfig.c
gcc/genemit.c
gcc/genextract.c
gcc/genflags.c
gcc/gengenrtl.c
gcc/genopinit.c
gcc/genoutput.c
gcc/genpeep.c
gcc/genrecog.c
gcc/machmode.def
gcc/machmode.h
gcc/md.texi
gcc/optabs.c
gcc/rtl.c
gcc/rtl.def
gcc/rtl.h
gcc/tm.texi
gcc/toplev.c

index 2da2a690ac782f5d8a40f1285773d0fb064ed534..636608ab8de8679fc28616fdcfe3e23c0beb0a82 100644 (file)
@@ -1,3 +1,41 @@
+1999-08-27 13:27 -0700  Zack Weinberg  <zack@bitmover.com>
+
+       * rtl.c: Define CONST_DOUBLE_FORMAT to the appropriate format
+       for a CONST_DOUBLE, at compile time.  Initialize rtx_length
+       and class_narrowest_mode at compile time.  Kill init_rtl.
+       Mark rtx_length, mode_class, mode_size, mode_unit_size,
+       mode_wider_mode, mode_mask_array, class_narrowest_mode, and
+       rtx_format as const.  Kill all references to EXTRA_CC_MODES or
+       EXTRA_CC_NAMES.
+       * rtl.def (CONST_DOUBLE): Use CONST_DOUBLE_FORMAT macro for
+       format.
+       * rtl.h: Declare rtx_length and rtx_format as const.
+       * machmode.def: Define CC().  Use CC() to define CCmode.  If
+       EXTRA_CC_MODES is defined, expand it here.
+       * machmode.h: Declare mode_class, mode_size, mode_unit_size,
+       mode_wider_mode, mode_mask_array, and class_narrowest_mode as
+       const.  Kill all references to EXTRA_CC_MODES.
+
+       * toplev.c: Don't prototype or call init_rtl.
+       * optabs.c: Don't call init_mov_optab.
+       * genemit.c: Don't generate init_mov_optab.  Don't call
+       init_rtl.
+       * gengenrtl.c: Duplicate calculation of CONST_DOUBLE_FORMAT
+       here.
+       * genattr.c, genattrtab.c, gencodes.c, genconfig.c,
+       genextract.c, genflags.c, genopinit.c, genoutput.c, genpeep.c,
+       genrecog.c: Don't call init_rtl.
+
+       * arc.h, arm.h, c4x.h, i386.h, i960.h, m88k.h, pa.h, pdp11.h,
+       rs6000.h, sparc.h: Don't define EXTRA_CC_NAMES.  Use CC() in
+       definition of EXTRA_CC_MODES.
+
+       * md.texi: Kill ref to EXTRA_CC_NAMES.
+       * tm.texi: Document new way to define EXTRA_CC_MODES.
+
+       * genrecog.c: Do not look up the name of a define_split.
+       (Unrelated bugfix.)
+
 Fri Aug 27 17:03:42 1999  Nick Clifton  <nickc@cygnus.com>
 
        * config/v850/v850.md: Fix typo introduced by previous delta.
index 6eee03819898734418606c4ca1fdff05090c3a0f..10a163bad9a073892cd575f055c69ad18c3a1191 100644 (file)
@@ -1047,9 +1047,9 @@ do { \
 /* Some insns set all condition code flags, some only set the ZNC flags, and
    some only set the ZN flags.  */
 
-#define EXTRA_CC_MODES CCZNCmode, CCZNmode
-
-#define EXTRA_CC_NAMES "CCZNC", "CCZN"
+#define EXTRA_CC_MODES \
+       CC(CCZNCmode, "CCZNC") \
+       CC(CCZNmode, "CCZN")
 
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
    return the mode to be used for the comparison.  */
index 127dc75cc2a463f5562209d1a9913e8b865ef5e7..e5c89e78fbfca54ad0bf2bf98a154a2f7c83097a 100644 (file)
@@ -1889,14 +1889,23 @@ extern int making_const_table;
    CC_Zmode should be used if only the Z flag is set correctly
    CCmode should be used otherwise. */
 
-#define EXTRA_CC_MODES CC_NOOVmode, CC_Zmode, CC_SWPmode, \
-  CCFPmode, CCFPEmode, CC_DNEmode, CC_DEQmode, CC_DLEmode, \
-  CC_DLTmode, CC_DGEmode, CC_DGTmode, CC_DLEUmode, CC_DLTUmode, \
-  CC_DGEUmode, CC_DGTUmode, CC_Cmode
-
-#define EXTRA_CC_NAMES "CC_NOOV", "CC_Z", "CC_SWP", "CCFP", "CCFPE", \
-  "CC_DNE", "CC_DEQ", "CC_DLE", "CC_DLT", "CC_DGE", "CC_DGT", "CC_DLEU", \
-  "CC_DLTU", "CC_DGEU", "CC_DGTU", "CC_C"
+#define EXTRA_CC_MODES         \
+    CC(CC_NOOVmode,  "CC_NOOV")        \
+    CC(CC_Zmode,     "CC_Z")   \
+    CC(CC_SWPmode,   "CC_SWP") \
+    CC(CCFPmode,     "CCFP")   \
+    CC(CCFPEmode,    "CCFPE")  \
+    CC(CC_DNEmode,   "CC_DNE") \
+    CC(CC_DEQmode,   "CC_DEQ") \
+    CC(CC_DLEmode,   "CC_DLE") \
+    CC(CC_DLTmode,   "CC_DLT") \
+    CC(CC_DGEmode,   "CC_DGE") \
+    CC(CC_DGTmode,   "CC_DGT") \
+    CC(CC_DLEUmode,  "CC_DLEU")        \
+    CC(CC_DLTUmode,  "CC_DLTU")        \
+    CC(CC_DGEUmode,  "CC_DGEU")        \
+    CC(CC_DGTUmode,  "CC_DGTU")        \
+    CC(CC_Cmode,     "CC_C")
 
 #define SELECT_CC_MODE(OP,X,Y)  arm_select_cc_mode ((OP), (X), (Y))
 
index 02f5cbf977faaa59f8adb47b8a363f1746019733..2d019b5304e74cc0a718d06991a23fe623638a78 100644 (file)
@@ -1532,11 +1532,7 @@ extern struct rtx_def *c4x_function_arg();
    load instructions after an add, subtract, neg, abs or multiply.
    We must emit a compare insn to check the result against 0.  */
 
-#define EXTRA_CC_MODES CC_NOOVmode
-
-/* Define the names for the modes specified above.  */
-
-#define EXTRA_CC_NAMES "CC_NOOV"
+#define EXTRA_CC_MODES CC(CC_NOOVmode, "CC_NOOV")
 
 /* CC_NOOVmode should be used when the first operand is a PLUS, MINUS, NEG
    or MULT.
index 7fbfede46ff2c35feba7062c98d96dcef7eb9961..827d021e5fe879e491619c8990a5ff4e6cee23eb 100644 (file)
@@ -2299,10 +2299,7 @@ while (0)
    For the i386, we need separate modes when floating-point equality
    comparisons are being done.  */
 
-#define EXTRA_CC_MODES CCFPEQmode
-
-/* Define the names for the modes specified above.  */
-#define EXTRA_CC_NAMES "CCFPEQ"
+#define EXTRA_CC_MODES CC(CCFPEQmode, "CCFPEQ")
 
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
    return the mode to be used for the comparison.
index 357ccdc80a750a1c1c8f5a1bfaeadbf0cd2d336e..e273438ca28d7d523674d657036c2fc343f9f6b8 100644 (file)
@@ -1237,10 +1237,9 @@ extern struct rtx_def *gen_compare_reg ();
 
    Also, signed and unsigned comparisons are distinguished, as
    are operations which are compatible with chkbit insns.  */
-#define EXTRA_CC_MODES CC_UNSmode, CC_CHKmode
-
-/* Define the names for the modes specified above.  */
-#define EXTRA_CC_NAMES "CC_UNS", "CC_CHK"
+#define EXTRA_CC_MODES         \
+    CC(CC_UNSmode, "CC_UNS")   \
+    CC(CC_CHKmode, "CC_CHK")
 
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
    return the mode to be used for the comparison.  For floating-point, CCFPmode
index 068db8498e9c5d73d26d14933dac8f13bd70c584..5017d8d901b2f1499dff06f66840c26ad8e10fa0 100644 (file)
@@ -1252,9 +1252,7 @@ extern struct rtx_def *m88k_va_arg ();
 \f
 /*** Addressing Modes ***/
 
-#define EXTRA_CC_MODES CCEVENmode
-
-#define EXTRA_CC_NAMES "CCEVEN"
+#define EXTRA_CC_MODES CC(CCEVENmode, "CCEVEN")
 
 #define SELECT_CC_MODE(OP,X,Y) CCmode
 
index 171153829386f86be061751ff82bf39e001ca1c3..3f993e11971f15b56f33650e8eda52ec22d30756 100644 (file)
@@ -1710,10 +1710,7 @@ while (0)
 /* Add any extra modes needed to represent the condition code.
 
    HPPA floating comparisons produce condition codes. */
-#define EXTRA_CC_MODES CCFPmode
-
-/* Define the names for the modes specified above.  */
-#define EXTRA_CC_NAMES "CCFP"
+#define EXTRA_CC_MODES CC(CCFPmode, "CCFP")
 
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
    return the mode to be used for the comparison.  For floating-point, CCFPmode
index 746a8e4d27c30a3889ab264f7142dd0854225759..2a1d936f6e40f8a717b849d2e15ec7853cfc3083 100644 (file)
@@ -944,10 +944,7 @@ extern int may_call_alloca;
 /* Add any extra modes needed to represent the condition code.
 
    CCFPmode is used for FPU, but should we use a separate reg? */
-#define EXTRA_CC_MODES CCFPmode
-
-/* the name for the mode above */
-#define EXTRA_CC_NAMES "CCFPmode"
+#define EXTRA_CC_MODES CC(CCFPmode, "CCFP")
 
 /* Give a comparison code (EQ, NE etc) and the first operand of a COMPARE,
    return the mode to be used for the comparison.  For floating-point, CCFPmode
index 22cf7f2572d95179529b4d4f2aad7100e3eb612e..79ab635c2eb24da0740eb9de9628946d1a0c3e82 100644 (file)
@@ -2412,10 +2412,10 @@ do {                                                                    \
    use a mode for the case when we are comparing the results of two
    comparisons.  */
 
-#define EXTRA_CC_MODES CCUNSmode, CCFPmode, CCEQmode
-
-/* Define the names for the modes specified above.  */
-#define EXTRA_CC_NAMES "CCUNS", "CCFP", "CCEQ"
+#define EXTRA_CC_MODES         \
+    CC(CCUNSmode,  "CCUNS")    \
+    CC(CCFPmode,   "CCFP")     \
+    CC(CCEQmode,   "CCEQ")
 
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
    return the mode to be used for the comparison.  For floating-point, CCFPmode
index 82e3727c8c5876cf485bfb4a82ee3130ab930da3..20ba7dca730851130c691a7ecbff93f75cbd01de 100644 (file)
@@ -2566,11 +2566,12 @@ do {                                                                    \
 
    CCXmode and CCX_NOOVmode are only used by v9.  */
 
-#define EXTRA_CC_MODES CCXmode, CC_NOOVmode, CCX_NOOVmode, CCFPmode, CCFPEmode
-
-/* Define the names for the modes specified above.  */
-
-#define EXTRA_CC_NAMES "CCX", "CC_NOOV", "CCX_NOOV", "CCFP", "CCFPE"
+#define EXTRA_CC_MODES                 \
+    CC(CCXmode,             "CCX")             \
+    CC(CC_NOOVmode,  "CC_NOOV")                \
+    CC(CCX_NOOVmode, "CCX_NOOV")       \
+    CC(CCFPmode,     "CCFP")           \
+    CC(CCFPEmode,    "CCFPE")
 
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
    return the mode to be used for the comparison.  For floating-point,
index 02e0be8e8e3db7686514ac11aef3a80e1b367d7e..60dc73aefc283d3ac663ea39debb86e2f01ca75f 100644 (file)
@@ -258,8 +258,6 @@ main (argc, argv)
       exit (FATAL_EXIT_CODE);
     }
 
-  init_rtl ();
-
   printf ("/* Generated automatically by the program `genattr'\n\
 from the machine description file `md'.  */\n\n");
 
index 4b36275066247e201e13f297ffa4aae72e3bfa23..5c1a3be73ecc13c9764f2f912f6582ef7d0afbcc 100644 (file)
@@ -5982,8 +5982,6 @@ main (argc, argv)
       exit (FATAL_EXIT_CODE);
     }
 
-  init_rtl ();
-
   /* Set up true and false rtx's */
   true_rtx = rtx_alloc (CONST_INT);
   XWINT (true_rtx, 0) = 1;
index 1fa8700dd33df0d7d881af87bbcccd1666cdd4f6..c737e2a6d30fc5514bc3d8dc1f40558721598d49 100644 (file)
@@ -101,8 +101,6 @@ main (argc, argv)
       exit (FATAL_EXIT_CODE);
     }
 
-  init_rtl ();
-
   printf ("/* Generated automatically by the program `gencodes'\n\
 from the machine description file `md'.  */\n\n");
 
index bbe707cf029ab2c8bff2daf072c48227c6697724..8f4568d37ad13d311e3914c9e9f630d6bff3b461 100644 (file)
@@ -290,8 +290,6 @@ main (argc, argv)
       exit (FATAL_EXIT_CODE);
     }
 
-  init_rtl ();
-
   printf ("/* Generated automatically by the program `genconfig'\n\
 from the machine description file `md'.  */\n\n");
 
index 161aeff6da61505d16986025bcff62fc9bce3a4e..dc9a49af9d6f56f384aad3c7a00e6f730582cb15 100644 (file)
@@ -643,40 +643,6 @@ output_add_clobbers ()
   printf ("}\n");
 }
 \f
-/* Write a function, init_mov_optab, that is called to set up entries
-   in mov_optab for EXTRA_CC_MODES.  */
-
-static void
-output_init_mov_optab ()
-{
-#ifdef EXTRA_CC_NAMES
-  static char *cc_names[] = { EXTRA_CC_NAMES };
-  char *p;
-  size_t i;
-
-  printf ("\nvoid\ninit_mov_optab ()\n{\n");
-
-  for (i = 0; i < sizeof cc_names / sizeof cc_names[0]; i++)
-    {
-      printf ("#ifdef HAVE_mov");
-      for (p = cc_names[i]; *p; p++)
-       printf ("%c", *p >= 'A' && *p <= 'Z' ? *p - 'A' + 'a' : *p);
-      printf ("\n");
-      printf ("  if (HAVE_mov");
-      for (p = cc_names[i]; *p; p++)
-       printf ("%c", *p >= 'A' && *p <= 'Z' ? *p - 'A' + 'a' : *p);
-      printf (")\n");
-      printf ("    mov_optab->handlers[(int) %smode].insn_code = CODE_FOR_mov",
-             cc_names[i]);
-      for (p = cc_names[i]; *p; p++)
-       printf ("%c", *p >= 'A' && *p <= 'Z' ? *p - 'A' + 'a' : *p);
-      printf (";\n#endif\n");
-    }
-
-  printf ("}\n");
-#endif
-}
-\f
 PTR
 xmalloc (size)
   size_t size;
@@ -726,8 +692,6 @@ main (argc, argv)
       exit (FATAL_EXIT_CODE);
     }
 
-  init_rtl ();
-
   /* Assign sequential codes to all entries in the machine description
      in parallel with the tables in insn-output.c.  */
 
@@ -790,9 +754,6 @@ from the machine description file `md'.  */\n\n");
   /* Write out the routine to add CLOBBERs to a pattern.  */
   output_add_clobbers ();
 
-  /* Write the routine to initialize mov_optab for the EXTRA_CC_MODES.  */
-  output_init_mov_optab ();
-
   fflush (stdout);
   exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
   /* NOTREACHED */
index 2f791a351989175de2aa5153b7a7a348c424922b..d3b2061ba4ec8e06653c9e69bfad83648c7d8f6b 100644 (file)
@@ -402,8 +402,6 @@ main (argc, argv)
       exit (FATAL_EXIT_CODE);
     }
 
-  init_rtl ();
-
   /* Assign sequential codes to all entries in the machine description
      in parallel with the tables in insn-output.c.  */
 
index 4602ea404dc48473face69678bd15c9036a568be..b1fa6bb842452e00979638298e374d1d9c45137f 100644 (file)
@@ -227,8 +227,6 @@ main (argc, argv)
       exit (FATAL_EXIT_CODE);
     }
 
-  init_rtl ();
-
   printf ("/* Generated automatically by the program `genflags'\n\
 from the machine description file `md'.  */\n\n");
 
index e07b9402c8818e5c421534ecda8bbf60d5f8e494..762c96fa4e42e398b8e043172ed9433c74682b78 100644 (file)
@@ -26,6 +26,27 @@ Boston, MA 02111-1307, USA.  */
 #include "rtl.h"
 #undef abort
 
+#include "real.h"
+
+/* Calculate the format for CONST_DOUBLE.  This depends on the relative
+   widths of HOST_WIDE_INT and REAL_VALUE_TYPE.
+   We only need to go out to e0wwww, since min(HOST_WIDE_INT)==32 and
+   max(LONG_DOUBLE_TYPE_SIZE)==128.
+   This is duplicated in rtl.c.  
+   A number of places assume that there are always at least two 'w'
+   slots in a CONST_DOUBLE, so we provide them even if one would suffice.  */
+#if HOST_BITS_PER_WIDE_INT >= LONG_DOUBLE_TYPE_SIZE
+#define CONST_DOUBLE_FORMAT    "e0ww"
+#elif HOST_BITS_PER_WIDE_INT*2 >= LONG_DOUBLE_TYPE_SIZE
+#define CONST_DOUBLE_FORMAT    "e0ww"
+#elif HOST_BITS_PER_WIDE_INT*3 >= LONG_DOUBLE_TYPE_SIZE
+#define CONST_DOUBLE_FORMAT    "e0www"
+#elif HOST_BITS_PER_WIDE_INT*4 >= LONG_DOUBLE_TYPE_SIZE
+#define CONST_DOUBLE_FORMAT    "e0wwww"
+#else
+#define CONST_DOUBLE_FORMAT    /* nothing - will cause syntax error */
+#endif
+
 
 struct rtx_definition 
 {
index a68c27b2720fcc8be2b78ee774d16a98da326403..249500549e9fba597a2d0a80dd7cb2f600ea9c3e 100644 (file)
@@ -326,8 +326,6 @@ main (argc, argv)
       exit (FATAL_EXIT_CODE);
     }
 
-  init_rtl ();
-
   printf ("/* Generated automatically by the program `genopinit'\n\
 from the machine description file `md'.  */\n\n");
 
index ecdc304f4c8a262027551eccd91d8ea707199766..c0a4cf581634474780cfd88f620c0510cf8a6ee4 100644 (file)
@@ -162,10 +162,6 @@ struct data *end_of_insn_data;
 
 int have_constraints;
 
-/* Nonzero if some error has occurred.  We will make all errors fatal, but
-   might as well continue until we see all of them.  */
-
-static int have_error;
 \f
 static char * name_for_index PROTO((int));
 static void output_prologue PROTO((void));
@@ -951,8 +947,6 @@ main (argc, argv)
       exit (FATAL_EXIT_CODE);
     }
 
-  init_rtl ();
-
   output_prologue ();
   next_code_number = 0;
   next_index_number = 0;
index 9b6c4920e77a03ed7d6b224e6d594232729461ca..3a877fe6cc0e3d0655f9eecc0afb5d1036d46a9e 100644 (file)
@@ -431,8 +431,6 @@ main (argc, argv)
       exit (FATAL_EXIT_CODE);
     }
 
-  init_rtl ();
-
   printf ("/* Generated automatically by the program `genpeep'\n\
 from the machine description file `md'.  */\n\n");
 
index d8bd74a2f0cca1229a125232d34ac873691d1413..166fc7a0e256ac17f8ad533d82ef858414251392 100644 (file)
@@ -213,7 +213,7 @@ make_insn_sequence (insn, type)
   {
     static const char *last_real_name = "insn";
     static int last_real_code = 0;
-    char *name;
+    char *name = 0;
 
     if (insn_name_ptr_size <= next_insn_code)
       {
@@ -226,7 +226,8 @@ make_insn_sequence (insn, type)
        insn_name_ptr_size = new_size;
       }
 
-    name = XSTR (insn, 0);
+    if (type == RECOG)
+      name = XSTR (insn, 0);
     if (!name || name[0] == '\0')
       {
        name = xmalloc (strlen (last_real_name) + 10);
@@ -1733,7 +1734,6 @@ main (argc, argv)
       exit (FATAL_EXIT_CODE);
     }
 
-  init_rtl ();
   next_insn_code = 0;
   next_index = 0;
 
index ab2215ed8c02efd6bf2a7d0d2161c97ae842b248..a2258aae371e96b68a36fca26be5282b6cbc66ee 100644 (file)
@@ -106,11 +106,20 @@ DEF_MACHMODE (BLKmode, "BLK", MODE_RANDOM, 0, 0, VOIDmode)
 
 /* The modes for representing the condition codes come last.  CCmode is
    always defined.  Additional modes for the condition code can be specified
-   in the EXTRA_CC_MODES macro.  Everything but the names of the modes
-   are copied from CCmode.  For these modes, GET_MODE_WIDER_MODE points
-   to the next defined CC mode, if any.  */
+   in the EXTRA_CC_MODES macro.
+   All MODE_CC modes are the same width as SImode and have VOIDmode as their
+   next wider mode.
+*/
+
+#define CC(E, M)  DEF_MACHMODE (E, M, MODE_CC, 4, 4, VOIDmode)
+
+CC (CCmode, "CC")
+
+#ifdef EXTRA_CC_MODES
+EXTRA_CC_MODES
+#endif
 
-DEF_MACHMODE (CCmode, "CC", MODE_CC, 4, 4, VOIDmode)
+#undef CC
 
 /* The symbol Pmode stands for one of the above machine modes (usually SImode).
    The tm file specifies which one.  It is not a distinct mode.  */
index 756559181ea7e924236e9706d9d94a5d8ef6ed4f..79ab7b046ebe5acd6704c8683e50dee0028c4968 100644 (file)
@@ -42,10 +42,6 @@ Boston, MA 02111-1307, USA.  */
 
 enum machine_mode {
 #include "machmode.def"
-
-#ifdef EXTRA_CC_MODES
-  EXTRA_CC_MODES,
-#endif
 MAX_MACHINE_MODE };
 
 #undef DEF_MACHMODE
@@ -65,7 +61,7 @@ enum mode_class { MODE_RANDOM, MODE_INT, MODE_FLOAT, MODE_PARTIAL_INT, MODE_CC,
 /* Get the general kind of object that mode MODE represents
    (integer, floating, complex, etc.)  */
 
-extern enum mode_class mode_class[];
+extern const enum mode_class mode_class[];
 #define GET_MODE_CLASS(MODE)           (mode_class[(int) (MODE)])
 
 /* Nonzero if MODE is an integral mode.  */
@@ -86,12 +82,12 @@ extern enum mode_class mode_class[];
 
 /* Get the size in bytes of an object of mode MODE.  */
 
-extern int mode_size[];
+extern const int mode_size[];
 #define GET_MODE_SIZE(MODE)            (mode_size[(int) (MODE)])
 
 /* Get the size in bytes of the basic parts of an object of mode MODE.  */
 
-extern int mode_unit_size[];
+extern const int mode_unit_size[];
 #define GET_MODE_UNIT_SIZE(MODE)       (mode_unit_size[(int) (MODE)])
 
 /* Get the number of units in the object.  */
@@ -109,7 +105,7 @@ extern int mode_unit_size[];
 /* Get a bitmask containing 1 for all bits in a word
    that fit within mode MODE.  */
 
-extern unsigned HOST_WIDE_INT mode_mask_array[];
+extern const unsigned HOST_WIDE_INT mode_mask_array[];
 
 #define GET_MODE_MASK(MODE) mode_mask_array[(int) (MODE)]
 
@@ -117,7 +113,7 @@ extern unsigned HOST_WIDE_INT mode_mask_array[];
 
 /* Get the next wider natural mode (eg, QI -> HI -> SI -> DI -> TI).  */
 
-extern unsigned char mode_wider_mode[];
+extern const unsigned char mode_wider_mode[];
 #define GET_MODE_WIDER_MODE(MODE)      ((enum machine_mode)mode_wider_mode[(int) (MODE)])
 
 /* Return the mode for data of a given size SIZE and mode class CLASS.
@@ -149,7 +145,7 @@ extern enum machine_mode get_best_mode PROTO((int, int, int, enum machine_mode,
 
 /* For each class, get the narrowest mode in that class.  */
 
-extern enum machine_mode class_narrowest_mode[];
+extern const enum machine_mode class_narrowest_mode[];
 #define GET_CLASS_NARROWEST_MODE(CLASS) class_narrowest_mode[(int) (CLASS)]
 
 /* Define the integer modes whose sizes are BITS_PER_UNIT and BITS_PER_WORD
index 13dc4421ae661df7db9f2f17335cde4a0d7b454f..c300c299ef74e8be4ce1008aa83223dc0edb50de 100644 (file)
@@ -2787,7 +2787,6 @@ is in class @code{MODE_CC}.  Normally, it will be @code{CCmode}.  If
 additional modes are required (as for the add example mentioned above in
 the Sparc), define the macro @code{EXTRA_CC_MODES} to list the
 additional modes required (@pxref{Condition Code}).  Also define
-@code{EXTRA_CC_NAMES} to list the names of those modes and
 @code{SELECT_CC_MODE} to choose a mode given an operand of a compare.
 
 If it is known during RTL generation that a different mode will be
index f8409374409011ca3cc8d44c1388396dd182c08f..82bfc6a4e12c745f4466031ce9fe228c52be49df 100644 (file)
@@ -4612,10 +4612,6 @@ init_optabs ()
       fixtrunctab[i][j][1] = fixtrunctab[i][j][0];
 #endif
 
-#ifdef EXTRA_CC_MODES
-  init_mov_optab ();
-#endif
-
   /* Initialize the optabs with the names of the library functions.  */
   init_integral_libfuncs (add_optab, "add", '3');
   init_floating_libfuncs (add_optab, "add", '3');
index e50d5a759c7055f7378945d310b2e656f2b3ace5..e13e4d2bfb00ab95e3cb19abfb16afafd4a6c398 100644 (file)
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -41,11 +41,36 @@ Boston, MA 02111-1307, USA.  */
 
 extern struct obstack *rtl_obstack;
 \f
+
+/* Calculate the format for CONST_DOUBLE.  This depends on the relative
+   widths of HOST_WIDE_INT and REAL_VALUE_TYPE.
+   We only need to go out to e0wwww, since min(HOST_WIDE_INT)==32 and
+   max(LONG_DOUBLE_TYPE_SIZE)==128.
+   This is duplicated in gengenrtl.c.
+   A number of places assume that there are always at least two 'w'
+   slots in a CONST_DOUBLE, so we provide them even if one would suffice.  */
+#if HOST_BITS_PER_WIDE_INT >= LONG_DOUBLE_TYPE_SIZE
+#define CONST_DOUBLE_FORMAT    "e0ww"
+#elif HOST_BITS_PER_WIDE_INT*2 >= LONG_DOUBLE_TYPE_SIZE
+#define CONST_DOUBLE_FORMAT    "e0ww"
+#elif HOST_BITS_PER_WIDE_INT*3 >= LONG_DOUBLE_TYPE_SIZE
+#define CONST_DOUBLE_FORMAT    "e0www"
+#elif HOST_BITS_PER_WIDE_INT*4 >= LONG_DOUBLE_TYPE_SIZE
+#define CONST_DOUBLE_FORMAT    "e0wwww"
+#else
+#define CONST_DOUBLE_FORMAT    /* nothing - will cause syntax error */
+#endif
+
 /* Indexed by rtx code, gives number of operands for an rtx with that code.
-   Does NOT include rtx header data (code and links).
-   This array is initialized in init_rtl.  */
+   Does NOT include rtx header data (code and links).  */
 
-int rtx_length[NUM_RTX_CODE + 1];
+#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS)   sizeof FORMAT - 1 ,
+
+const int rtx_length[NUM_RTX_CODE + 1] = {
+#include "rtl.def"
+};
+
+#undef DEF_RTL_EXPR
 
 /* Indexed by rtx code, gives the name of that kind of rtx, as a C string.  */
 
@@ -64,10 +89,6 @@ const char * const rtx_name[] = {
 
 const char * const mode_name[(int) MAX_MACHINE_MODE + 1] = {
 #include "machmode.def"
-
-#ifdef EXTRA_CC_MODES
-  EXTRA_CC_NAMES,
-#endif
   /* Add an extra field to avoid a core dump if someone tries to convert
      MAX_MACHINE_MODE to a string.   */
   ""
@@ -80,7 +101,7 @@ const char * const mode_name[(int) MAX_MACHINE_MODE + 1] = {
 
 #define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER)  CLASS,
 
-enum mode_class mode_class[(int) MAX_MACHINE_MODE] = {
+const enum mode_class mode_class[(int) MAX_MACHINE_MODE] = {
 #include "machmode.def"
 };
 
@@ -91,7 +112,7 @@ enum mode_class mode_class[(int) MAX_MACHINE_MODE] = {
 
 #define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER)  SIZE,
 
-int mode_size[(int) MAX_MACHINE_MODE] = {
+const int mode_size[(int) MAX_MACHINE_MODE] = {
 #include "machmode.def"
 };
 
@@ -102,7 +123,7 @@ int mode_size[(int) MAX_MACHINE_MODE] = {
 
 #define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER)  UNIT,
 
-int mode_unit_size[(int) MAX_MACHINE_MODE] = {
+const int mode_unit_size[(int) MAX_MACHINE_MODE] = {
 #include "machmode.def"                /* machine modes are documented here */
 };
 
@@ -115,7 +136,7 @@ int mode_unit_size[(int) MAX_MACHINE_MODE] = {
 #define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER)  \
   (unsigned char) WIDER,
 
-unsigned char mode_wider_mode[(int) MAX_MACHINE_MODE] = {
+const unsigned char mode_wider_mode[(int) MAX_MACHINE_MODE] = {
 #include "machmode.def"                /* machine modes are documented here */
 };
 
@@ -126,19 +147,30 @@ unsigned char mode_wider_mode[(int) MAX_MACHINE_MODE] = {
 
 /* Indexed by machine mode, gives mask of significant bits in mode.  */
 
-unsigned HOST_WIDE_INT mode_mask_array[(int) MAX_MACHINE_MODE] = {
+const unsigned HOST_WIDE_INT mode_mask_array[(int) MAX_MACHINE_MODE] = {
 #include "machmode.def"
 };
 
-/* Indexed by mode class, gives the narrowest mode for each class.  */
-
-enum machine_mode class_narrowest_mode[(int) MAX_MODE_CLASS];
+/* Indexed by mode class, gives the narrowest mode for each class.
+   The Q modes are always of width 1 (2 for complex) - it is impossible
+   for any mode to be narrower.  */
+
+const enum machine_mode class_narrowest_mode[(int) MAX_MODE_CLASS] = {
+    /* MODE_RANDOM */          VOIDmode,
+    /* MODE_INT */             QImode,
+    /* MODE_FLOAT */           QFmode,
+    /* MODE_PARTIAL_INT */     PQImode,
+    /* MODE_CC */              CCmode,
+    /* MODE_COMPLEX_INT */     CQImode,
+    /* MODE_COMPLEX_FLOAT */   QCmode
+};
+                       
 
 /* Indexed by rtx code, gives a sequence of operand-types for
    rtx's of that code.  The sequence is a C string in which
    each character describes one operand.  */
 
-const char *rtx_format[] = {
+const char * const rtx_format[] = {
   /* "*" undefined.
          can cause a warning message
      "0" field is unused (or used in a phase-dependent manner)
@@ -901,71 +933,6 @@ read_rtx (infile)
 
   return return_rtx;
 }
-\f
-/* This is called once per compilation, before any rtx's are constructed.
-   It initializes the vector `rtx_length', the extra CC modes, if any,
-   and computes certain commonly-used modes.  */
-
-void
-init_rtl ()
-{
-  int min_class_size[(int) MAX_MODE_CLASS];
-  enum machine_mode mode;
-  int i;
-
-  for (i = 0; i < NUM_RTX_CODE; i++)
-    rtx_length[i] = strlen (GET_RTX_FORMAT(i));
-
-  /* Make CONST_DOUBLE bigger, if real values are bigger than
-     it normally expects to have room for.
-     Note that REAL_VALUE_TYPE is not defined by default,
-     since tree.h is not included.  But the default dfn as `double'
-     would do no harm.  */
-#ifdef REAL_VALUE_TYPE
-  i = sizeof (REAL_VALUE_TYPE) / sizeof (rtunion) + 2;
-  if (rtx_length[(int) CONST_DOUBLE] < i)
-    {
-      char *s = (char *) xmalloc (i + 1);
-      rtx_length[(int) CONST_DOUBLE] = i;
-      rtx_format[(int) CONST_DOUBLE] = s;
-      *s++ = 'e';
-      *s++ = '0';
-      /* Set the GET_RTX_FORMAT of CONST_DOUBLE to a string
-        of as many `w's as we now have elements.  Subtract two from
-        the size to account for the 'e' and the '0'.  */
-      for (i = 2; i < rtx_length[(int) CONST_DOUBLE]; i++)
-       *s++ = 'w';
-      *s++ = 0;
-    }
-#endif
-
-#ifdef EXTRA_CC_MODES
-  for (i = (int) CCmode + 1; i < (int) MAX_MACHINE_MODE; i++)
-    {
-      mode_class[i] = MODE_CC;
-      mode_mask_array[i] = mode_mask_array[(int) CCmode];
-      mode_size[i] = mode_size[(int) CCmode];
-      mode_unit_size[i] = mode_unit_size[(int) CCmode];
-      mode_wider_mode[i - 1] = i;
-      mode_wider_mode[i] = (unsigned char)VOIDmode;
-    }
-#endif
-
-  /* Find the narrowest mode for each class.  */
-
-  for (i = 0; i < (int) MAX_MODE_CLASS; i++)
-    min_class_size[i] = 1000;
-
-  for (mode = VOIDmode; (int) mode < (int) MAX_MACHINE_MODE;
-       mode = (enum machine_mode) ((int) mode + 1))
-    {
-      if (GET_MODE_SIZE (mode) < min_class_size[(int) GET_MODE_CLASS (mode)])
-       {
-         class_narrowest_mode[(int) GET_MODE_CLASS (mode)] = mode;
-         min_class_size[(int) GET_MODE_CLASS (mode)] = GET_MODE_SIZE (mode);
-       }
-    }
-}
 
 /* These are utility functions used by fatal-error functions all over the
    code.  rtl.c happens to be linked by all the programs that need them,
@@ -980,7 +947,7 @@ static const char *
 trim_filename (name)
      const char *name;
 {
-  static const char *this_file = __FILE__;
+  static const char this_file[] = __FILE__;
   const char *p = name, *q = this_file;
 
   while (*p == *q && *p != 0 && *q != 0) p++, q++;
index 4a8e8d6fa1b0734479d28c531e15e5725f54cb05..357585e37f92123e86e27b547f6691c84971a711 100644 (file)
@@ -509,14 +509,15 @@ DEF_RTL_EXPR(TRAP_IF, "trap_if", "ee", 'x')
 /* numeric integer constant */
 DEF_RTL_EXPR(CONST_INT, "const_int", "w", 'o')
 
-/* numeric double constant.
-   Operand 0 is the MEM that stores this constant in memory,
-   or various other things (see comments at immed_double_const in varasm.c).
-   Operand 1 is a chain of all CONST_DOUBLEs in use in the current function.
-   Remaining operands hold the actual value.
-   The number of operands may be more than 2 if cross-compiling;
-   see init_rtl.  */
-DEF_RTL_EXPR(CONST_DOUBLE, "const_double", "e0ww", 'o')
+/* numeric floating point constant.
+   Operand 0 ('e') is the MEM that stores this constant in memory, or
+   various other things (see comments at immed_double_const in
+   varasm.c).
+   Operand 1 ('0') is a chain of all CONST_DOUBLEs in use in the
+   current function.
+   Remaining operands hold the actual value.  They are all 'w' and
+   there may be from 1 to 4; see rtl.c.  */
+DEF_RTL_EXPR(CONST_DOUBLE, "const_double", CONST_DOUBLE_FORMAT, 'o')
 
 /* String constant.  Used only for attributes right now.  */
 DEF_RTL_EXPR(CONST_STRING, "const_string", "s", 'o')
index c8c25d4e4fbaf6697f5d5f89c3d5e7a1e9b5f951..837dad1af6d5902a106687e45dc1582285d1d515 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -48,13 +48,13 @@ enum rtx_code  {
 #define NUM_RTX_CODE ((int)LAST_AND_UNUSED_RTX_CODE)
                                /* The cast here, saves many elsewhere.  */
 
-extern int rtx_length[];
+extern const int rtx_length[];
 #define GET_RTX_LENGTH(CODE)           (rtx_length[(int) (CODE)])
 
 extern const char * const rtx_name[];
 #define GET_RTX_NAME(CODE)             (rtx_name[(int) (CODE)])
 
-extern const char *rtx_format[];
+extern const char * const rtx_format[];
 #define GET_RTX_FORMAT(CODE)           (rtx_format[(int) (CODE)])
 
 extern const char rtx_class[];
index c3e3c271f6851edd48c944146300d7e7b772549d..0ed550a5163c75c2ba5e0069548db64932631c5a 100644 (file)
@@ -4498,27 +4498,24 @@ two places, the @file{md} file and in @code{NOTICE_UPDATE_CC}.
 
 @findex EXTRA_CC_MODES
 @item EXTRA_CC_MODES
-A list of names to be used for additional modes for condition code
-values in registers (@pxref{Jump Patterns}).  These names are added
-to @code{enum machine_mode} and all have class @code{MODE_CC}.  By
-convention, they should start with @samp{CC} and end with @samp{mode}.
+A list of additional modes for condition code values in registers 
+(@pxref{Jump Patterns}).  This macro should expand to a sequence of
+calls of the macro @code{CC} separated by white space.  @code{CC} takes
+two arguments.  The first is the enumeration name of the mode, which
+should begin with @samp{CC} and end with @samp{mode}.  The second is a C
+string giving the printable name of the mode; it should be the same as
+the first argument, but with the trailing @samp{mode} removed.
 
-You should only define this macro if your machine does not use @code{cc0}
-and only if additional modes are required.
-
-@findex EXTRA_CC_NAMES
-@item EXTRA_CC_NAMES
-A list of C strings giving the names for the modes listed in
-@code{EXTRA_CC_MODES}.  For example, the Sparc defines this macro and
-@code{EXTRA_CC_MODES} as
+You should only define this macro if additional modes are required.
 
+A sample definition of @code{EXTRA_CC_MODES} is:
 @smallexample
-#define EXTRA_CC_MODES CC_NOOVmode, CCFPmode, CCFPEmode
-#define EXTRA_CC_NAMES "CC_NOOV", "CCFP", "CCFPE"
+#define EXTRA_CC_MODES            \
+    CC(CC_NOOVmode, "CC_NOOV")    \
+    CC(CCFPmode, "CCFP")          \
+    CC(CCFPEmode, "CCFPE")
 @end smallexample
 
-This macro is not required if @code{EXTRA_CC_MODES} is not defined.
-
 @findex SELECT_CC_MODE
 @item SELECT_CC_MODE (@var{op}, @var{x}, @var{y})
 Returns a mode from class @code{MODE_CC} to be used when comparison
index 5acf1312d839fef5a4d14669c3b729affdf6fbd6..112c89133b4871c1dd8e49765571fc663d4813d1 100644 (file)
@@ -153,7 +153,6 @@ extern void finish_parse ();
 extern void init_decl_processing ();
 extern void init_obstacks ();
 extern void init_tree_codes ();
-extern void init_rtl ();
 extern void init_regs ();
 extern void init_optabs ();
 extern void init_stmt ();
@@ -2895,7 +2894,6 @@ compile_file (name)
   init_obstacks ();
   init_tree_codes ();
   name = init_parse (name);
-  init_rtl ();
   init_emit_once (debug_info_level == DINFO_LEVEL_NORMAL
                  || debug_info_level == DINFO_LEVEL_VERBOSE
                  || flag_test_coverage