- if (strcmp (arg, "g5") == 0)
- return S390_OPCODE_G5;
- else if (strcmp (arg, "g6") == 0)
- return S390_OPCODE_G6;
- else if (strcmp (arg, "z900") == 0)
- return S390_OPCODE_Z900;
- else if (strcmp (arg, "z990") == 0)
- return S390_OPCODE_Z990;
- else if (strcmp (arg, "z9-109") == 0)
- return S390_OPCODE_Z9_109;
- else if (strcmp (arg, "z9-ec") == 0)
- return S390_OPCODE_Z9_EC;
- else if (strcmp (arg, "z10") == 0)
- return S390_OPCODE_Z10;
- else if (strcmp (arg, "z196") == 0)
- return S390_OPCODE_Z196;
- else if (strcmp (arg, "zEC12") == 0)
- return S390_OPCODE_ZEC12;
- else if (strcmp (arg, "z13") == 0)
- return S390_OPCODE_Z13;
- else if (strcmp (arg, "all") == 0)
- return S390_OPCODE_MAXCPU - 1;
+ static struct
+ {
+ const char * name;
+ 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"), 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 },
+ { STRING_COMMA_LEN ("z14"), STRING_COMMA_LEN ("arch12"),
+ S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX },
+ { STRING_COMMA_LEN ("z15"), STRING_COMMA_LEN ("arch13"),
+ S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX }
+ };
+ static struct
+ {
+ const char * name;
+ unsigned int mask;
+ bfd_boolean on;
+ } cpu_flags[] =
+ {
+ { "htm", S390_INSTR_FLAG_HTM, TRUE },
+ { "nohtm", S390_INSTR_FLAG_HTM, FALSE },
+ { "vx", S390_INSTR_FLAG_VX, TRUE },
+ { "novx", S390_INSTR_FLAG_VX, FALSE }
+ };
+ unsigned int icpu;
+ char *ilp_bak;
+
+ icpu = S390_OPCODE_MAXCPU;
+ if (strncmp (arg, "all", 3) == 0 && (arg[3] == 0 || arg[3] == '+'))
+ {
+ icpu = S390_OPCODE_MAXCPU - 1;
+ arg += 3;
+ }