diff options
author | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2016-09-12 16:32:02 +0200 |
---|---|---|
committer | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2016-09-12 16:32:02 +0200 |
commit | 952c3f51ac994f5e98aa829076609124cf9e5243 (patch) | |
tree | 7e9c42ce478209b9b242bb46d078ae397f39fd80 /gas/config/tc-s390.c | |
parent | 58af639728582db42765e6f2c73ea61e75b66c8e (diff) | |
download | gdb-952c3f51ac994f5e98aa829076609124cf9e5243.zip gdb-952c3f51ac994f5e98aa829076609124cf9e5243.tar.gz gdb-952c3f51ac994f5e98aa829076609124cf9e5243.tar.bz2 |
S/390: Add alternate processor names.
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.
Diffstat (limited to 'gas/config/tc-s390.c')
-rw-r--r-- | gas/config/tc-s390.c | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c index ec3c5e5..356bbb0 100644 --- a/gas/config/tc-s390.c +++ b/gas/config/tc-s390.c @@ -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) { |