S/390: Add alternate processor names.
authorAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Mon, 12 Sep 2016 14:32:02 +0000 (16:32 +0200)
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Mon, 12 Sep 2016 14:32:02 +0000 (16:32 +0200)
This patch adds alternate CPU names which adhere to the number of the
architecture document.  So instead of having z196, zEC12, and z13 you
can use arch9, arch10, and arch11.  The old cpu names stay valid and
should primarily be used.

The alternate names are supposed to improve compatibility with the IBM
XL compiler toolchain which uses the arch numbering.

opcodes/ChangeLog:

2016-09-12  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* s390-mkopc.c (main): Support alternate arch strings.

gas/ChangeLog:

2016-09-12  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* config/tc-s390.c (s390_parse_cpu): Support alternate arch
strings.
* doc/as.texinfo: Document new arch strings.
* doc/c-s390.texi: Likewise.

gas/ChangeLog
gas/config/tc-s390.c
gas/doc/as.texinfo
gas/doc/c-s390.texi
opcodes/ChangeLog
opcodes/s390-mkopc.c

index c2dadcb0a54b65fbebdad924a1e135fbb9528e1d..6544175eb6f4da0d9279e332eea19d3d7b120a7e 100644 (file)
@@ -1,3 +1,10 @@
+2016-09-12  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
+
+       * config/tc-s390.c (s390_parse_cpu): Support alternate arch
+       strings.
+       * doc/as.texinfo: Document new arch strings.
+       * doc/c-s390.texi: Likewise.
+
 2016-09-12  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
 
        * config/tc-s390.c: Set all facitily bits by default
