S/390: Add alternate processor names.
[deliverable/binutils-gdb.git] / gas / config / tc-s390.c
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)
     {
This page took 0.023882 seconds and 4 git commands to generate.