MIPS/GAS: Fix an ISA override not lifting ABI restrictions
authorMaciej W. Rozycki <macro@imgtec.com>
Fri, 22 Apr 2016 00:04:52 +0000 (01:04 +0100)
committerMaciej W. Rozycki <macro@imgtec.com>
Fri, 22 Apr 2016 00:22:29 +0000 (01:22 +0100)
commit22522f880a8e17a17c4f195796ec89caece7652b
tree829393be40df8d64dd9d373c9d5bad11248df21b
parent3877922e56a9e44fed0ca72e64cad7578e6b1ed5
MIPS/GAS: Fix an ISA override not lifting ABI restrictions

Correct a regression introduced with commit 919731affbef ("Add MIPS
.module directive") causing code like:

.set mips3
dli $2, 0x9000000080000000

to fail assembly with the following error message produced:

Error: number (0x9000000080000000) larger than 32 bits

if built with `mips3' selected as the global ISA (e.g. `-march=mips3').
This is because a `.set' directive doing an ISA override does not lift
the ABI restriction on register sizes if the ISA remains unchanged.
Previously the directive always set register sizes from the ISA chosen,
which is what some code expects.  Restore the old semantics then.

gas/
* config/tc-mips.c (code_option_type): New enum.
(parse_code_option): Return status indicating option type.
(s_mipsset): Update `parse_code_option' call site accordingly.
Always set register sizes from the ISA with ISA overrides.
(s_module): Update `parse_code_option' call site.
* testsuite/gas/mips/isa-override-1.d: New test.
* testsuite/gas/mips/micromips@isa-override-1.d: New test.
* testsuite/gas/mips/mips1@isa-override-1.d: New test.
* testsuite/gas/mips/mips2@isa-override-1.d: New test.
* testsuite/gas/mips/mips32@isa-override-1.d: New test.
* testsuite/gas/mips/mips32r2@isa-override-1.d: New test.
* testsuite/gas/mips/mips32r3@isa-override-1.d: New test.
* testsuite/gas/mips/mips32r5@isa-override-1.d: New test.
* testsuite/gas/mips/mips32r6@isa-override-1.d: New test.
* testsuite/gas/mips/mips64r2@isa-override-1.d: New test.
* testsuite/gas/mips/mips64r3@isa-override-1.d: New test.
* testsuite/gas/mips/mips64r5@isa-override-1.d: New test.
* testsuite/gas/mips/mips64r6@isa-override-1.d: New test.
* testsuite/gas/mips/r3000@isa-override-1.d: New test.
* testsuite/gas/mips/r3900@isa-override-1.d: New test.
* testsuite/gas/mips/r5900@isa-override-1.d: New test.
* testsuite/gas/mips/octeon@isa-override-1.d: New test.
* testsuite/gas/mips/octeon3@isa-override-1.d: New test.
* testsuite/gas/mips/isa-override-2.l: New list test.
* testsuite/gas/mips/mips1@isa-override-2.l: New list test.
* testsuite/gas/mips/mips2@isa-override-2.l: New list test.
* testsuite/gas/mips/mips32@isa-override-2.l: New list test.
* testsuite/gas/mips/mips32r2@isa-override-2.l: New list test.
* testsuite/gas/mips/mips32r3@isa-override-2.l: New list test.
* testsuite/gas/mips/mips32r5@isa-override-2.l: New list test.
* testsuite/gas/mips/mips32r6@isa-override-2.l: New list test.
* testsuite/gas/mips/r3000@isa-override-2.l: New list test.
* testsuite/gas/mips/r3900@isa-override-2.l: New list test.
* testsuite/gas/mips/octeon3@isa-override-2.l: New list test.
* testsuite/gas/mips/octeon3@isa-override-1.l: New stderr
output.
* testsuite/gas/mips/isa-override-1.s: New test source.
* testsuite/gas/mips/r5900@isa-override-1.s: New test source.
* testsuite/gas/mips/isa-override-2.s: New test source.
* testsuite/gas/mips/mips1@isa-override-2.s: New test source.
* testsuite/gas/mips/mips2@isa-override-2.s: New test source.
* testsuite/gas/mips/mips32@isa-override-2.s: New test source.
* testsuite/gas/mips/mips32r2@isa-override-2.s: New test source.
* testsuite/gas/mips/mips32r3@isa-override-2.s: New test source.
* testsuite/gas/mips/mips32r5@isa-override-2.s: New test source.
* testsuite/gas/mips/mips32r6@isa-override-2.s: New test source.
* testsuite/gas/mips/r3000@isa-override-2.s: New test source.
* testsuite/gas/mips/r3900@isa-override-2.s: New test source.
* testsuite/gas/mips/octeon3@isa-override-2.s: New test source.
* testsuite/gas/mips/mips.exp: Run the new tests.
46 files changed:
gas/ChangeLog
gas/config/tc-mips.c
gas/testsuite/gas/mips/isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/isa-override-1.s [new file with mode: 0644]
gas/testsuite/gas/mips/isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/micromips@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips.exp
gas/testsuite/gas/mips/mips1@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips1@isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/mips1@isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips2@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips2@isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/mips2@isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips32@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips32@isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/mips32@isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r2@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r2@isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r2@isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r3@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r3@isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r3@isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r5@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r5@isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r5@isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r6@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r6@isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r6@isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips64r2@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips64r3@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips64r5@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips64r6@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/octeon3@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/octeon3@isa-override-1.l [new file with mode: 0644]
gas/testsuite/gas/mips/octeon3@isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/octeon3@isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/octeon@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/r3000@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/r3000@isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/r3000@isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/r3900@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/r3900@isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/r3900@isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/r5900@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/r5900@isa-override-1.s [new file with mode: 0644]