index ec3c5e52acb08ba7ea5b16de7e133fabce31e3c5..356bbb0c7927c055de3bdccddd25c07d2a8248a3 100644 (file)
@@ -272,20 +272,24 @@ s390_parse_cpu (const char *         arg,
   static struct
   {
     const char * name;
-    unsigned int len;
+    unsigned int name_len;
+    const char * alt_name;
+    unsigned int alt_name_len;
     unsigned int flags;
   } cpu_table[S390_OPCODE_MAXCPU] =
   {
-    { STRING_COMMA_LEN ("g5"), 0 },
-    { STRING_COMMA_LEN ("g6"), 0 },
-    { STRING_COMMA_LEN ("z900"), 0 },
-    { STRING_COMMA_LEN ("z990"), 0 },
-    { STRING_COMMA_LEN ("z9-109"), 0 },
-    { STRING_COMMA_LEN ("z9-ec"), 0 },
-    { STRING_COMMA_LEN ("z10"), 0 },
-    { STRING_COMMA_LEN ("z196"), 0 },
-    { STRING_COMMA_LEN ("zEC12"), S390_INSTR_FLAG_HTM },
-    { STRING_COMMA_LEN ("z13"), S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX }
+    { STRING_COMMA_LEN ("g5"), STRING_COMMA_LEN ("arch3"), 0 },
+    { STRING_COMMA_LEN ("g6"), STRING_COMMA_LEN (""), 0 },
+    { STRING_COMMA_LEN ("z900"), STRING_COMMA_LEN ("arch5"), 0 },
+    { STRING_COMMA_LEN ("z990"), STRING_COMMA_LEN ("arch6"), 0 },
+    { STRING_COMMA_LEN ("z9-109"), STRING_COMMA_LEN (""), 0 },
+    { STRING_COMMA_LEN ("z9-ec"), STRING_COMMA_LEN ("arch7"), 0 },
+    { STRING_COMMA_LEN ("z10"), STRING_COMMA_LEN ("arch8"), 0 },
+    { STRING_COMMA_LEN ("z196"), STRING_COMMA_LEN ("arch9"), 0 },
+    { STRING_COMMA_LEN ("zEC12"), STRING_COMMA_LEN ("arch10"),
+      S390_INSTR_FLAG_HTM },
+    { STRING_COMMA_LEN ("z13"), STRING_COMMA_LEN ("arch11"),
+      S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX }
   };
   static struct
   {
@@ -312,18 +316,32 @@ s390_parse_cpu (const char *         arg,
     {
       for (icpu = 0; icpu < S390_OPCODE_MAXCPU; icpu++)
        {
-         unsigned int l;
+         unsigned int l, l_alt;
+
+         l = cpu_table[icpu].name_len;
 
-         l = cpu_table[icpu].len;
          if (strncmp (arg, cpu_table[icpu].name, l) == 0
              && (arg[l] == 0 || arg[l] == '+'))
            {
              arg += l;
              break;
            }
+
+         l_alt = cpu_table[icpu].alt_name_len;
+
+         if (l_alt > 0
+             && strncmp (arg, cpu_table[icpu].alt_name, l_alt) == 0
+             && (arg[l_alt] == 0 || arg[l_alt] == '+'))
+           {
+             arg += l_alt;
+             break;
+           }
        }
     }
 
+  if (icpu == S390_OPCODE_MAXCPU)
+    return S390_OPCODE_MAXCPU;
+
   ilp_bak = input_line_pointer;
   if (icpu != S390_OPCODE_MAXCPU)
     {
index 9ebfda007101df6b269c0b67591039c776fafd02..d09e0d4215326ea626475f6bc137440d4279ccb9 100644 (file)
@@ -1654,9 +1654,11 @@ Select the word size, either 31/32 bits or 64 bits.
 Select the architecture mode, either the Enterprise System
 Architecture (esa) or the z/Architecture mode (zarch).
 @item -march=@var{processor}
-Specify which s390 processor variant is the target, @samp{g6}, @samp{g6},
-@samp{z900}, @samp{z990}, @samp{z9-109}, @samp{z9-ec}, @samp{z10},
-@samp{z196}, @samp{zEC12}, or @samp{z13}.
+Specify which s390 processor variant is the target, @samp{g5} (or
+@samp{arch3}), @samp{g6}, @samp{z900} (or @samp{arch5}), @samp{z990} (or
+@samp{arch6}), @samp{z9-109}, @samp{z9-ec} (or @samp{arch7}), @samp{z10} (or
+@samp{arch8}), @samp{z196} (or @samp{arch9}), @samp{zEC12} (or @samp{arch10}),
+or @samp{z13} (or @samp{arch11}).
 @item -mregnames
 @itemx -mno-regnames
 Allow or disallow symbolic names for registers.
index e3277cb06e6511597e221f3b6a0328990a2ab115..1cbf30826a124f0527ad31ae6ed503b19f3e2483 100644 (file)
 @cindex s390 support
 
 The s390 version of @code{@value{AS}} supports two architectures modes
-and seven chip levels. The architecture modes are the Enterprise System
+and ten chip levels. The architecture modes are the Enterprise System
 Architecture (ESA) and the newer z/Architecture mode. The chip levels
-are g5, g6, z900, z990, z9-109, z9-ec, z10, z196, zEC12, and z13.
+are g5 (or arch3), g6, z900 (or arch5), z990 (or arch6), z9-109, z9-ec
+(or arch7), z10 (or arch8), z196 (or arch9), zEC12 (or arch10), and
+z13 (or arch11).
 
 @menu
 * s390 Options::                Command-line Options.
@@ -58,19 +60,31 @@ message.
 @item -march=@var{CPU}
 This option specifies the target processor. The following processor names
 are recognized:
-@code{g5},
+@code{g5} (or @code{arch3}),
 @code{g6},
-@code{z900},
-@code{z990},
+@code{z900} (or @code{arch5}),
+@code{z990} (or @code{arch6}),
 @code{z9-109},
-@code{z9-ec},
-@code{z10},
-@code{z196},
-@code{zEC12}, and
-@code{z13}.
-Assembling an instruction that is not supported on the target processor
-results in an error message. Do not specify @code{g5} or @code{g6}
-with @samp{-mzarch}.
+@code{z9-ec} (or @code{arch7}),
+@code{z10} (or @code{arch8}),
+@code{z196} (or @code{arch9}),
+@code{zEC12} (or @code{arch10}) and
+@code{z13} (or @code{arch11}).
+
+Assembling an instruction that is not supported on the target
+processor results in an error message.
+
+The processor names starting with @code{arch} refer to the edition
+number in the Principle of Operations manual.  They can be used as
+alternate processor names and have been added for compatibility with
+the IBM XL compiler.
+
+@code{arch3}, @code{g5} and @code{g6} cannot be used with the
+@samp{-mzarch} option since the z/Architecture mode is not supported
+on these processor levels.
+
+There is no @code{arch4} option supported. @code{arch4} matches
+@code{-march=arch5 -mesa}.
 
 @cindex @samp{-mregnames} option, s390
 @item -mregnames
index b36b52ecb7f2634f8d0025788db414ccd6df3605..82eeec384211aafc78a017016757fe37cddafcec 100644 (file)
@@ -1,3 +1,7 @@
+2016-09-12  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
+
+       * s390-mkopc.c (main): Support alternate arch strings.
+
 2016-09-12  Patrick Steuer  <steuer@linux.vnet.ibm.com>
 
        * s390-opc.txt: Fix kmctr instruction type.
index 08ed56db055762ba90bfe22f3f6f98485eba3801..d8ac6105b9ea7963354e364676750fdbb4b59ba3 100644 (file)
@@ -334,7 +334,7 @@ main (void)
       char  *str;
 
       if (currentLine[0] == '#' || currentLine[0] == '\n')
-        continue;
+       continue;
       memset (opcode, 0, 8);
       num_matched =
        sscanf (currentLine, "%15s %15s %15s \"%79[^\"]\" %15s %15s %79[^\n]",
@@ -346,25 +346,33 @@ main (void)
          exit (1);
        }
 
-      if (strcmp (cpu_string, "g5") == 0)
+      if (strcmp (cpu_string, "g5") == 0
+         || strcmp (cpu_string, "arch3") == 0)
        min_cpu = S390_OPCODE_G5;
       else if (strcmp (cpu_string, "g6") == 0)
        min_cpu = S390_OPCODE_G6;
-      else if (strcmp (cpu_string, "z900") == 0)
+      else if (strcmp (cpu_string, "z900") == 0
+              || strcmp (cpu_string, "arch5") == 0)
        min_cpu = S390_OPCODE_Z900;
-      else if (strcmp (cpu_string, "z990") == 0)
+      else if (strcmp (cpu_string, "z990") == 0
+              || strcmp (cpu_string, "arch6") == 0)
        min_cpu = S390_OPCODE_Z990;
       else if (strcmp (cpu_string, "z9-109") == 0)
        min_cpu = S390_OPCODE_Z9_109;
-      else if (strcmp (cpu_string, "z9-ec") == 0)
+      else if (strcmp (cpu_string, "z9-ec") == 0
+              || strcmp (cpu_string, "arch7") == 0)
        min_cpu = S390_OPCODE_Z9_EC;
-      else if (strcmp (cpu_string, "z10") == 0)
+      else if (strcmp (cpu_string, "z10") == 0
+              || strcmp (cpu_string, "arch8") == 0)
        min_cpu = S390_OPCODE_Z10;
-      else if (strcmp (cpu_string, "z196") == 0)
+      else if (strcmp (cpu_string, "z196") == 0
+              || strcmp (cpu_string, "arch9") == 0)
        min_cpu = S390_OPCODE_Z196;
-      else if (strcmp (cpu_string, "zEC12") == 0)
+      else if (strcmp (cpu_string, "zEC12") == 0
+              || strcmp (cpu_string, "arch10") == 0)
        min_cpu = S390_OPCODE_ZEC12;
-      else if (strcmp (cpu_string, "z13") == 0)
+      else if (strcmp (cpu_string, "z13") == 0
+              || strcmp (cpu_string, "arch11") == 0)
        min_cpu = S390_OPCODE_Z13;
       else {
        fprintf (stderr, "Couldn't parse cpu string %s\n", cpu_string);
This page took 0.033819 seconds and 4 git commands to generate.