OSDN Git Service

* config/alpha/alpha.h (TARGET_CPU_EV5, TARGET_CPU_EV6): Define.
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 15 Sep 2000 18:10:11 +0000 (18:10 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 15 Sep 2000 18:10:11 +0000 (18:10 +0000)
(TARGET_OPTIONS): Add tune=.
(alpha_tune_string): Declare.
* config/alpha/alpha.c (override_options): Add cpu_table.
Use alpha_cpu_string first to set both alpha_cpu and target_flags
and then alpha_tune_string to set alpha_cpu only.
Replace tests for PROCESSOR_EV* with TARGET_CPU_EV* tests.
* config/alpha/elf.h (ASM_FILE_START): Likewise.
* config/alpha/osf.h (ASM_FILE_START): Likewise.
* config/alpha/openbsd.h (ASM_FILE_START): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36443 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/alpha/alpha.c
gcc/config/alpha/alpha.h
gcc/config/alpha/elf.h
gcc/config/alpha/openbsd.h
gcc/config/alpha/osf.h

index f57d5df..c823362 100644 (file)
@@ -1,3 +1,16 @@
+2000-09-15  Jakub Jelinek  <jakub@redhat.com>
+
+       * config/alpha/alpha.h (TARGET_CPU_EV5, TARGET_CPU_EV6): Define.
+       (TARGET_OPTIONS): Add tune=.
+       (alpha_tune_string): Declare.
+       * config/alpha/alpha.c (override_options): Add cpu_table.
+       Use alpha_cpu_string first to set both alpha_cpu and target_flags
+       and then alpha_tune_string to set alpha_cpu only.
+       Replace tests for PROCESSOR_EV* with TARGET_CPU_EV* tests.
+       * config/alpha/elf.h (ASM_FILE_START): Likewise.
+       * config/alpha/osf.h (ASM_FILE_START): Likewise.
+       * config/alpha/openbsd.h (ASM_FILE_START): Likewise.
+
 Fri Sep 15 19:45:55 MET DST 2000  Jan Hubicka  <jh@suse.cz>
 
        * i386-protos.h (no_comparison_operator, uno_comparison_operator):
index f14c3cf..04d8cc9 100644 (file)
@@ -70,6 +70,7 @@ enum alpha_fp_trap_mode alpha_fptm;
 /* Strings decoded into the above options.  */
 
 const char *alpha_cpu_string;  /* -mcpu= */
+const char *alpha_tune_string; /* -mtune= */
 const char *alpha_tp_string;   /* -mtrap-precision=[p|s|i] */
 const char *alpha_fprm_string; /* -mfp-rounding-mode=[n|m|c|d] */
 const char *alpha_fptm_string; /* -mfp-trap-mode=[n|u|su|sui] */
@@ -146,6 +147,31 @@ static rtx alpha_emit_xfloating_compare
 void
 override_options ()
 {
+  int i;
+  static struct cpu_table {
+    const char *name;
+    enum processor_type processor;
+    int flags;
+  } cpu_table[] = {
+#define EV5_MASK (MASK_CPU_EV5)
+#define EV6_MASK (MASK_CPU_EV6|MASK_BWX|MASK_MAX|MASK_FIX)
+    { "ev4",   PROCESSOR_EV4, 0 },
+    { "ev45",  PROCESSOR_EV4, 0 },
+    { "21064", PROCESSOR_EV4, 0 },
+    { "ev5",   PROCESSOR_EV5, EV5_MASK },
+    { "21164", PROCESSOR_EV5, EV5_MASK },
+    { "ev56",  PROCESSOR_EV5, EV5_MASK|MASK_BWX },
+    { "21164a",        PROCESSOR_EV5, EV5_MASK|MASK_BWX },
+    { "pca56", PROCESSOR_EV5, EV5_MASK|MASK_BWX|MASK_MAX },
+    { "21164PC",PROCESSOR_EV5, EV5_MASK|MASK_BWX|MASK_MAX },
+    { "21164pc",PROCESSOR_EV5, EV5_MASK|MASK_BWX|MASK_MAX },
+    { "ev6",   PROCESSOR_EV6, EV6_MASK },
+    { "21264", PROCESSOR_EV6, EV6_MASK },
+    { "ev67",  PROCESSOR_EV6, EV6_MASK|MASK_CIX },
+    { "21264a",        PROCESSOR_EV6, EV6_MASK|MASK_CIX },
+    { 0, 0, 0 }
+  };
+                  
   alpha_tp = ALPHA_TP_PROG;
   alpha_fprm = ALPHA_FPRM_NORM;
   alpha_fptm = ALPHA_FPTM_N;
@@ -209,61 +235,41 @@ override_options ()
 
   if (alpha_cpu_string)
     {
-      if (! strcmp (alpha_cpu_string, "ev4")
-         || ! strcmp (alpha_cpu_string, "ev45")
-         || ! strcmp (alpha_cpu_string, "21064"))
-       {
-         alpha_cpu = PROCESSOR_EV4;
-         target_flags &= ~ (MASK_BWX | MASK_MAX | MASK_FIX | MASK_CIX);
-       }
-      else if (! strcmp (alpha_cpu_string, "ev5")
-              || ! strcmp (alpha_cpu_string, "21164"))
-       {
-         alpha_cpu = PROCESSOR_EV5;
-         target_flags &= ~ (MASK_BWX | MASK_MAX | MASK_FIX | MASK_CIX);
-       }
-      else if (! strcmp (alpha_cpu_string, "ev56")
-              || ! strcmp (alpha_cpu_string, "21164a"))
-       {
-         alpha_cpu = PROCESSOR_EV5;
-         target_flags |= MASK_BWX;
-         target_flags &= ~ (MASK_MAX | MASK_FIX | MASK_CIX);
-       }
-      else if (! strcmp (alpha_cpu_string, "pca56")
-              || ! strcmp (alpha_cpu_string, "21164PC")
-              || ! strcmp (alpha_cpu_string, "21164pc"))
-       {
-         alpha_cpu = PROCESSOR_EV5;
-         target_flags |= MASK_BWX | MASK_MAX;
-         target_flags &= ~ (MASK_FIX | MASK_CIX);
-       }
-      else if (! strcmp (alpha_cpu_string, "ev6")
-              || ! strcmp (alpha_cpu_string, "21264"))
-       {
-         alpha_cpu = PROCESSOR_EV6;
-         target_flags |= MASK_BWX | MASK_MAX | MASK_FIX;
-         target_flags &= ~ (MASK_CIX);
-       }
-      else if (! strcmp (alpha_cpu_string, "ev67")
-              || ! strcmp (alpha_cpu_string, "21264a"))
-       {
-         alpha_cpu = PROCESSOR_EV6;
-         target_flags |= MASK_BWX | MASK_MAX | MASK_FIX | MASK_CIX;
-       }
-      else
+      for (i = 0; cpu_table [i].name; i++)
+       if (! strcmp (alpha_cpu_string, cpu_table [i].name))
+         {
+           alpha_cpu = cpu_table [i].processor;
+           target_flags &= ~ (MASK_BWX | MASK_MAX | MASK_FIX | MASK_CIX
+                              | MASK_CPU_EV5 | MASK_CPU_EV6);
+           target_flags |= cpu_table [i].flags;
+           break;
+         }
+      if (! cpu_table [i].name)
        error ("bad value `%s' for -mcpu switch", alpha_cpu_string);
     }
 
+  if (alpha_tune_string)
+    {
+      for (i = 0; cpu_table [i].name; i++)
+       if (! strcmp (alpha_tune_string, cpu_table [i].name))
+         {
+           alpha_cpu = cpu_table [i].processor;
+           break;
+         }
+      if (! cpu_table [i].name)
+       error ("bad value `%s' for -mcpu switch", alpha_tune_string);
+    }
+
   /* Do some sanity checks on the above options. */
 
   if ((alpha_fptm == ALPHA_FPTM_SU || alpha_fptm == ALPHA_FPTM_SUI)
-      && alpha_tp != ALPHA_TP_INSN && alpha_cpu != PROCESSOR_EV6)
+      && alpha_tp != ALPHA_TP_INSN && ! TARGET_CPU_EV6)
     {
       warning ("fp software completion requires -mtrap-precision=i");
       alpha_tp = ALPHA_TP_INSN;
     }
 
-  if (alpha_cpu == PROCESSOR_EV6)
+  if (TARGET_CPU_EV6)
     {
       /* Except for EV6 pass 1 (not released), we always have precise
         arithmetic traps.  Which means we can do software completion
index 878a9c3..db8d407 100644 (file)
@@ -156,12 +156,14 @@ extern enum alpha_fp_trap_mode alpha_fptm;
 #define MASK_CIX       (1 << 11)
 #define TARGET_CIX     (target_flags & MASK_CIX)
 
-/* This means that the processor is an EV5, EV56, or PCA56.  This is defined
-   only in TARGET_CPU_DEFAULT.  */
+/* This means that the processor is an EV5, EV56, or PCA56.
+   Unlike alpha_cpu this is not affected by -mtune= setting.  */
 #define MASK_CPU_EV5   (1 << 28)
+#define TARGET_CPU_EV5 (target_flags & MASK_CPU_EV5)
 
 /* Likewise for EV6.  */
 #define MASK_CPU_EV6   (1 << 29)
+#define TARGET_CPU_EV6 (target_flags & MASK_CPU_EV6)
 
 /* This means we support the .arch directive in the assembler.  Only
    defined in TARGET_CPU_DEFAULT.  */
@@ -249,6 +251,7 @@ extern enum alpha_fp_trap_mode alpha_fptm;
        #define TARGET_OPTIONS { { "short-data-", &m88k_short_data } }  */
 
 extern const char *alpha_cpu_string;   /* For -mcpu= */
+extern const char *alpha_tune_string;  /* For -mtune= */
 extern const char *alpha_fprm_string;  /* For -mfp-rounding-mode=[n|m|c|d] */
 extern const char *alpha_fptm_string;  /* For -mfp-trap-mode=[n|u|su|sui]  */
 extern const char *alpha_tp_string;    /* For -mtrap-precision=[p|f|i] */
@@ -257,7 +260,9 @@ extern const char *alpha_mlat_string;       /* For -mmemory-latency= */
 #define TARGET_OPTIONS                                 \
 {                                                      \
   {"cpu=",             &alpha_cpu_string,              \
-   N_("Generate code for a given CPU")},               \
+   N_("Use features of and schedule given CPU")},      \
+  {"tune=",            &alpha_tune_string,             \
+   N_("Schedule given CPU")},                          \
   {"fp-rounding-mode=",        &alpha_fprm_string,             \
    N_("Control the generated fp rounding mode")},      \
   {"fp-trap-mode=",    &alpha_fptm_string,             \
index 7fad446..e4b633a 100644 (file)
@@ -61,7 +61,7 @@ do {                                                          \
   if (TARGET_BWX | TARGET_MAX | TARGET_FIX | TARGET_CIX)       \
     {                                                          \
       fprintf (FILE, "\t.arch %s\n",                           \
-               (alpha_cpu == PROCESSOR_EV6 ? "ev6"             \
+               (TARGET_CPU_EV6 ? "ev6"                         \
                 : TARGET_MAX ? "pca56" : "ev56"));             \
     }                                                          \
 } while (0)
index 60591d5..72764ff 100644 (file)
@@ -100,8 +100,8 @@ Boston, MA 02111-1307, USA.  */
   fprintf (FILE, "\t.set noat\n");                             \
   if (TARGET_SUPPORT_ARCH)                                     \
     fprintf (FILE, "\t.arch %s\n",                             \
-             alpha_cpu == PROCESSOR_EV6 ? "ev6"                        \
-            : (alpha_cpu == PROCESSOR_EV5                      \
+             TARGET_CPU_EV6 ? "ev6"                            \
+            : (TARGET_CPU_EV5                                  \
                ? (TARGET_MAX ? "pca56" : TARGET_BWX ? "ev56" : "ev5") \
                : "ev4"));                                      \
                                                                \
index c6760bc..100b153 100644 (file)
@@ -70,8 +70,8 @@ Boston, MA 02111-1307, USA.  */
   fprintf (FILE, "\t.set noat\n");                             \
   if (TARGET_SUPPORT_ARCH)                                     \
     fprintf (FILE, "\t.arch %s\n",                             \
-             alpha_cpu == PROCESSOR_EV6 ? "ev6"                        \
-            : (alpha_cpu == PROCESSOR_EV5                      \
+             TARGET_CPU_EV6 ? "ev6"                            \
+            : (TARGET_CPU_EV5                                  \
                ? (TARGET_MAX ? "pca56" : TARGET_BWX ? "ev56" : "ev5") \
                : "ev4"));                                      \
                                                                \