binutils-gdb/gas/config
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_gnu.h
atof-ieee.c cleanup FLT_CHARS and EXP_CHARS 2016-04-03 19:50:02 -04:00
atof-vax.c
bfin-aux.h
bfin-defs.h use XNEW and related macros more 2016-05-13 00:35:51 -04:00
bfin-lex-wrapper.c
bfin-lex.l
bfin-parse.y Don't include libbfd.h outside of bfd, part 1 2016-07-16 13:25:11 +09:30
e-crisaout.c
e-criself.c
e-i386aout.c
e-i386coff.c
e-i386elf.c
e-mipself.c Copyright update for binutils 2016-01-01 23:00:01 +10:30
itbl-mips.h
m68k-parse.h
m68k-parse.y
obj-aout.c
obj-aout.h
obj-coff-seh.c
obj-coff-seh.h
obj-coff.c Fix build breakage 2016-05-13 15:58:07 +09:30
obj-coff.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
obj-ecoff.c
obj-ecoff.h
obj-elf.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
obj-elf.h
obj-evax.c use XNEW and related macros more 2016-05-13 00:35:51 -04:00
obj-evax.h
obj-fdpicelf.c
obj-fdpicelf.h
obj-macho.c use XNEW and related macros more 2016-05-13 00:35:51 -04:00
obj-macho.h
obj-multi.c
obj-multi.h
obj-som.c Add more const type qualifiers to GAS sources. 2016-02-22 14:11:27 +00:00
obj-som.h
rl78-defs.h
rl78-parse.y Revert "bison warning fixes" 2016-10-26 11:45:50 +10:30
rx-defs.h
rx-parse.y Revert "bison warning fixes" 2016-10-26 11:45:50 +10:30
tc-aarch64.c [AArch64] Add ARMv8.3 FCMLA and FCADD instructions 2016-11-18 10:02:16 +00:00
tc-aarch64.h
tc-alpha.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-alpha.h
tc-arc.c [ARC] Fix and extend features of .cpu directive. 2016-11-18 14:29:48 +01:00
tc-arc.h gas/arc: Make member of arc_flags const 2016-05-18 22:24:51 +01:00
tc-arm.c [GAS][ARM][PR20827]Fix gas error for two register form instruction (pre-UAL syntax). 2016-11-21 12:06:04 +00:00
tc-arm.h Remove support for creating ARM NOREAD sections. 2016-02-04 11:57:57 +00:00
tc-avr.c avr: replace sentinal with iteration from 0 to ARRAY_SIZE 2016-06-01 21:22:31 -04:00
tc-avr.h
tc-bfin.c Don't include libbfd.h outside of bfd, part 1 2016-07-16 13:25:11 +09:30
tc-bfin.h
tc-cr16.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-cr16.h
tc-cris.c use XNEW and related macros more 2016-05-13 00:35:51 -04:00
tc-cris.h
tc-crx.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-crx.h
tc-d10v.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-d10v.h
tc-d30v.c d30v: make var type operatorT 2016-05-24 08:55:45 -04:00
tc-d30v.h
tc-dlx.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-dlx.h dlx: move prototype of dlx_set_skip_hi16 to elf/dlx.h 2016-06-27 05:57:32 -04:00
tc-epiphany.c Don't include libbfd.h outside of bfd, part 2 2016-07-16 13:27:30 +09:30
tc-epiphany.h
tc-fr30.c
tc-fr30.h
tc-frv.c Don't include libbfd.h outside of bfd, part 2 2016-07-16 13:27:30 +09:30
tc-frv.h
tc-ft32.c Fix simple gas testsuite failures. 2016-06-15 16:25:34 +01:00
tc-ft32.h ft32: fixup TARGET_FORMAT 2016-05-24 08:49:46 -04:00
tc-generic.c
tc-generic.h
tc-h8300.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-h8300.h
tc-hppa.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-hppa.h
tc-i370.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-i370.h
tc-i386-intel.c x86/Intel: fix operand checking for MOVSD 2016-07-01 08:56:13 +02:00
tc-i386.c Enable Intel AVX512_4VNNIW instructions 2016-11-02 12:31:25 -07:00
tc-i386.h
tc-i860.c
tc-i860.h
tc-i960.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-i960.h
tc-ia64.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-ia64.h
tc-ip2k.c Don't include libbfd.h outside of bfd, part 2 2016-07-16 13:27:30 +09:30
tc-ip2k.h
tc-iq2000.c Don't include libbfd.h outside of bfd, part 2 2016-07-16 13:27:30 +09:30
tc-iq2000.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-lm32.c Constify more 2016-04-01 23:10:50 +10:30
tc-lm32.h
tc-m32c.c Don't include libbfd.h outside of bfd, part 2 2016-07-16 13:27:30 +09:30
tc-m32c.h
tc-m32r.c m32r: make mach_table static and const 2016-05-16 05:06:48 -04:00
tc-m32r.h
tc-m68hc11.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-m68hc11.h
tc-m68k.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-m68k.h
tc-m68851.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-mcore.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-mcore.h
tc-mep.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-mep.h
tc-metag.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-metag.h
tc-microblaze.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-microblaze.h
tc-mips.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-mips.h MIPS/GAS: Don't convert PC-relative REL relocs against absolute symbols 2016-07-14 20:11:03 +01:00
tc-mmix.c mmix: constify handler_charp 2016-05-24 08:52:45 -04:00
tc-mmix.h
tc-mn10200.c Fix simple gas testsuite failures. 2016-06-15 16:25:34 +01:00
tc-mn10200.h
tc-mn10300.c stop defining linkrelax in multiple places 2016-05-16 05:01:52 -04:00
tc-mn10300.h
tc-moxie.c Assemble 'bad' moxie instruction 2016-11-13 07:37:02 -05:00
tc-moxie.h
tc-msp430.c stop defining linkrelax in multiple places 2016-05-16 05:01:52 -04:00
tc-msp430.h
tc-mt.c -Wimplicit-fallthrough error fixes 2016-10-06 09:39:56 +10:30
tc-mt.h
tc-nds32.c -Wimplicit-fallthrough error fixes 2016-10-06 09:39:56 +10:30
tc-nds32.h make md_parse_option () take a const char * 2016-03-29 07:43:25 -04:00
tc-nios2.c Don't include libbfd.h outside of bfd, part 2 2016-07-16 13:27:30 +09:30
tc-nios2.h Constify more 2016-04-01 23:10:50 +10:30
tc-ns32k.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-ns32k.h
tc-or1k.c
tc-or1k.h
tc-pdp11.c
tc-pdp11.h
tc-pj.c Fix simple gas testsuite failures. 2016-06-15 16:25:34 +01:00
tc-pj.h
tc-ppc.c PR20744, Incorrect PowerPC VLE relocs 2016-11-22 20:19:29 +10:30
tc-ppc.h
tc-riscv.c Add support for RISC-V architecture. 2016-11-01 16:45:57 +00:00
tc-riscv.h Add support for RISC-V architecture. 2016-11-01 16:45:57 +00:00
tc-rl78.c Don't include libbfd.h outside of bfd, part 1 2016-07-16 13:25:11 +09:30
tc-rl78.h
tc-rx.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-rx.h
tc-s390.c S/390: Fix 16 bit pc relative relocs. 2016-11-04 20:18:35 +01:00
tc-s390.h
tc-score7.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-score.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-score.h
tc-sh64.c sh{,64}: make arg type enum 2016-06-05 23:27:41 -04:00
tc-sh64.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-sh.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-sh.h
tc-sparc.c gas,opcodes: fix hardware capabilities bumping in the sparc assembler. 2016-11-22 04:40:37 -08:00
tc-sparc.h
tc-spu.c spu: make some constants unsigned 2016-05-23 01:20:09 -04:00
tc-spu.h
tc-tic4x.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-tic4x.h
tc-tic6x.c use XNEW and related macros more 2016-05-13 00:35:51 -04:00
tc-tic6x.h
tc-tic30.c use xstrdup, xmemdup0 and concat more 2016-05-13 00:35:51 -04:00
tc-tic30.h
tc-tic54x.c simplify tic54x_set_default_include () 2016-06-25 11:52:29 -04:00
tc-tic54x.h
tc-tilegx.c use XNEW and related macros more 2016-05-13 00:35:51 -04:00
tc-tilegx.h
tc-tilepro.c use XNEW and related macros more 2016-05-13 00:35:51 -04:00
tc-tilepro.h
tc-v850.c Change type of v850_target_arch to enum bfd_architecture 2016-05-18 06:09:44 -04:00
tc-v850.h Change type of v850_target_arch to enum bfd_architecture 2016-05-18 06:09:44 -04:00
tc-vax.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-vax.h
tc-visium.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-visium.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-xc16x.c
tc-xc16x.h
tc-xgate.c Ensure ARM VPUSH and VPOP instructions do not affect more than 16 registers. 2016-08-05 11:26:13 +01:00
tc-xgate.h
tc-xstormy16.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-xstormy16.h
tc-xtensa.c tc-xtensa.c: fixup xg_reverse_shift_count typo 2016-09-26 12:55:56 -04:00
tc-xtensa.h
tc-z8k.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-z8k.h
tc-z80.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-z80.h
te-386bsd.h
te-aix5.h
te-aix.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-armeabi.h
te-armfbsdeabi.h
te-armfbsdvfp.h
te-armlinuxeabi.h
te-dragonfly.h
te-dynix.h
te-epoc-pe.h
te-freebsd.h
te-generic.h
te-gnu.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-go32.h
te-hppa64.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-hppa.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-hppalinux64.h
te-hpux.h
te-i386aix.h
te-ia64aix.h
te-interix.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-irix.h
te-linux.h
te-lynx.h
te-mach.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-macos.h
te-nacl.h
te-nbsd532.h
te-nbsd.h
te-netware.h
te-pc532mach.h
te-pe.h
te-pep.h
te-psos.h
te-riscix.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-solaris.h
te-sparcaout.h
te-sun3.h
te-svr4.h
te-symbian.h
te-tmips.h
te-uclinux.h
te-vms.c Remove use of alloca. 2016-03-21 16:31:46 +00:00
te-vms.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-vxworks.h
te-wince-pe.h
vax-inst.h
xtensa-istack.h
xtensa-relax.c use XNEW and related macros more 2016-05-13 00:35:51 -04:00
xtensa-relax.h xtensa: typedef enums when defining them 2016-06-01 21:19:53 -04:00