binutils-gdb/include
Jose E. Marchesi 6884417a0f gas,opcodes: fix hardware capabilities bumping in the sparc assembler.
When the assembler finds an instruction which is part of a higher
opcode architecture it bumps the current opcode architecture.  For
example:

   $ echo "mwait" | as -bump
   {standard input}: Assembler messages:
   {standard input}:1: Warning: architecture bumped from "v6" to "v9m" on "mwait"

However, when two instructions pertaining to the same opcode
architecture but associated to different SPARC hardware capabilities
are found in the input stream, and no GAS architecture is specified in
the command line, the assembler bangs:

   $ echo "mwait; wr %g0,%g1,%mcdper" | as -bump
   {standard input}: Assembler messages:
   {standard input}:1: Warning: architecture bumped from "v6" to "v9m" on "mwait"
   {standard input}:1: Error: Hardware capability "sparc5" not enabled for "wr".

... and it should'nt, as WRMCDPER pertains to the same architecture
level than MWAIT.

This patch fixes this by extending the definition of sparc opcode
architectures to contain a set of hardware capabilities and making the
assembler to take these capabilities into account when updating the
set of allowed hwcaps when an architecture bump is triggered by some
instruction.

This way, hwcaps associated to architecture levels are maintained in
opcodes, while the assembler keeps the flexibiity of defining GAS
architectures including additional hwcaps (like -Asparcfmaf or the
v8plus* variants).

A test covering this failure case is included.

gas/ChangeLog:

2016-11-22  Jose E. Marchesi  <jose.marchesi@oracle.com>

       	* config/tc-sparc.c: Move HWS_* and HWS2_* definitions to
       	opcodes/sparc-opc.c.
       	(sparc_arch): Clarify the new role of the hwcap_allowed and
       	hwcap2_allowed fields.
       	(sparc_arch_table): Remove HWS_* and HWS2_* instances from
       	hwcap_allowed and hwcap2_allowed respectively.
       	(md_parse_option): Include the opcode arch hwcaps when processing
       	-A.
       	(sparc_ip): Use the current opcode arch hwcaps to update
       	hwcap_allowed, as well of the hwcaps of the instruction triggering
       	the bump.
       	* testsuite/gas/sparc/hwcaps-bump.s: New file.
       	* testsuite/gas/sparc/hwcaps-bump.l: Likewise.
       	* testsuite/gas/sparc/sparc.exp (gas_64_check): Run tests in
       	hwcaps-bump.

include/ChangeLog:

2016-11-22  Jose E. Marchesi  <jose.marchesi@oracle.com>

       	* opcode/sparc.h (sparc_opcode_arch): New fields hwcaps and
       	hwcaps2.

opcodes/ChangeLog:

2016-11-22  Jose E. Marchesi  <jose.marchesi@oracle.com>

       	* sparc-opc.c (HWS_V8): Definition moved from
       	gas/config/tc-sparc.c.
       	(HWS_V9): Likewise.
       	(HWS_VA): Likewise.
       	(HWS_VB): Likewise.
       	(HWS_VC): Likewise.
       	(HWS_VD): Likewise.
       	(HWS_VE): Likewise.
       	(HWS_VV): Likewise.
       	(HWS_VM): Likewise.
       	(HWS2_VM): Likewise.
       	(sparc_opcode_archs): Initialize hwcaps and hwcaps2 fields of
       	existing entries.
2016-11-22 04:40:37 -08:00
..
aout Copyright update for binutils 2016-01-01 23:00:01 +10:30
cgen Copyright update for binutils 2016-01-01 23:00:01 +10:30
coff sparc-coff writing uninitialized memory 2016-06-11 17:25:35 +09:30
elf Add support for RISC-V architecture. 2016-11-01 16:45:57 +00:00
gdb Pass SIGLIBRT directly to child processes. 2016-07-15 06:35:37 -07:00
mach-o Copyright update for binutils 2016-01-01 23:00:01 +10:30
nlm Copyright update for binutils 2016-01-01 23:00:01 +10:30
opcode gas,opcodes: fix hardware capabilities bumping in the sparc assembler. 2016-11-22 04:40:37 -08:00
som Copyright update for binutils 2016-01-01 23:00:01 +10:30
vms Copyright update for binutils 2016-01-01 23:00:01 +10:30
COPYING
COPYING3
ChangeLog gas,opcodes: fix hardware capabilities bumping in the sparc assembler. 2016-11-22 04:40:37 -08:00
ChangeLog-0415 binutils ChangeLog rotation 2016-01-01 22:59:17 +10:30
ChangeLog-9103 Add copyright notices 2012-12-10 12:48:03 +00:00
MAINTAINERS Copyright update for binutils 2016-01-01 23:00:01 +10:30
alloca-conf.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
ansidecl.h FINAL/OVERRIDE: Define to empty on g++ < 4.7 2016-10-14 17:03:16 +01:00
bfdlink.h Add support for creating ELF import libraries 2016-07-15 17:50:48 +01:00
binary-io.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
bout.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
demangle.h libiberty: Add Rust symbol demangling. 2016-11-18 11:06:18 +01:00
dis-asm.h Add support for RISC-V architecture. 2016-11-01 16:45:57 +00:00
dwarf2.def Copyright update for binutils 2016-01-01 23:00:01 +10:30
dwarf2.h Add DW_LANG_Rust 2016-05-17 11:11:20 -06:00
dyn-string.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
environ.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
fibheap.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
filenames.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
floatformat.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
fnmatch.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
fopen-bin.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
fopen-same.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
fopen-vms.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
gcc-c-fe.def Copyright update for binutils 2016-01-01 23:00:01 +10:30
gcc-c-interface.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
gcc-interface.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
getopt.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
hashtab.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
hp-symtab.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
ieee.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
leb128.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
libiberty.h Synchronize libiberty sources with FSF GCC mainline version. 2016-08-02 13:26:28 +01:00
longlong.h Import changes made to files shared with the FSF GCC project. 2016-01-11 11:06:56 +00:00
lto-symtab.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
md5.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
oasys.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
objalloc.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
obstack.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
os9k.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
partition.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
plugin-api.h Add new plugin hooks to support querying section alignment and size. 2016-03-03 12:09:06 -08:00
progress.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
safe-ctype.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
sha1.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
simple-object.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
sort.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
splay-tree.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
symcat.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
timeval-utils.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
vtv-change-permission.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
xregex.h merge from gcc 2011-07-25 17:11:48 +00:00
xregex2.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
xtensa-config.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
xtensa-isa-internal.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
xtensa-isa.h Copyright update for binutils 2016-01-01 23:00:01 +10:30