Commit Graph

8746 Commits

Author SHA1 Message Date
Sudakshina Das 503ba60025 [BINUTILS, AARCH64, 6/8] Add Tag getting instruction in Memory Tagging Extension
This patch is part of the patch series to add support for ARMv8.5-A
Memory Tagging Extensions which is an optional extension to
ARMv8.5-A and is enabled using the +memtag command line option.

This patch add support to the Bulk Allocation Tag instructions from
MTE. These are the following instructions added in this patch:
- LDGV <Xt>, [<Xn|SP>]!
- STGV <Xt>, [<Xn|SP>]!

This needed a new kind of operand for the new addressing [<Xn|SP>]!
since this has no offset and only takes a pre-indexed version.
Hence AARCH64_OPND_ADDR_SIMPLE_2 and ldtdgv_indexed are introduced.
(AARCH64_OPND_ADDR_SIMPLE fulfilled the no offset criteria but does
not allow writeback). We also needed new encoding and decoding
functions to be able to do the same.

where
<Xt> : Is the 64-bit destination GPR.
<Xn|SP> : Is the 64-bit first source GPR or Stack pointer.

*** include/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

	* opcode/aarch64.h (aarch64_opnd): Add AARCH64_OPND_ADDR_SIMPLE_2.
	(aarch64_insn_class): Add ldstgv_indexed.

*** opcodes/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

	* aarch64-asm.c (aarch64_ins_addr_simple_2): New.
	* aarch64-asm.h (ins_addr_simple_2): Declare the above.
	* aarch64-dis.c (aarch64_ext_addr_simple_2): New.
	* aarch64-dis.h (ext_addr_simple_2): Declare the above.
	* aarch64-opc.c (operand_general_constraint_met_p): Add case for
	AARCH64_OPND_ADDR_SIMPLE_2 and ldstgv_indexed.
	(aarch64_print_operand): Add case for AARCH64_OPND_ADDR_SIMPLE_2.
	* aarch64-tbl.h (aarch64_opcode_table): Add stgv and ldgv.
	(AARCH64_OPERANDS): Define ADDR_SIMPLE_2.
	* aarch64-asm-2.c: Regenerated.
	* aarch64-dis-2.c: Regenerated.
	* aarch64-opc-2.c: Regenerated.

*** gas/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

	* config/tc-aarch64.c (parse_operands): Add switch case for
	AARCH64_OPND_ADDR_SIMPLE_2 and allow [base]! for it.
	(warn_unpredictable_ldst): Exempt ldstgv_indexed for ldgv.
	* testsuite/gas/aarch64/armv8_5-a-memtag.s: Add tests for ldgv and stgv.
	* testsuite/gas/aarch64/armv8_5-a-memtag.d: Likewise.
	* testsuite/gas/aarch64/illegal-memtag.s: Likewise.
	* testsuite/gas/aarch64/illegal-memtag.l: Likewise.
2018-11-12 13:20:58 +00:00
Sudakshina Das e6025b546c [BINUTILS, AARCH64, 5/8] Add Tag getting instruction in Memory Tagging Extension
This patch is part of the patch series to add support for ARMv8.5-A
Memory Tagging Extensions which is an optional extension to
ARMv8.5-A and is enabled using the +memtag command line option.

This patch add support to the Tag Getting instruction from Memory Tagging
Extension.
- LDG <Xt>, [<Xn|SP>, #<simm>]

where
<Xt> : Is the 64-bit destination GPR.
<Xn|SP> : Is the 64-bit first source GPR or Stack pointer.
<simm> : Is the optional signed immediate offset, a multiple of 16
in the range of -4096 and 4080, defaulting to 0.

*** opcodes/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

	* aarch64-tbl.h (QL_LDG): New.
	(aarch64_opcode_table): Add ldg.
	* aarch64-asm-2.c: Regenerated.
	* aarch64-dis-2.c: Regenerated.
	* aarch64-opc-2.c: Regenerated.

*** gas/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

	* testsuite/gas/aarch64/armv8_5-a-memtag.s: Add tests for ldg.
	* testsuite/gas/aarch64/armv8_5-a-memtag.d: Likewise.
	* testsuite/gas/aarch64/illegal-memtag.s: Likewise.
	* testsuite/gas/aarch64/illegal-memtag.l: Likewise.
2018-11-12 13:20:37 +00:00
Sudakshina Das fb3265b371 [BINUTILS, AARCH64, 4/8] Add Tag setting instructions in Memory Tagging Extension
This patch is part of the patch series to add support for ARMv8.5-A
Memory Tagging Extensions which is an optional extension to
ARMv8.5-A and is enabled using the +memtag command line option.

This patch add support to the Tag setting instructions from
MTE which consists of the following instructions:
- STG [<Xn|SP>, #<simm>]
- STG [<Xn|SP>, #<simm>]!
- STG [<Xn|SP>], #<simm>
- STZG [<Xn|SP>, #<simm>]
- STZG [<Xn|SP>, #<simm>]!
- STZG [<Xn|SP>], #<simm>
- ST2G [<Xn|SP>, #<simm>]
- ST2G [<Xn|SP>, #<simm>]!
- ST2G [<Xn|SP>], #<simm>
- STZ2G [<Xn|SP>, #<simm>]
- STZ2G [<Xn|SP>, #<simm>]!
- STZ2G [<Xn|SP>], #<simm>
- STGP <Xt>, <Xt2>, [<Xn|SP>, #<imm>]
- STGP <Xt>, <Xt2>, [<Xn|SP>, #<imm>]!
- STGP <Xt>, <Xt2>, [<Xn|SP>], #<imm>

where
<Xn|SP> : Is the 64-bit GPR or Stack pointer.
<simm> : Is the optional signed immediate offset, a multiple of 16
in the range -4096 to 4080, defaulting to 0.

*** include/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

	* opcode/aarch64.h (aarch64_opnd): Add AARCH64_OPND_ADDR_SIMM11
	and AARCH64_OPND_ADDR_SIMM13.
	(aarch64_opnd_qualifier): Add new AARCH64_OPND_QLF_imm_tag.

*** opcodes/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

	* aarch64-opc.c (aarch64_opnd_qualifiers): Add new data
	for AARCH64_OPND_QLF_imm_tag.
	(operand_general_constraint_met_p): Add case for
	AARCH64_OPND_ADDR_SIMM11 and AARCH64_OPND_ADDR_SIMM13.
	(aarch64_print_operand): Likewise.
	* aarch64-tbl.h (QL_LDST_AT, QL_STGP): New.
	(aarch64_opcode_table): Add stg, stzg, st2g, stz2g and stgp
	for both offset and pre/post indexed versions.
	(AARCH64_OPERANDS): Define ADDR_SIMM11 and ADDR_SIMM13.
	* aarch64-asm-2.c: Regenerated.
	* aarch64-dis-2.c: Regenerated.
	* aarch64-opc-2.c: Regenerated.

*** gas/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

	* config/tc-aarch64.c (parse_operands): Add switch case for
	AARCH64_OPND_ADDR_SIMM11 and AARCH64_OPND_ADDR_SIMM13.
	(fix_insn): Likewise.
	(warn_unpredictable_ldst): Exempt STGP.
	* testsuite/gas/aarch64/armv8_5-a-memtag.s: Add tests for stg, st2g,
	stzg, stz2g and stgp.
	* testsuite/gas/aarch64/armv8_5-a-memtag.d: Likewise.
	* testsuite/gas/aarch64/illegal-memtag.s: Likewise.
	* testsuite/gas/aarch64/illegal-memtag.l: Likewise.
2018-11-12 13:09:55 +00:00
Sudakshina Das b731bc3b1b [BINUTILS, AARCH64, 3/8] Add Pointer Arithmetic instructions in Memory Tagging Extension
This patch is part of the patch series to add support for ARMv8.5-A
Memory Tagging Extensions which is an optional extension to
ARMv8.5-A and is enabled using the +memtag command line option.

This patch add support to the Pointer Arithmetic instructions from
MTE. These are the following instructions added in this patch:
- SUBP <Xd>, <Xn|SP>, <Xm|SP>
- SUBPS <Xd>, <Xn|SP>, <Xm|SP>
- CMPP <Xn|SP>, <Xm|SP>
where CMPP is an alias to SUBPS XZR, <Xn|SP>, <Xm|SP>

where
<Xd> : Is the 64-bit destination GPR.
<Xn|SP> : Is the 64-bit first source GPR or Stack pointer.
<Xm|SP> : Is the 64-bit second source GPR or Stack pointer.

*** opcodes/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

	* aarch64-tbl.h (aarch64_opcode_table): Add subp, subps and cmpp.
	* aarch64-asm-2.c: Regenerated.
	* aarch64-dis-2.c: Regenerated.
	* aarch64-opc-2.c: Regenerated.

*** gas/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

	* testsuite/gas/aarch64/armv8_5-a-memtag.s: Add tests for subp,
	subps and cmpp.
	* testsuite/gas/aarch64/armv8_5-a-memtag.d: Likewise.
	* testsuite/gas/aarch64/illegal-memtag.s: Likewise.
	* testsuite/gas/aarch64/illegal-memtag.l: Likewise.
2018-11-12 12:59:42 +00:00
Sudakshina Das 193614f2b9 [BINUTILS, AARCH64, 2/8] Add Tag generation instructions in Memory Tagging Extension
This patch is part of the patch series to add support for ARMv8.5-A
Memory Tagging Extensions which is an optional extension to
ARMv8.5-A and is enabled using the +memtag command line option.

This patch add support to the Tag generation instructions from
MTE. These are the following instructions added in this patch:
- IRG <Xd|SP>, <Xn|SP>{, Xm}
- ADDG <Xd|SP>, <Xn|SP>, #<uimm1>. #<uimm2>
- SUBG <Xd|SP>, <Xn|SP>, #<uimm1>. #<uimm2>
- GMI <Xd>, <Xn|SP>, <Xm>

where
<Xd|SP> : Is the 64-bit destination GPR or Stack pointer.
<Xn|SP> : Is the 64-bit source GPR or Stack pointer.
<uimm6> : Is the unsigned immediate, a multiple of 16
in the range 0 to 1008.
<uimm4> : Is the unsigned immediate, in the range 0 to 15.

*** include/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

	* opcode/aarch64.h (aarch64_opnd): Add
	AARCH64_OPND_UIMM4_ADDG and AARCH64_OPND_UIMM10 as new enums.

*** opcodes/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

	* aarch64-opc.h (aarch64_field_kind): New FLD_imm4_3.
	(OPD_F_SHIFT_BY_4, operand_need_shift_by_four): New.
	* aarch64-opc.c (fields): Add entry for imm4_3.
	(operand_general_constraint_met_p): Add cases for
	AARCH64_OPND_UIMM4_ADDG and AARCH64_OPND_UIMM10.
	(aarch64_print_operand): Likewise.
	* aarch64-tbl.h (QL_ADDG): New.
	(aarch64_opcode_table): Add addg, subg, irg and gmi.
	(AARCH64_OPERANDS): Define UIMM4_ADDG and UIMM10.
	* aarch64-asm.c (aarch64_ins_imm): Add case for
	operand_need_shift_by_four.
	* aarch64-asm-2.c: Regenerated.
	* aarch64-dis-2.c: Regenerated.
	* aarch64-opc-2.c: Regenerated.

*** gas/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

	* config/tc-aarch64.c (parse_operands): Add switch case for
	AARCH64_OPND_UIMM4_ADDG and AARCH64_OPND_UIMM10.
	* testsuite/gas/aarch64/armv8_5-a-memtag.s: New.
	* testsuite/gas/aarch64/armv8_5-a-memtag.d: Likewise.
	* testsuite/gas/aarch64/illegal-memtag.s: Likewise.
	* testsuite/gas/aarch64/illegal-memtag.l: Likewise.
	* testsuite/gas/aarch64/illegal-memtag.d: Likewise.
2018-11-12 12:59:22 +00:00
Sudakshina Das 73b605ec3f [BINUTILS, AARCH64, 1/8] Add support for Memory Tagging Extension for ARMv8.5-A
This patch is part of the patch series to add support for ARMv8.5-A
Memory Tagging Extensions. Memory Tagging Extension is an optional extension to
ARMv8.5-A and is enabled using the +memtag command line option.
This patch adds the new command line option and the new feature macros.

*** include/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

	* opcode/aarch64.h (AARCH64_FEATURE_MEMTAG): New.

*** opcodes/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

	* aarch64-tbl.h (aarch64_feature_memtag): New.
	(MEMTAG, MEMTAG_INSN): New.

*** gas/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

	* config/tc-aarch64.c (aarch64_features): Add "memtag"
	as a new option.
	* doc/c-aarch64.texi: Document the same.
2018-11-12 12:45:30 +00:00
Andreas Krebbel 13daa8e488 S/390: Fix optional operand handling after memory addresses
Instructions having an optional argument following a memory address
operand were not handled correctly if the optional argument was not
specified.

gas/ChangeLog:

2018-11-09  Andreas Krebbel  <krebbel@linux.ibm.com>

	* config/tc-s390.c (skip_optargs_p): New function.
	(md_gather_operands): Use skip_optargs_p.
	* testsuite/gas/s390/s390.exp: Run the new test.
	* testsuite/gas/s390/zarch-optargs.d: New test.
	* testsuite/gas/s390/zarch-optargs.s: New test.
2018-11-09 11:01:01 +01:00
Alan Modra 0e2779e98d PowerPC, don't use bfd reloc howto in md_assemble
We support source like the following
 .data
 .quad x-.
 .space 8
x:
where at the time the .quad line is assembled, x is unknown so a fixup
is emitted for later evaluation.  This is supported for data even when
the target may not have relocations for the expression, for example,
32-bit powerpc targets lack a 64-bit reloc.  As long as the fixup
resolves at assembly time, gas is happy.

The idea of this patch is to support fixups that resolve at assembly
time for instructions too, even when the target might lack the
necessary relocations (and thus no howto).

	* config/tc-ppc.c (fixup_size): New function.
	(md_assemble): Use it to derive size and pcrel directly
	from fixup reloc type.
2018-11-09 13:31:59 +10:30
Nick Clifton 0661ae2e53 Add updated French and Portuguese translations.
gas	* po/fr.po: Updated French translation.
bfd	* po/fr.po: Updated French translation.
	* po/pt.po: Updated Portuguese translation.
binutils* po/pt.po: Updated Portuguese translation.
2018-11-07 16:09:27 +00:00
Yoshinori Sato 8d3c78e473 rx: Add target rx-*-linux. 2018-11-07 17:18:05 +09:00
Matthew Malcomson f86e17aacf [arm] fix testsuite breakage on pe-coff
The PE target can insert NOP's for padding to 4 byte alignment.
This was causing a testcase failure, this commit fixes the testcase.

This commit also escapes some full-stops in the testcase regexp.

2018-11-06  Matthew Malcomson  <matthew.malcomson@arm.com>

	* testsuite/gas/arm/neon-cond-bad_t2.d: Fix testcase for PE
	target.
2018-11-06 17:09:34 +00:00
Matthew Malcomson bc52d49c1d [arm] Check for neon and condition in vcvt.f16.f32
VCVT between f16 and f32 is an Advanced SIMD instruction.
Not all the VCVT alternatives need neon, hence the check for neon is in
the encode function.

The check on neon for VCVT.f16.f32 (and vice versa) is missing.

vshcmd: > echo 'vcvt.f16.f32 d1, q1' | gas/as-new -mfpu=vfpxd -march=armv8.5-a -
testdir [15:59:10] $

Also, the handling of the condition code behaves differently to other
SIMD instructions -- no error message is produced when assembling an
instruction with a condition code suffix despite the arm encoding not
allowing a condition code. (n.b. the actual binary produced is
independent of the suffix).

The instruction should be treated similarly to VSUBL that has the same
caveat of "must be unconditional" describing the {<c>} symbol.  vcvt
half-precision to single precision found in F6.1.58 in the ARM
Architecture Reference Manual issue C.a, vsubl found in F6.1.240 in
the ARM Architecture Reference Manual issue C.a

2018-11-06  Matthew Malcomson  <matthew.malcomson@arm.com>

	* config/tc-arm.c (do_neon_cvt_1): Add check for neon and condition
	codes to half-precision conversion.
	* testsuite/gas/arm/neon-cond-bad-inc.s: Check vcvteq disallowed.
	* testsuite/gas/arm/neon-cond-bad.l: Likewise.
	* testsuite/gas/arm/neon-cond-bad_t2.d: Check vcvteq allowed in IT
	block.
	* testsuite/gas/arm/vfp-bad.l: Ensure vcvt doesn't work without neon.
	* testsuite/gas/arm/vfp-bad.s: Likewise.
2018-11-06 14:54:32 +00:00
Alan Modra 715537181e PowerPC instruction mask checks
The instruction mask bits should never overlap any of the operands,
nor should operand bits overlap, but some operands weren't checked.
This patch arranges to check the omitted operands, using a mask
returned by the operand->insert function.  Some tweaking of various
insert functions is needed to support this: The error case must set
field bits.

Since I was looking at the insert functions, I tidied some dead code
and simplified some of the powerpc_operands entries.

gas/
	* config/tc-ppc.c (insn_validate): Don't ignore mask in
	PPC_OPSHIFT_INV case.  Call the insert function to calculate
	a mask.
opcodes/
	* ppc-opc.c (insert_arx, insert_ary, insert_rx, insert_ry, insert_ls),
	(insert_evuimm1_ex0, insert_evuimm2_ex0, insert_evuimm4_ex0),
	(insert_evuimm8_ex0, insert_evuimm_lt8, insert_evuimm_lt16),
	(insert_rD_rS_even, insert_off_lsp, insert_off_spe2, insert_Ddd):
	Don't return zero on error, insert mask bits instead.
	(insert_sd4h, extract_sd4h, insert_sd4w, extract_sd4w): Delete.
	(insert_sh6, extract_sh6): Delete dead code.
	(insert_sprbat, insert_sprg): Use unsigned comparisions.
	(powerpc_operands <OIMM>): Set shift count rather than using
	PPC_OPSHIFT_INV.
	<SE_SDH, SE_SDW>: Likewise.  Don't use insert/extract functions.
2018-11-06 21:17:28 +10:30
Alan Modra 2eac3da184 PowerPC instruction operand flag validation
This adds another check that might have saved me a little time
recently if it had been present.

	* config/tc-ppc.c (insn_validate): Check that optional operands
	are not followed by non-optional operands.
2018-11-06 21:17:28 +10:30
Jan Beulich 4dd4e63945 x86: correctly handle VPBROADCASTD with EVEX.W set outside of 64-bit mode
For the flavor having a GPR operand EVEX.W is ignored outside of 64-bit
mode. The mnemonic should therefore not be VPBROADCASTQ.
2018-11-06 11:45:49 +01:00
Jan Beulich 9819647a63 x86: correctly handle VMOVD with EVEX.W set outside of 64-bit mode
For the flavors having a GPR operand EVEX.W is ignored outside of 64-bit
mode. The mnemonic should therefore not be KMOVQ, the GPR operand should
not name a non-existing 64-bit register, just like is already the case
for the AVX counterparts, and the Disp8 scaling factor should be 4
rather than 8.
2018-11-06 11:45:11 +01:00
Jan Beulich 58a211d260 x86: correctly handle KMOVD with VEX.W set outside of 64-bit mode
For the flavors having a GPR operand VEX.W is ignored outside of 64-bit
mode. The mnemonic should therefore not be KMOVQ.
2018-11-06 11:44:31 +01:00
Jan Beulich b50c9f3166 x86: adjust {,E}VEX.W handling for PEXTR* / PINSR*
PEXTR{B,W} and PINSR{B,W}, just like for AVX512BW, are WIG, no matter
that the SDM uses a nonstandard description of that fact.

PEXTRD, even with EVEX.W set, ignores that bit outside of 64-bit mode,
just like its AVX counterpart.
2018-11-06 11:43:55 +01:00
Jan Beulich 931d03b75a x86: adjust {,E}VEX.W handling outside of 64-bit mode
Many VEX-/EVEX-encoded instructions accessing GPRs become WIG outside of
64-bit mode. The respective templates should specify neither VexWIG nor
VexW0, but instead the setting of the bit should be determined from
- REX.W in 64-bit mode,
- the setting established through -mvexwig= / -mevexwig= otherwise.
This implies that the evex-wig2 testcase needs to go away, as being
wrong altogether.

A few test additions desirable here will only happen in later patches,
as the disassembler needs adjustments first.

Once again SSE2AVX templates are left alone, for it being unclear what
the behavior there should be.
2018-11-06 11:42:54 +01:00
Jan Beulich fd71a3756e x86: fix various non-LIG templates
Quite a few templates were marked LIG while really the insns aren't.
Introduce descriptive shorthands once again, instead of continuing to
use the less legible original forms.
2018-11-06 11:42:08 +01:00
Jan Beulich 563c7eef61 x86: allow {store} to select alternative {,}PEXTRW encoding
The 0F C5 encoding is indeed a load type one (just that memory operands
are not permitted), while the 0F 3A 15 encoding is obviously a store.
Allow the pseudo prefixes to be used to select between them.

Also move (without any change) the secondary AVX512BW templates next to
the primary one.
2018-11-06 11:40:25 +01:00
Jan Beulich 0aaca1d90a x86: add more VexWIG
Commits 6865c0435a ("x86: Support VEX/EVEX WIG encoding") and 6fa52824c3
("x86: Replace VexW=3 with VexWIG") omitted quite a few templates, oddly
enough in some cases despite testcases getting added (which then were
recorded with wrong expected output).

Also adjust VPMAXUB's attributes in the AVX512BW case to match ordering
of that of neighboring templates.

For the moment SSE2AVX templates are left alone, as it isn't clear
whether they were intentionally left untouched by the original commits
(the descriptions don't say either way).

In this context I question the decision in commit 0375113302 ("x86: Add
-mvexwig=[0|1] option to assembler") to move the logic to determine the
value of the W bit ahead of the decision whether to use 2-byte VEX:
While I can see this as one possible interpretation of -mvexwig=, the
other alternative (setting the value of the bit only if it actually
exists in the encoding) looks as reasonable to me, and perhaps even more
in line with us generally trying to pick the shortest encoding.
2018-11-06 11:39:42 +01:00
H.J. Lu a4749e56ca Correct ChangeLog entries for PR gas/23854 commit
commit e60f4d3bda
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Nov 5 09:01:26 2018 -0800

    x86: Disable GOT relaxation with data prefix

    Since linker GOT relaxation isn't valid for 16-bit GOT access, we should
    disable GOT relaxation with data prefix.
2018-11-05 11:13:30 -08:00
H.J. Lu e60f4d3bda x86: Disable GOT relaxation with data prefix
Since linker GOT relaxation isn't valid for 16-bit GOT access, we should
disable GOT relaxation with data prefix.

gas/

	PR gas/r23854
	* config/tc-i386.c (output_disp): Disable GOT relaxation with
	data prefix.
	* testsuite/gas/i386/mixed-mode-reloc32.d: Updated.

ld/

	PR gas/r23854
	* testsuite/ld-i386/i386.exp: Run pr23854.
	* testsuite/ld-x86-64/x86-64.exp: Likewwise.
	* testsuite/ld-i386/pr23854.d: New file.
	* testsuite/ld-i386/pr23854.s: Likewwise.
	* testsuite/ld-i386/pr23854.d: Likewwise.
	* testsuite/ld-x86-64/pr23854.d: Likewwise.
	* testsuite/ld-x86-64/pr23854.s: Likewwise.
2018-11-05 09:01:43 -08:00
Thomas Preud'homme 33ea299c25 Fix ld action in run_dump_test
run_dump_test proposes an ld action but when trying to make use of it in
a gas test it gave me some Tcl error. It turns out that it references
the check_shared_lib_support procedure and ld_elf_shared_opt variable
both only available in ld-lib.exp. I've thus moved the procedure in
binutils-common.exp and defined the variable needed in the various
default.exp of testsuite that seem to be using run_dump_test.

Since check_shared_lib_support itself references the ld variable not
defined in binutils-common I've defined it from LD in run_dump_test and
fixed LD and LDFLAGS to be defined as expected by run_dump_test in the
various default.exp of testsuite using run_dump_test.

2018-11-01  Thomas Preud'homme  <thomas.preudhomme@linaro.org>

binutils/
	* testsuite/config/default.exp: Define LD, LDFLAGS and
	ld_elf_shared_opt.
	* testsuite/lib/binutils-common.exp (check_shared_lib_support): Moved
	from ld-lib.exp.
	(run_dump_test): Set ld to $LD.

gas/
	* testsuite/config/default.exp: Define LD, LDFLAGS and
	ld_elf_shared_opt.

ld/
	* testsuite/lib/ld-lib.exp (check_shared_lib_support): Moved to
	binutils-common.exp.
2018-11-01 17:19:17 +00:00
Andre Vieira 664306bcce [GAS][ARM] Fix ARMv8.1 AdvSIMD testism
This test never used to test the output of objdump as the old 'error-output'
check would exit after verifying the output in stdout and stderr from the
assembler.  Given the use of warning_output now, the objdump runs and expects
its output to be verified.  Assuming the correct disassembly of these
instructions is tested elsewhere given we never tested them here, this patch
removes the objdump run.

gas/ChangeLog

2018-10-31  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* testsuite/gas/arm/armv8-a+rdma-warning.d: Remove objdump execution.
2018-10-31 12:11:47 +00:00
Andre Vieira a66cf75c9c [GAS][ARM] Fix UDF testism
The old test never checked the objdump output since the 'error-output' directive
would exit and thus never run objdump.  When this test was changed to adhere to
use the new warning_output we started to run objdump.  The expected objdump
output was old and had bitrotten, this fixes the layout, as the "disassembly"
itself did not change.

gas/ChangeLog

2018-10-31  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* testsuite/gas/arm/udf.d: Update expected output.
2018-10-31 12:11:10 +00:00
Andre Vieira cd53832b00 [GAS][ARM] Fix failing Armv1 test
This test has been failing for a while and it could be argued that since we
started testing 'arm7t' here (and not Armv1) the test itself was wrong.  So I
changed the assembly to Armv1.  Given the changes to objdump when
"disassembling all" it seemed like a good idea to force the disassembly to
'armv2' instead and actually accept the disassembly of the 26-bit Architecture
variants of tst, teq, cmn and cmp.

gas/ChangeLog

2018-10-31  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* testsuite/gas/arm/armv1.d: Assemble for Armv1 and disassemble for
	Armv2.
2018-10-31 12:11:01 +00:00
Alan Modra 8d1015a887 Move struc-symbol.h to symbols.c
This file was never supposed to be widely used.  The fact that it has
found its way into many gas files led to bugs, typically when code
expecting a symbolS* to point at a struct symbol is presented with a
struct local_symbol.  Also, commit 158184ac9e changed these structs in
2012 but didn't catch all places where symbol bsym was being used to
test for a local_symbol.

	* Makefile.am (HFILES): Delete struc-symbol.h.
	* doc/internals.texi: Delete struc-symbol.h reference and out
	of date local symbol description.
	* struc-symbol.h: Delete.  Move contents to..
	* symbols.c: ..here.
	(symbol_on_chain, symbol_symbolS): New functions.
	* symbols.h (symbol_on_chain, symbol_symbolS): Declare.
	* cgen.c: Don't #include struc-symbol.h.
	(gas_cgen_parse_operand): Don't test for local_symbol using
	bsym, instead call symbol_symbolS.  Use symbol_get_bfdsym.
	(weak_operand_overflow_check, make_right_shifted_expr): Use
	symbol accessors.
	* config/obj-coff.c: Don't #include struc-symbol.h.
	(GET_FILENAME_STRING): Delete.
	* config/obj-elf.c: Don't #include struc-symbol.h.
	(elf_file_symbol): Use symbol accessors.
	(elf_adjust_symtab): Call symbol_on_chain.
	* config/obj-evax.c: Don't #include struc-symbol.h.
	* config/tc-nds32.c: Likewise.
	* config/tc-rl78.c: Likewise.
	* config/tc-rx.c: Likewise.
	* config/tc-alpha.c: Likewise.
	(add_to_link_pool, s_alpha_comm): Use symbol accessors.
	* config/tc-arc.c: Don't #include struc-symbol.h.
	(arc_check_relocs): Use symbol accessors, testing gas symbol
	section rather than bfd symbol section.
	* config/tc-avr.c: Don't #include struc-symbol.h.
	(avr_patch_gccisr_frag): Use symbol accessors.
	* config/tc-bfin.c: Don't #include struc-symbol.h.
	(bfin_loop_beginend): Use symbol accessors.
	* config/tc-csky.c: Don't #include struc-symbol.h.
	(v2_work_movih, v2_work_ori): Use symbol accessors.  Check for
	absolute symbol as well as O_constant.
	* config/tc-riscv.c: Don't #include struc-symbol.h.
	(riscv_pre_output_hook): Use symbol accessors.
	* config/tc-s390.c: Don't #include struc-symbol.h.
	(s390_literals): Use symbol accessors.
	* config/tc-score.c (s3_build_la_pic, s3_build_lwst_pic): Use
	symbol accessors.
	(s3_relax_branch_inst16, s3_relax_cmpbranch_inst32): Don't
	test symbol bsym.
	* config/tc-score7.c: Don't #include struc-symbol.h.
	(s7_build_la_pic, s7_build_lwst_pic): Use symbol accessors.
	(s7_b32_relax_to_b16): Don't test symbol bsym.
	* config/tc-sh.c: Don't #include struc-symbol.h.
	(insert_loop_bounds): Use symbol accessors.
	(sh_frob_section): Remove bogus symbol canonicalization.
	* config/tc-tic54x.c: Don't #include struc-symbol.h.
	(tic54x_bss): Use symbol accessors.
	* config/tc-tilegx.c: Don't #include struc-symbol.h.
	(emit_tilegx_instruction, tilegx_parse_name): Use symbol accessors.
	* config/tc-tilepro.c: Don't #include struc-symbol.h.
	(emit_tilepro_instruction, tilepro_parse_name): Use accessors.
	* config/tc-xtensa.c: Don't #include struc-symbol.h.
	(xg_assemble_vliw_tokens): Use symbol accessors.
	(xg_order_trampoline_chain): Likewise.
	* ehopt.c: Don't #include struc-symbol.h.
	(check_eh_frame): Correct local symbol test.  Use symbol accessors.
	* write.c: Don't #include struc-symbol.h.
	(create_note_reloc, maybe_generate_build_notes): Use symbol accessors.
	* Makefile.in: Regenerate.
	* po/POTFILES.in: Regenerate.
2018-10-29 18:20:48 +10:30
Alan Modra 8fc91c4098 Correct ChangeLog 2018-10-28 16:15:05 +10:30
Alan Modra b0d99ba9e9 PR23837, Segmentation fault in resolve_symbol_value
Local symbols don't have a sy_frag field.

	PR 23837
	* config/tc-hppa.c: Don't include struc-symbol.h.
	(pa_build_unwind_subspace): Call get_symbol_frag rather than
	referencing sy_frag.
2018-10-28 16:05:51 +10:30
Andreas Krebbel f47998d69f S/390: Support vector alignment hints
This patch adds the vector alignment hints to the vector load and
store instructions as documented in the IBM z14 Principles of
Operations manual:

http://publibfi.boulder.ibm.com/epubs/pdf/dz9zr011.pdf

opcodes/ChangeLog:

2018-10-23  Andreas Krebbel  <krebbel@linux.ibm.com>

	* s390-opc.txt: Add vector load/store instructions with additional
	alignment parameter.

gas/ChangeLog:

2018-10-23  Andreas Krebbel  <krebbel@linux.ibm.com>

	* config/tc-s390.c (md_gather_operands): Fix for optional operands
	following memory addresses.
	* testsuite/gas/s390/zarch-arch12.d: Add regexp checks for new
	instruction variants.
	* testsuite/gas/s390/zarch-arch12.s: Emit new instruction
	variants.
2018-10-23 18:13:01 +02:00
John Darrington 405b61965f S12Z: Handle 16 bit fixups which are constant.
Commit 1f38083f42 added a test
to check that the assembler handled fixups with resolved to
constant values.  We were not handling this in the case of
16 bit values.  This change fixes that.

* gas/config/tc-s12z.c (md_apply_fix): Handle BFD_RELOC_16
2018-10-23 16:09:29 +02:00
Alan Modra 1f38083f42 gas simple-forward test
Tests that target md_apply_fix can handle fixups that have resolved
down to a constant and thus do not need relocations.

Also a fix for eqv-dot xfails.

	* testsuite/gas/all/simple-forward.d,
	* testsuite/gas/all/simple-forward.s: New test.
	* testsuite/gas/all/gas.exp: Run it.
	* testsuite/gas/all/eqv-dot.d: xfail tic30 and tic54x.
2018-10-22 22:32:43 +10:30
Alan Modra e1748c54a2 Apply alpha BFD_RELOC_8 fixups
* config/tc-alpha.c (md_apply_fix): Handle BFD_RELOC_8 for fixups
	without a symbol.
	* testsuite/gas/all/gas.exp: Don't xfail forward test here..
	* testsuite/gas/all/forward.d: ..do so here, removing alpha.
2018-10-22 22:32:43 +10:30
Alan Modra 38cf168be5 PR23040, .uleb128 directive doesn't accept some valid expressions
What a trip down a rabbit hole this bug has been.

First observation: You can't use deferred_expression in s_leb128.
deferred_expression implements the semantics of .eqv or '==', saving
an expression with minimal simplification for assignment to a symbol
so that the expression is evaluated at uses of the symbol.  In
particular, the value of "dot" is not evaluated at the .eqv symbol
assignment, but later.  When s_leb128 uses deferred_expression,
"later" is at the end of assembly, giving entirely the wrong value of
"dot".  There is no way to fix this for the s_leb128 use without
breaking .equ (which incidentally was already somewhat broken, see
commit e4c2619ad1).  So, don't use deferred_expression in s_leb128.

But that leads to the gas test elf/dwarf2-17 failing, because view
symbols are calculated with a chain of expression symbols.  In the
dwarf2-17 .L1 case there is a "temp_sym_1 > temp_sym_2" expression,
with temp_sym_1 and temp_sym_2 on either side of a ".balign".  Since
".balign" and many other directives moving "dot" are not calculated on
the first (and only) pass over source, .L1 cannot be calculated until
final addresses are assigned to frags.  However, ".uleb128 .L1" *is*
calculated immediately, resulting in the wrong value.

The reason why .L1 is calculated immediately is that code in
expr.c:operand after the comment
	  /* If we have an absolute symbol or a reg, then we know its
	     value now.  */
does as it says and fixes the value of .L1, because .L1 is assigned
to absolute_section in dwarf2dbg.c:set_or_check_view.  So, correct
that to expr_section.

Unfortunately that fix leads to failure of the elf/dwarf2-5 test with
../gas/elf/dwarf2-5.s: Error: attempt to get value of unresolved symbol `.L5'
../gas/elf/dwarf2-5.s: Error: attempt to get value of unresolved symbol `.L11'
../gas/elf/dwarf2-5.s: Error: attempt to get value of unresolved symbol `.L12'
So why is that?  Well, it turns out that .L5 is defined in terms of
.L4, and apparently .L4 is undefined.  But .L4 clearly is defined,
otherwise we would hit an error when trying to use .L4 a little
earlier.  There are two copies of .L4!  So, symbols are cloned when
that should not happen.

Symbol cloning is a technique used by gas to support saving the value
of symbols that change between uses, but that isn't the case with
.L4.  Only one value is set and used for .L4, but indeed .L4 was being
cloned by symbol_clone_if_forward_ref.  This despite no forward refs
being present.  Also, .L4 is a local symbol and a cursory glance at
symbol_clone_if_forward_ref "if (symbolP && !LOCAL_SYMBOL_CHECK (symbolP))"
would seem to prevent cloning of local symbols.  All is not as it
seems though, a curse of using macros.  LOCAL_SYMBOL_CHECK modifies
its argument if a "struct local_symbol" is converted to the larger
"struct symbol", as happens when assigning a view symbol value.
That fact results in the recursive call to symbol_clone_if_forward_ref
returning a different address for "add_symbol".  This problem could
have been fixed by using symbol_same_p rather than comparing symbol
pointers, but I thought it better to use the real symbol throughout.
Note that symbol_find_exact also returns the real symbol for a
converted local symbol.

Finally, this patch does expose lack of support for forward symbol
definitions in various targets.  For example:
alpha-linux  +ERROR: ../ld/testsuite/ld-elf/pr11138-2.c: compilation failed
This is caused by view symbol uses.  On alpha-linux-gcc (GCC) 8.1.1
20180502 they happen to occur in .byte directives so were silently
broken in cases like elf/dwarf2-17 anyway.
/tmp/ccvtsMfU.s: Assembler messages:
/tmp/ccvtsMfU.s: Fatal error: unhandled relocation type BFD_RELOC_8
/tmp/ccvtsMfU.s: Fatal error: unhandled relocation type BFD_RELOC_8

md_apply_fix on those targets needs to handle fixups that resolve down
to a constant.

	PR 23040
	* symbols.c (get_real_sym): New function.
	(symbol_same_p): Use get_real_sym.
	(symbol_clone_if_forward_ref): Save real original add_symbol and
	op_symbol for comparison against that returned from lookup or
	recursive calls.
	* dwarf2dbg.c (set_or_check_view): Use expr_section for
	expression symbols, not absolute_section.
	(dwarf2_directive_loc): Check symbol_equated_p and tidy cloning
	of view symbols.
	* read.c (s_leb128): Don't use deferred_expression.
2018-10-22 13:34:02 +10:30
Alan Modra e4c2619ad1 PR23800, .eqv doesn't always defer expression evaluation
.eqv (and ==) ought not simplify expressions involving dot or other
symbols set by .eqv.  If such simplification occurs, the value of dot
will be that at the assignment rather than at the place where the
symbol is used.

	PR 23800
	* expr.c (expr): Don't simplify expressions involving forward_ref
	symbols when mode is expr_defer.
	* config/tc-spu.c (spu_cons): Parse expression using normal
	expression evaluation if @ppu is not detected.
	* testsuite/gas/all/eqv-dot.d,
	* testsuite/gas/all/eqv-dot.s: New test.
	* testsuite/gas/all/gas.exp: Run it.
2018-10-20 19:46:43 +10:30
Tamar Christina bacb77d018 Arm: Skip new binary decode tests on pe targets
The two new test I added require the use of the ".inst" directive which the PE
targets don't support.  Because of that I excluded *-unknown-pe but the mask needs
to be wider.  I am now excluding *-*-pe.

gas/ChangeLog:

	* testsuite/gas/arm/undefined-insn-arm.d: Widen pe skip.
	* testsuite/gas/arm/undefined-insn-thumb.d: Likewise.
2018-10-19 16:19:07 +01:00
Tamar Christina 0b347048e7 Arm: Fix disassembler crashing on -b binary when thumb file and thumb not forced.
The disassembler for Arm has some aborts in it in places it assumes can never
be reached.  Under normal circumstances they indeed cannot be reached because
the right options are selected from the ARM attributes in the ELF file.

However when disassembling with -b binary then if you do not get the options
right the disassembler just aborts.  This changes it so it just prints how it
was trying to interpret the instruction and prints UNKNOWN instructions next to it.

This way the user has an idea of what's going.

gas/ChangeLog:

	* testsuite/gas/arm/undefined-insn-arm.d: New test.
	* testsuite/gas/arm/undefined-insn-thumb.d: New test.
	* testsuite/gas/arm/undefined-insn.s: New test.

opcodes/ChangeLog:

	* arm-dis.c (UNKNOWN_INSTRUCTION_32BIT): Format specifier for arm mode.
	(UNKNOWN_INSTRUCTION_16BIT): Format specifier for thumb mode.
	(print_insn_arm, print_insn_thumb16, print_insn_thumb32): Use them.
2018-10-19 10:33:11 +01:00
Fredrik Noring 33d64ca5db This set of changes clarifies the conditions for the R5900 short loop fix and extends its test with the border cases of six and seven instructions.
* testsuite/gas/mips/r5900.s: Extend the R5900 short loop fix
	test with border cases.
	* testsuite/gas/mips/r5900.d: Add extra expected disassembly.
	* config/tc-mips.c (can_swap_branch_p): Clarify the R5900 short
	loop hardware bug conditions.  Correct note on the R5900
	instruction count short loop fix.
2018-10-19 09:47:55 +01:00
Matthew Malcomson 66e6f0b760 AArch64: Fix error checking for SIMD udot (by element)
Committed on behalf of Matthew Malcomson:

The SIMD UDOT instruction assembly has an unusual operand that selects a single
32 bit element with the mnemonic 4B.
This unusual mnemonic is handled by a special operand qualifier and associated
qualifier data in `aarch64_opnd_qualifiers`.

The current qualifier data describes 4 1-byte elements with the structure
{1, 4, 0x0, "4b", OQK_OPD_VARIANT}
This makes sense, as the instruction does work on 4 1-byte elements, however
some logic in the `operand_general_constraint_met_p` makes assumptions about
the range of index allowed when selecting a SIMD_ELEMENT depending on element
size.
That function reasons that e.g. in order to select a byte-sized element in a 16
byte V register an index must allow selection of one of the 16 elements and
hence its range will be in [0,15].

This reasoning breaks with the above description of a 4 part selection of 1
byte elements and allows an index outside the valid [0,3] range, triggering an
assert later on in the program in `aarch64_ins_reglane`.

vshcmd: > echo 'udot v0.2s, v1.8b, v2.4b[4]' | ../src/binutils-build/gas/as-new -march=armv8.4-a
as-new: ../../binutils-gdb/opcodes/aarch64-asm.c:134: aarch64_ins_reglane: Assertion `reglane_index < 4' failed.
{standard input}: Assembler messages:
{standard input}:1: Internal error (Aborted).
Please report this bug.

This patch changes the operand qualifier data so that it describes a single
32 bit element.
{4, 1, 0x0, "4b", OQK_OPD_VARIANT}
Hence the calculation in `operand_general_constraint_met_p` provides the
correct answer and the usual error checking machinery is used.

vshcmd: > echo 'udot v0.2s, v1.8b, v2.4b[4]' | ../src/binutils-build/gas/as-new -march=armv8.4-a
{standard input}: Assembler messages:
{standard input}:1: Error: register element index out of range 0 to 3 at operand 3 -- `udot v0.2s,v1.8b,v2.4b[4]'
2018-10-16 18:50:42 +01:00
Alan Modra bf2dd8d7cf BFD_INIT_MAGIC
This patch performs a run-time test that a shared libbfd.so has been
compiled with the same size bfd_vma as that of apps using the library.
On a 32-bit host it is easily possible to have one libbfd.so compiled
to support 64-bit targets (or configured with --enable-64-bit-bfd)
while another only supports 32-bit targets.  The two libraries will
have differently sized bfd_vma types, and if the wrong one is loaded
all sorts of weird behaviour might be seen.

bfd/
	PR 23534
	* init.c (BFD_INIT_MAGIC): Define.
	(bfd_init): Return BFD_INIT_MAGIC.
	bfd-in2.h: Regenerate.
binutils/
	PR 23534
	* addr2line.c (main): Exit with fatal error if bfd_init
	returns an unexpected value.
	* ar.c (main): Likewise.
	* dlltool.c (identify_dll_for_implib): Likewise.
	* nm.c (main): Likewise.
	* objcopy.c (main): Likewise.
	* objdump.c (main): Likewise.
	* size.c (main): Likewise.
	* strings.c (main): Likewise.
	* windmc.c (main): Likewise.
	* windres.c (main): Likewise.
gas/
	PR 23534
	* as.c (main): Exit with fatal error if bfd_init returns an
	unexpected value.
ld/
	PR 23534
	* ldmain.c (main): Exit with fatal error if bfd_init returns
	an unexpected value.
2018-10-15 22:11:58 +10:30
Jan Beulich a9597defaf x86: add {,V}MOVQ cases to xmmword test
I had overlooked these when putting together the original test.
2018-10-11 09:16:28 +02:00
Jan Beulich 673fe0f0a7 x86: fold Size{16,32,64} template attributes
Only one of them can be set at a time, which means they can be expressed
by a single 2-bit field instead of three 1-bit ones.
2018-10-10 08:41:52 +02:00
Sudakshina Das 104fefeebb [PATCH, BINUTULS, AARCH64, 9/9] Add SSBS to MSR/MRS
This patch is part of the patch series to add support for ARMv8.5-A
extensions.
(https://developer.arm.com/products/architecture/cpu-architecture/a-profile/exploration-tools)
The encodings can be found in the System Register XML.

This patch adds support for the mitigation for Spectre Variant 4 by
adding the PSTATE bit SSBS which are accessible using MSR and MRS
instructions. Although this is a mandatory addition to the ARMv8.5-A,
it is permitted to be added to any version of the ARMv8 architecture.
This is enabled using the command line option of +ssbs for older
versions.

*** include/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* opcode/aarch64.h (AARCH64_FEATURE_SSBS): New.
	(AARCH64_ARCH_V8_5): Add AARCH64_FEATURE_SSBS by default.

*** opcodes/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* aarch64-opc.c (operand_general_constraint_met_p): Add
	SSBS in the check for one-bit immediate.
	(aarch64_sys_regs): New entry for SSBS.
	(aarch64_sys_reg_supported_p): New check for above.
	(aarch64_pstatefields): New entry for SSBS.
	(aarch64_pstatefield_supported_p): New check for above.

*** gas/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* config/tc-aarch64.c (aarch64_features): Add new "ssbs".
	* doc/c-aarch64.texi: Document the same.
	* testsuite/gas/aarch64/ssbs-illegal1.d: New test.
	* testsuite/gas/aarch64/ssbs-illegal1.l: New test.
	* testsuite/gas/aarch64/ssbs-illegal2.d: New test.
	* testsuite/gas/aarch64/ssbs-illegal2.l: New test.
	* testsuite/gas/aarch64/ssbs.s: New test.
	* testsuite/gas/aarch64/ssbs1.d: Test with +ssbs
	* testsuite/gas/aarch64/ssbs2.d: Test with armv8.5-a.
2018-10-09 15:39:29 +01:00
Sudakshina Das a97330e723 [PATCH, BINUTILS, AARCH64, 8/9] Add SCXTNUM_ELx and ID_PFR2_EL1 system registers
This patch is part of the patch series to add support for ARMv8.5-A
extensions.
(https://developer.arm.com/products/architecture/cpu-architecture/a-profile/exploration-tools)
The encodings can be found in the System Register XML.

This patch adds the new system registers SCXTNUM_ELx and ID_PFR2_EL1.

*** include/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* opcode/aarch64.h (AARCH64_FEATURE_SCXTNUM): New.
	(AARCH64_FEATURE_ID_PFR2): New.
	(AARCH64_ARCH_V8_5): Add both by default.

*** opcodes/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* aarch64-opc.c (aarch64_sys_regs): New entries for
	scxtnum_el[0,1,2,3,12] and id_pfr2_el1.
	(aarch64_sys_reg_supported_p): New checks for above.

*** gas/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* testsuite/gas/aarch64/sysreg-4.s: Test registers
	scxtnum_el[0,1,2,3,12] and id_pfr2_el1.
	* testsuite/gas/aarch64/sysreg-4.d: Likewise.
	* testsuite/gas/aarch64/illegal-sysreg-4.l: Likewise.
2018-10-09 15:39:29 +01:00
Sudakshina Das ff6054520c [PATCH, BINUTILS, AARCH64, 7/9] Add BTI instruction
This patch is part of the patch series to add support for ARMv8.5-A
extensions.
(https://developer.arm.com/products/architecture/cpu-architecture/a-profile/docs/ddi0596/a/a64-base-instructions-alphabetic-order/bti-branch-target-identification)

The Branch Target Identification instructions (BTI) are allocated to
existing HINT space, using HINT numbers 32, 34, 36, 38, such that
bits[7:6] of the instruction identify the compatibility of the BTI
instruction to different branches.

	BTI {<targets>}

where <targets> one of the following, specifying which type of
indirection is allowed:

	j : Can be a target of any BR Xn isntruction.
	c : Can be a target of any BLR Xn and BR {X16|X17}.
	jc: Can be a target of any free branch.

A BTI instruction without any <targets> is the strictest of all and
can not be a target of nay free branch.

*** include/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* opcode/aarch64.h (AARCH64_FEATURE_BTI): New.
	(AARCH64_ARCH_V8_5): Add AARCH64_FEATURE_BTI by default.
	(aarch64_opnd): Add AARCH64_OPND_BTI_TARGET.
	(HINT_OPD_CSYNC, HINT_OPD_C, HINT_OPD_J): New macros to
	define HINT #imm values.
	(HINT_OPD_JC, HINT_OPD_NULL): Likewise.

*** opcodes/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* aarch64-opc.h (HINT_OPD_NOPRINT, HINT_ENCODE): New.
	(HINT_FLAG, HINT_VALUE): New macros to encode NO_PRINT flag
	with the hint immediate.
	* aarch64-opc.c (aarch64_hint_options): New entries for
	c, j, jc and default (with HINT_OPD_F_NOPRINT flag) for BTI.
	(aarch64_print_operand): Add case for AARCH64_OPND_BTI_TARGET
	while checking for HINT_OPD_F_NOPRINT flag.
	* aarch64-dis.c (aarch64_ext_hint): Use new HINT_VALUE to
	extract value.
	* aarch64-tbl.h (aarch64_feature_bti, BTI, BTI_INSN): New.
	(aarch64_opcode_table): Add entry for BTI.
	(AARCH64_OPERANDS): Add new description for BTI targets.
	* aarch64-asm-2.c: Regenerate.
	* aarch64-dis-2.c: Regenerate.
	* aarch64-opc-2.c: Regenerate.

*** gas/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* config/tc-aarch64.c (parse_bti_operand): New.
	(process_omitted_operand): Add case for AARCH64_OPND_BTI_TARGET.
	(parse_operands): Likewise.
	* testsuite/gas/aarch64/system.d: Update for BTI.
	* testsuite/gas/aarch64/bti.s: New.
	* testsuite/gas/aarch64/bti.d: New.
	* testsuite/gas/aarch64/illegal-bti.d: New.
	* testsuite/gas/aarch64/illegal-bti.l: New.
2018-10-09 15:39:35 +01:00
Sudakshina Das af4bcb4ce6 [PATCH, BINUTILS, AARCH64, 6/9] Add Random number instructions
This patch is part of the patch series to add support for ARMv8.5-A
extensions.
(https://developer.arm.com/products/architecture/cpu-architecture/a-profile/exploration-tools)
The encodings can be found in the System Register XML.

This patch adds the following:
MSR Xn, RNDR
MSR Xn, RNDRRS

These are optional instructions in ARMv8.5-A and hence the new
+rng is added.

*** include/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* opcode/aarch64.h (AARCH64_FEATURE_RNG): New.

*** opcodes/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* aarch64-opc.c (aarch64_sys_regs): New entries for
	rndr and rndrrs.
	(aarch64_sys_reg_supported_p): New check for above.

*** gas/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* config/tc-aarch64.c (aarch64_features): New "rng" option.
	* doc/c-aarch64.texi: Document the same.
	* testsuite/gas/aarch64/sysreg-4.s: Test both instructions.
	* testsuite/gas/aarch64/sysreg-4.d: Likewise.
	* testsuite/gas/aarch64/illegal-sysreg-4.l: Likewise.
2018-10-09 15:39:29 +01:00
Sudakshina Das 3fd229a447 [PATCH, BINUTILS, AARCH64, 5/9] Add DC CVADP instruction
This patch is part of the patch series to add support for ARMv8.5-A
extensions.
(https://developer.arm.com/products/architecture/cpu-architecture/a-profile/docs/ddi0596/a/a64-base-instructions-alphabetic-order/dc-data-cache-operation-an-alias-of-sys)

This patch adds the DC CVADP instruction. Since this has a separate
identification mechanism a new feature bit is added.

*** include/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* opcode/aarch64.h (AARCH64_FEATURE_CVADP): New.

*** opcodes/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* aarch64-opc.c (aarch64_sys_regs_dc): New entry for cvadp.
	(aarch64_sys_ins_reg_supported_p): New check for above.

*** gas/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* testsuite/gas/aarch64/sysreg-4.s: Test instruction.
	* testsuite/gas/aarch64/sysreg-4.d: Likewise.
	* testsuite/gas/aarch64/illegal-sysreg-4.l: Likewise.
2018-10-09 15:39:29 +01:00
Sudakshina Das 2ac435d466 [PATCH, BINUTILS, AARCH64, 4/9] Add Execution and Data Restriction instructions
This patch is part of the patch series to add support for ARMv8.5-A
extensions.
(https://developer.arm.com/products/architecture/cpu-architecture/a-profile/docs/ddi0596/a/a64-base-instructions-alphabetic-order)

This patch adds the prediction restriction instructions (that is, cfp,
dvp, cpp). These instructions are retrospectively made optional for
all versions of the architecture from ARMv8.0 to ARMv8.4 and is
mandatory from ARMv8.5. Hence adding a new +predres which can be used
by the older architectures.

*** include/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* opcode/aarch64.h (AARCH64_FEATURE_PREDRES): New.
	(AARCH64_ARCH_V8_5): Add AARCH64_FEATURE_PREDRES by default.
	(aarch64_opnd): Add AARCH64_OPND_SYSREG_SR.
	(aarch64_sys_regs_sr): Declare new table.

*** opcodes/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* aarch64-dis.c (aarch64_ext_sysins_op): Add case for
	AARCH64_OPND_SYSREG_SR.
	* aarch64-opc.c (aarch64_print_operand): Likewise.
	(aarch64_sys_regs_sr): Define table.
	(aarch64_sys_ins_reg_supported_p): Check for RCTX with
	AARCH64_FEATURE_PREDRES.
	* aarch64-tbl.h (aarch64_feature_predres): New.
	(PREDRES, PREDRES_INSN): New.
	(aarch64_opcode_table): Add entries for cfp, dvp and cpp.
	(AARCH64_OPERANDS): Add new description for SYSREG_SR.
	* aarch64-asm-2.c: Regenerate.
	* aarch64-dis-2.c: Regenerate.
	* aarch64-opc-2.c: Regenerate.

*** gas/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* config/tc-aarch64.c (aarch64_sys_regs_sr_hsh): New.
	(parse_operands): Add entry for AARCH64_OPND_SYSREG_SR.
	(md_begin): Allocate and initialize aarch64_sys_regs_sr_hsh
	with aarch64_sys_regs_sr.
	(aarch64_features): Add new "predres" option for older
	architectures.
	* doc/c-aarch64.texi: Document the same.
	* testsuite/gas/aarch64/sysreg-4.s: New.
	* testsuite/gas/aarch64/sysreg-4.d: New.
	* testsuite/gas/aarch64/illegal-sysreg-4.d: New.
	* testsuite/gas/aarch64/illegal-sysreg-4.l: New.
	* testsuite/gas/aarch64/predres.s: New.
	* testsuite/gas/aarch64/predres.d: New.
2018-10-09 15:17:10 +01:00
Sudakshina Das 68dfbb92ef [PATCH, BINUTILS, AARCH64, 3/9] Add instruction SB for ARMv8.5-A
This patch is part of the patch series to add support for ARMv8.5-A
extensions.
(https://developer.arm.com/products/architecture/cpu-architecture/a-profile/docs/ddi0596/a/a64-base-instructions-alphabetic-order)

This instruction is retrospectively made optional for all versions of
the architecture from ARMv8.0 to ARMv8.4 and is mandatory from
ARMv8.5.  Hence a new command line option of "+sb" is added for older
architectures.

*** include/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* opcode/aarch64.h (AARCH64_FEATURE_SB): New.
	(AARCH64_ARCH_V8_5): Add AARCH64_FEATURE_SB by default.

*** opcodes/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* aarch64-tbl.h (aarch64_feature_sb): New.
	(SB, SB_INSN): New.
	(aarch64_opcode_table): Add entry for sb.
	* aarch64-asm-2.c: Regenerate.
	* aarch64-dis-2.c: Regenerate.
	* aarch64-opc-2.c: Regenerate.

*** gas/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* config/tc-aarch64.c (aarch64_features): Add new "sb" option
	for older architectures.
	* doc/c-aarch64.texi: Document the same.
	* testsuite/gas/aarch64/sb.s: New.
	* testsuite/gas/aarch64/sb.d: New.
2018-10-09 15:11:27 +01:00
Sudakshina Das 13c60ad7e1 [PATCH, BINUTILS, AARCH64, 2/9] Add Data procoessing instructions for ARMv8.5-A
This patch is part of the patch series to add support for ARMv8.5-A
extensions.
(https://developer.arm.com/products/architecture/cpu-architecture/a-profile/docs/ddi0596/a/a64-base-instructions-alphabetic-order)

This patch adds the data processing instructions that are new to
ARMv8.5-A.

1) There are 2 instructions: xaflag, axflag, that are added to
manipulate the states of the flag and are used to convert between the
Arm representation and the fcmp representation.

2) The other instructions are rounding instructions which have 8
versions based on whether the floating-point number is a
Single-Precision or Double-Precision number, whether the target
integer is a 32-bit or 64-bit integer and whether the rounding mode is
the ambient rounding mode or to zero. Each of these instruction is
available in both Scalar and Vector forms.

Since both 1) and 2) have separate identification mechanism and it is
permissible that a ARMv8.4 compliant implementation may include any
arbitrary subset of the ARMv8.5 features unless otherwise specified,
new feature bits are added.

*** include/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* opcode/aarch64.h (AARCH64_FEATURE_FLAGMANIP): New.
	(AARCH64_FEATURE_FRINTTS): New.
	(AARCH64_ARCH_V8_5): Add both by default.

*** opcodes/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* aarch64-tbl.h (aarch64_feature_flagmanip): New.
	(aarch64_feature_frintts): New.
	(FLAGMANIP, FRINTTS): New.
	(aarch64_opcode_table): Add entries for xaflag, axflag
	and frint[32,64][x,z] instructions.
	* aarch64-asm-2.c: Regenerate.
	* aarch64-dis-2.c: Regenerate.
	* aarch64-opc-2.c: Regenerate.

*** gas/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

	* testsuite/gas/aarch64/armv8_5-a-dp.s: New.
	* testsuite/gas/aarch64/armv8_5-a-dp.d: New.
2018-10-09 15:06:52 +01:00
Sudakshina Das 70d561813c [PATCH, BINUTILS, AARCH64, 1/9] Add -march=armv8.5-a and related internal feature macros
This patch is part of the patch series to add support for ARMv8.5-A
extensions.
(https://developer.arm.com/products/architecture/cpu-architecture/a-profile/exploration-tools)

This is the first of the patch series and adds -march=armv8.5-a and
other internal feature marcos needed for it.

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

    * config/tc-aarch64.c (aarch64_archs): New entry for armv8.5-a.
    * doc/c-aarch64.texi: Add documentation for the same.

*** include/ChnageLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

    * opcode/aarch64.h (AARCH64_FEATURE_V8_5): New.
    (AARCH64_ARCH_V8_5): New.

*** opcodes/ChangeLog ***

2018-10-09  Sudakshina Das  <sudi.das@arm.com>

    * aarch64-tbl.h (aarch64_feature_set aarch64_feature_v8_5): New.
    (ARMV8_5, V8_5_INSN): New.
2018-10-09 15:02:52 +01:00
H.J. Lu a4e78aa5fe x86: Add Intel ENCLV to assembler and disassembler
gas/

	* testsuite/gas/i386/se1.s: Add enclv.
	* testsuite/gas/i386/x86-64-se1.s: Likewise.
	* testsuite/gas/i386/se1.d: Updated.
	* testsuite/gas/i386/x86-64-se1.d: Likewise.

opcodes/

	* i386-dis.c (rm_table): Add enclv.
	* i386-opc.tbl: Add enclv.
	* i386-tbl.h: Regenerated.
2018-10-05 11:56:42 -07:00
Sudakshina Das dad0c3bfb5 [Arm, 3/3] Add Execution and Data Prediction instructions for AArch32
This patch is part of the patch series to add support for ARMv8.5-A
extensions.

(https://developer.arm.com/products/architecture/cpu-architecture/a-profile/exploration-tools)

This patch adds the Execution and Data Prediction Restriction
instructions (that is, cfprctx, dvprxtc, cpprctx). These are all
aliases to MCR and are disassembled as such.

This instruction is retrospectively made optional for all versions of
the architecture from ARMv8.0 to ARMv8.4 and is mandatory from
ARMv8.5.  Hence adding a new +predres for older versions of the
architecture.

*** include/ChangeLog ***

2018-10-05  Sudakshina Das  <sudi.das@arm.com>

	* opcode/arm.h (ARM_EXT2_PREDRES): New.
	(ARM_ARCH_V8_5A): Add ARM_EXT2_PREDRES by default.

*** gas/ChangeLog ***

2018-10-05  Sudakshina Das  <sudi.das@arm.com>

	* config/tc-arm.c (arm_ext_predres): New.
	(insns): Add new cfprctx, dvprctx and cpprctx instructions.
	(arm_extensions): Add "predres".
	* doc/c-arm.texi: Document the above.
	* testsuite/gas/arm/predres-bad.d: New test.
	* testsuite/gas/arm/predres-bad.l: New test.
	* testsuite/gas/arm/predres.s: New test.
	* testsuite/gas/arm/predres1.d: New test.
	* testsuite/gas/arm/predres2.d: New test.
2018-10-05 11:31:21 +01:00
Sudakshina Das 7fadb25d6f [Arm, 2/3] Add instruction SB for AArch32
This patch is part of the patch series to add support for ARMv8.5-A
extensions.

(https://developer.arm.com/products/architecture/cpu-architecture/a-profile/exploration-tools)

This patch adds the instruction SB. This instruction is
retrospectively made optional for all versions of the architecture
from ARMv8.0 to ARMv8.4 and is mandatory from ARMv8.5. Hence adding a
new "+sb" for older archtectures.

*** include/ChangeLog ***

2018-10-05  Sudakshina Das  <sudi.das@arm.com>

	* opcode/arm.h (ARM_EXT2_SB): New.
	(ARM_ARCH_V8_5A): Add ARM_EXT2_SB by default.

*** opcodes/ChangeLog ***

2018-10-05  Sudakshina Das  <sudi.das@arm.com>

	* arm-dis.c (arm_opcodes): Add sb.
	(thumb32_opcodes): Likewise.

*** gas/ChangeLog ***

2018-10-05  Sudakshina Das  <sudi.das@arm.com>

	* config/tc-arm.c (arm_ext_sb): New.
	(insns): Add new sb instruction.
	(arm_extensions): Add "sb".
	* doc/c-arm.texi: Document the above.
	* testsuite/gas/arm/sb-bad.d: New test.
	* testsuite/gas/arm/sb-bad.l: New test.
	* testsuite/gas/arm/sb-thumb1.d: New test.
	* testsuite/gas/arm/sb-thumb2.d: New test.
	* testsuite/gas/arm/sb.s: New test.
	* testsuite/gas/arm/sb1.d: New test.
	* testsuite/gas/arm/sb2.d: New test.
2018-10-05 11:31:19 +01:00
Sudakshina Das 23f233a595 [Arm, 1/3] Add -march=armv8.5-a and related internal feature macros to AArch32
This patch is part of the patch series to add support for ARMv8.5-A
extensions.

(https://developer.arm.com/products/architecture/cpu-architecture/a-profile/exploration-tools)

This is the first of the patch series and adds -march=armv8.5-a and
other internal feature marcos needed for it.

*** gas/ChangeLog ***

2018-10-05  Sudakshina Das  <sudi.das@arm.com>

	* config/tc-arm.c (arm_archs): New entry for armv8.5-a.
	(cpu_arch_ver): Likewise.
	* doc/c-arm.texi: Add documentation for the same.
	* testsuite/gas/arm/attr-march-armv8_5-a.d: New.

*** include/ChnageLog ***

2018-10-05  Sudakshina Das  <sudi.das@arm.com>

	* opcode/arm.h (ARM_EXT2_V8_5A): New.
	(ARM_AEXT2_V8_5A, ARM_ARCH_V8_5A): New.
2018-10-05 11:31:14 +01:00
Stafford Horne 1f041c6edf or1k: Add OpenRISC gas documentation
gas/ChangeLog:

yyyy-mm-dd  Stafford Horne  <shorne@gmail.com>

	* doc/Makefile.am (CPU_DOCS): Add entry for OpenRISC.
	* doc/Makefile.in: Regenerated.
	* doc/all.texi: Set OPENRISC.
	* doc/as.texi: Document OpenRISC.
	* doc/c-or1k.texi: New file.
2018-10-05 11:41:42 +09:00
Richard Henderson 07f5f4c683 or1k: Add the l.muld, l.muldu, l.macu, l.msbu insns
Also fix the incorrect definitions of multiply and divide carry and
overflow float.

Changes to the instructions are made in the .cpu file, then we
regenerate the binutils and sim files.

The changes also required a few fixups for tests and additional sim helpers.

cpu/ChangeLog:

yyyy-mm-dd  Richard Henderson  <rth@twiddle.net>
	    Stafford Horne  <shorne@gmail.com>

	* or1korbis.cpu (insn-opcode-mac): Add opcodes for MACU and MSBU.
	(insn-opcode-alu-regreg): Add opcodes for MULD and MULDU.
	(l-mul): Fix overflow support and indentation.
	(l-mulu): Fix overflow support and indentation.
	(l-muld, l-muldu, l-msbu, l-macu): New instructions.
	(l-div); Remove incorrect carry behavior.
	(l-divu): Fix carry and overflow behavior.
	(l-mac): Add overflow support.
	(l-msb, l-msbu): Add carry and overflow support.

opcodes/ChangeLog:

yyyy-mm-dd  Richard Henderson  <rth@twiddle.net>
	    Stafford Horne  <shorne@gmail.com>

	* or1k-desc.c: Regenerate.
	* or1k-desc.h: Regenerate.
	* or1k-opc.c: Regenerate.
	* or1k-opc.h: Regenerate.
	* or1k-opinst.c: Regenerate.

sim/common/ChangeLog:

yyyy-mm-dd  Stafford Horne  <shorne@gmail.com>

	* cgen-ops.h (ADDCFDI): New function, add carry flag DI variant.
	(ADDOFDI): New function, add overflow flag DI variant.
	(SUBCFDI): New function, subtract carry flag DI variant.
	(SUBOFDI): New function, subtract overflow flag DI variant.

sim/ChangeLog:

yyyy-mm-dd  Stafford Horne  <shorne@gmail.com>

	* or1k/cpu.h: Regenerate.
	* or1k/decode.c: Regenerate.
	* or1k/decode.h: Regenerate.
	* or1k/model.c: Regenerate.
	* or1k/sem-switch.c: Regenerate.
	* or1k/sem.c: Regenerate:

sim/testsuite/sim/or1k/ChangeLog:

yyyy-mm-dd  Stafford Horne  <shorne@gmail.com>

	* div.S: Fix tests to match correct overflow/carry semantics.
	* mul.S: Likewise.

gas/ChangeLog:

yyyy-mm-dd  Stafford Horne  <shorne@gmail.com>

	* testsuite/gas/or1k/allinsn.s: Add instruction tests for
	l.muld, l.muldu, l.macu, l.msb, l.msbu.
	* testsuite/gas/or1k/allinsn.d: Add test results for new
	instructions.
2018-10-05 11:41:42 +09:00
Stafford Horne c8e98e3692 or1k: Add the l.adrp insn and supporting relocations
This patch adds the new instruction and relocation as per proposal:
   https://openrisc.io/proposals/ladrp

This is to be added to the spec in an upcoming revision.  The new instruction
l.adrp loads the page offset of the current instruction offset by
a 21-bit immediate shifted left 13-bits.  This is meant to be used with
a 13-bit lower bit page offset.  This allows us to free up the got
register r16.

  l.adrp  r3, foo
  l.ori   r4, r3, po(foo)
  l.lbz   r5, po(foo)(r3)
  l.sb    po(foo)(r3), r6

The relocations we add are:

 - BFD_RELOC_OR1K_PLTA26	For PLT jump relocation with PLT entry
   asm: plta()			implemented using l.ardp, meaning
				no need for r16 (the GOT reg)

 - BFD_RELOC_OR1K_GOT_PG21	Upper 21-bit Page offset got address
   asm: got()
 - BFD_RELOC_OR1K_TLS_GD_PG21	Upper 21-bit Page offset with TLS General
   asm: tlsgd()			Dynamic calculation
 - BFD_RELOC_OR1K_TLS_LDM_PG21	Upper 21-bit Page offset with TLS local
   asm: tlsldm()		dynamic calculation
 - BFD_RELOC_OR1K_TLS_IE_PG21	Upper 21-bit Page offset with TLS Initial
   asm: gottp() 		Executable calculation
 - BFD_RELOC_OR1K_PCREL_PG21	Default relocation for disp21 (l.adrp
				instructions)

 - BFD_RELOC_OR1K_LO13		low 13-bit page offset relocation
   asm: po()			i.e. mem loads, addi etc
 - BFD_RELOC_OR1K_SLO13		low 13-bit page offset relocation
   asm: po()			i.e. mem stores, with split immediate
 - BFD_RELOC_OR1K_GOT_LO13,	low 13-bit page offset with GOT calcs
   asm: gotpo()
 - BFD_RELOC_OR1K_TLS_GD_LO13	Lower 13-bit offset with TLS GD calcs
   asm: tlsgdpo()
 - BFD_RELOC_OR1K_TLS_LDM_LO13	Lower 13-bit offset with TLS LD calcs
   asm: tlsldmpo()
 - BFD_RELOC_OR1K_TLS_IE_LO13	Lower 13-bit offset with TLS IE calcs
   asm: gottppo()

bfd/ChangeLog:

yyyy-mm-dd  Richard Henderson  <rth@twiddle.net>

	* bfd-in2.h: Regenerated.
	* elf32-or1k.c: (or1k_elf_howto_table): Fix formatting for
	R_OR1K_PLT26, Add R_OR1K_PCREL_PG21, R_OR1K_GOT_PG21,
	R_OR1K_TLS_GD_PG21, R_OR1K_TLS_LDM_PG21, R_OR1K_TLS_IE_PG21,
	R_OR1K_LO13, R_OR1K_GOT_LO13, R_OR1K_TLS_GD_LO13, R_OR1K_TLS_LDM_LO13,
	R_OR1K_TLS_IE_LO13, R_OR1K_SLO13, R_OR1K_PLTA26.
	(or1k_reloc_map): Add BFD_RELOC_OR1K_PCREL_PG21,
	BFD_RELOC_OR1K_GOT_PG21, BFD_RELOC_OR1K_TLS_GD_PG21,
	BFD_RELOC_OR1K_TLS_LDM_PG21, BFD_RELOC_OR1K_TLS_IE_PG21,
	BFD_RELOC_OR1K_LO13, BFD_RELOC_OR1K_GOT_LO13,
	BFD_RELOC_OR1K_TLS_GD_LO13, BFD_RELOC_OR1K_TLS_GD_LO13,
	BFD_RELOC_OR1K_TLS_LDM_LO13, BFD_RELOC_OR1K_TLS_IE_LO13,
	BFD_RELOC_OR1K_SLO13, BFD_RELOC_OR1K_PLTA26.
	(elf_or1k_link_hash_table): Add field saw_plta.
	(or1k_final_link_relocate): Add value calculations for new relocations.
	(or1k_elf_relocate_section): Add section relocations for new
	relocations.
	(or1k_write_plt_entry): New function.
	(or1k_elf_finish_dynamic_sections): Add support for PLTA relocations
	using new l.adrp instruction.  Cleanup PLT relocation code generation.
	* libbfd.h: Regenerated.
	* reloc.c: Add BFD_RELOC_OR1K_PCREL_PG21, BFD_RELOC_OR1K_LO13,
	BFD_RELOC_OR1K_SLO13, BFD_RELOC_OR1K_GOT_PG21, BFD_RELOC_OR1K_GOT_LO13,
	BFD_RELOC_OR1K_PLTA26, BFD_RELOC_OR1K_TLS_GD_PG21,
	BFD_RELOC_OR1K_TLS_GD_LO13, BFD_RELOC_OR1K_TLS_LDM_PG21,
	BFD_RELOC_OR1K_TLS_LDM_LO13, BFD_RELOC_OR1K_TLS_IE_PG21,
	BFD_RELOC_OR1K_TLS_IE_LO13.

cpu/ChangeLog:

yyyy-mm-dd  Richard Henderson  <rth@twiddle.net>

	* or1k.opc (parse_disp26): Add support for plta() relocations.
	(parse_disp21): New function.
	(or1k_rclass): New enum.
	(or1k_rtype): New enum.
	(or1k_imm16_relocs): Define new PO and SPO relocation mappings.
	(parse_reloc): Add new po(), gotpo() and gottppo() for LO13 relocations.
	(parse_imm16): Add support for the new 21bit and 13bit relocations.
	* or1korbis.cpu (f-disp26): Don't assume SI.
	(f-disp21): New pc-relative 21-bit 13 shifted to right.
	(insn-opcode): Add ADRP.
	(l-adrp): New instruction.

gas/ChangeLog:

yyyy-mm-dd  Richard Henderson  <rth@twiddle.net>

	* config/tc-or1k.c (or1k_apply_fix): Add BFD_RELOC_OR1K_TLS_GD_PG21,
	BFD_RELOC_OR1K_TLS_GD_LO13, BFD_RELOC_OR1K_TLS_LDM_PG21,
	BFD_RELOC_OR1K_TLS_LDM_LO13, BFD_RELOC_OR1K_TLS_IE_PG21,
	BFD_RELOC_OR1K_TLS_IE_LO13.
	* testsuite/gas/or1k/allinsn.s: Add test for l.adrp.
	* testsuite/gas/or1k/allinsn.d: Add test results for new
	instructions.
	* testsuite/gas/or1k/reloc-1.s: Add tests to generate
	R_OR1K_PLTA26, R_OR1K_GOT_PG21, R_OR1K_TLS_GD_PG21, R_OR1K_TLS_LDM_PG21,
	R_OR1K_TLS_IE_PG21, R_OR1K_LO13, R_OR1K_GOT_LO13, R_OR1K_TLS_GD_LO13,
	R_OR1K_TLD_LDM_LO13, R_OR1K_TLS_IE_LO13, R_OR1K_LO13, R_OR1K_SLO13
	relocations.
	* testsuite/gas/or1k/reloc-1.d: Add relocation results for
	tests.
	* testsuite/gas/or1k/reloc-2.s: Add negative tests for store to
	gotpo().
	* testsuite/gas/or1k/reloc-2.l: Add expected error test results.

ld/ChangeLog:

yyyy-mm-dd  Richard Henderson  <rth@twiddle.net>

	* testsuite/ld-or1k/or1k.exp: Add test cases for plt generation.
	* testsuite/ld-or1k/plt1.dd: New file.
	* testsuite/ld-or1k/plt1.s: New file.
	* testsuite/ld-or1k/plt1.x.dd: New file.
	* testsuite/ld-or1k/plta1.dd: New file.
	* testsuite/ld-or1k/plta1.s: New file.
	* testsuite/ld-or1k/pltlib.s: New file.

include/ChangeLog:

yyyy-mm-dd  Richard Henderson  <rth@twiddle.net>

	* elf/or1k.h (elf_or1k_reloc_type): Add R_OR1K_PCREL_PG21,
	R_OR1K_GOT_PG21, R_OR1K_TLS_GD_PG21, R_OR1K_TLS_LDM_PG21,
	R_OR1K_TLS_IE_PG21, R_OR1K_LO13, R_OR1K_GOT_LO13,
	R_OR1K_TLS_GD_LO13, R_OR1K_TLS_LDM_LO13, R_OR1K_TLS_IE_LO13,
	R_OR1K_SLO13, R_OR1K_PLTA26.

opcodes/ChangeLog:

yyyy-mm-dd  Richard Henderson  <rth@twiddle.net>

	* or1k-asm.c: Regenerated.
	* or1k-desc.c: Regenerated.
	* or1k-desc.h: Regenerated.
	* or1k-dis.c: Regenerated.
	* or1k-ibld.c: Regenerated.
	* or1k-opc.c: Regenerated.
	* or1k-opc.h: Regenerated.
	* or1k-opinst.c: Regenerated.
2018-10-05 11:41:41 +09:00
Richard Henderson 1c4f3780f7 or1k: Add relocations for high-signed and low-stores
This patch adds the following target relocations:

 - BFD_RELOC_HI16_S		High 16-bit relocation, for used with signed
   asm: ha()			lower.
 - BFD_RELOC_HI16_S_GOTOFF	High 16-bit GOT offset relocation for local
   asm: gotoffha()		symbols, for use with signed lower.
 - BFD_RELOC_OR1K_TLS_IE_AHI16	High 16-bit TLS relocation with initial
   asm: gottpoffha()		executable calculation, for use with signed
				lower.
 - BFD_RELOC_OR1K_TLS_LE_AHI16	High 16-bit TLS relocation for local executable
   asm: tpoffha()		variables, for use with signed lower.

 - BFD_RELOC_OR1K_SLO16		Split lower 16-bit relocation, used with
   asm: lo()			OpenRISC store instructions.
 - BFD_RELOC_OR1K_GOTOFF_SLO16	Split lower 16-bit GOT offset relocation for
   asm: gotofflo()		local symbols, used with OpenRISC store
				instructions.
 - BFD_RELOC_OR1K_TLS_LE_SLO16	Split lower 16-bit relocation for TLS local
   asm: tpofflo()		executable variables, used with OpenRISC store
				instructions.

bfd/ChangeLog:

yyyy-mm-dd  Richard Henderson  <rth@twiddle.net>
	    Stafford Horne  <shorne@gmail.com>

	* bfd-in2.h: Regenerated.
	* elf32-or1k.c (N_ONES): New macro.
	(or1k_elf_howto_table): Fix R_OR1K_PLT26 to complain on overflow.
	Add definitions for R_OR1K_TLS_TPOFF, R_OR1K_TLS_DTPOFF,
	R_OR1K_TLS_DTPMOD, R_OR1K_AHI16, R_OR1K_GOTOFF_AHI16,
	R_OR1K_TLS_IE_AHI16, R_OR1K_TLS_LE_AHI16, R_OR1K_SLO16,
	R_OR1K_GOTOFF_SLO16, R_OR1K_TLS_LE_SLO16.
	(or1k_reloc_map): Add entries for BFD_RELOC_HI16_S,
	BFD_RELOC_LO16_GOTOFF, BFD_RELOC_HI16_GOTOFF, BFD_RELOC_HI16_S_GOTOFF,
	BFD_RELOC_OR1K_TLS_IE_AHI16, BFD_RELOC_OR1K_TLS_LE_AHI16,
	BFD_RELOC_OR1K_SLO16, BFD_RELOC_OR1K_GOTOFF_SLO16,
	BFD_RELOC_OR1K_TLS_LE_SLO16.
	(or1k_reloc_type_lookup): Change search loop to start ad index 0 and
	also check results before returning.
	(or1k_reloc_name_lookup): Simplify loop to use R_OR1K_max as index
	limit.
	(or1k_final_link_relocate): New function.
	(or1k_elf_relocate_section): Add support for new AHI and SLO
	relocations.  Use or1k_final_link_relocate instead of generic
	_bfd_final_link_relocate.
	(or1k_elf_check_relocs): Add support for new AHI and SLO relocations.
	* reloc.c: Add new enums for BFD_RELOC_OR1K_SLO16,
	BFD_RELOC_OR1K_GOTOFF_SLO16, BFD_RELOC_OR1K_TLS_IE_AHI16,
	BFD_RELOC_OR1K_TLS_IE_AHI16, BFD_RELOC_OR1K_TLS_LE_AHI16,
	BFD_RELOC_OR1K_TLS_LE_SLO16.  Remove unused BFD_RELOC_OR1K_GOTOFF_HI16
	and BFD_RELOC_OR1K_GOTOFF_LO16.
	* libbfd.h: Regenerated.

cpu/ChangeLog:

yyyy-mm-dd  Richard Henderson  <rth@twiddle.net>

	* or1k.opc: Add RTYPE_ enum.
	(INVALID_STORE_RELOC): New string.
	(or1k_imm16_relocs): New array array.
	(parse_reloc): New static function that just does the parsing.
	(parse_imm16): New static function for generic parsing.
	(parse_simm16): Change to just call parse_imm16.
	(parse_simm16_split): New function.
	(parse_uimm16): Change to call parse_imm16.
	(parse_uimm16_split): New function.
	* or1korbis.cpu (simm16-split): Change to use new simm16_split.
	(uimm16-split): Change to use new uimm16_split.

gas/ChangeLog:

yyyy-mm-dd  Richard Henderson  <rth@twiddle.net>

	* testsuite/gas/or1k/allinsn.d (l_ha): Add result for ha() relocation.
	* testsuite/gas/or1k/allinsn.s (l_ha): Add test for ha() relocations.
	* testsuite/gas/or1k/allinsn.exp: Renamed to or1k.exp.
	* testsuite/gas/or1k/or1k.exp: Add reloc-2 list test.
	* testsuite/gas/or1k/reloc-1.d: New file.
	* testsuite/gas/or1k/reloc-1.s: New file.
	* testsuite/gas/or1k/reloc-2.l: New file.
	* testsuite/gas/or1k/reloc-2.s: New file.

include/ChangeLog:

yyyy-mm-dd  Richard Henderson  <rth@twiddle.net>

	* elf/or1k.h (elf_or1k_reloc_type): Add R_OR1K_AHI16,
	R_OR1K_GOTOFF_AHI16, R_OR1K_TLS_IE_AHI16, R_OR1K_TLS_LE_AHI16,
	R_OR1K_SLO16, R_OR1K_GOTOFF_SLO16, R_OR1K_TLS_LE_SLO16.

ld/ChangeLog:

yyyy-mm-dd  Richard Henderson  <rth@twiddle.net>

	* testsuite/ld-or1k/offsets1.d: New file.
	* testsuite/ld-or1k/offsets1.s: New file.
	* testsuite/ld-or1k/or1k.exp: New file.

opcodes/ChangeLog:

yyyy-mm-dd  Richard Henderson  <rth@twiddle.net>

	* or1k-asm.c: Regenerate.
2018-10-05 11:41:40 +09:00
Tamar Christina e66cfcef72 AArch64: Add MOVPRFX tests and update testsuite
This patch adds the tests and expected output for each of the conditions where
the MOVPRFX constraint should apply.

The specific test cases are all documented to indicate what the expected
behavior should be.

gas/

        * testsuite/gas/aarch64/sve-movprfx_1.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_1.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_10.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_10.l: New test.
        * testsuite/gas/aarch64/sve-movprfx_10.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_11.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_11.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_12.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_12.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_13.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_13.l: New test.
        * testsuite/gas/aarch64/sve-movprfx_13.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_14.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_14.l: New test.
        * testsuite/gas/aarch64/sve-movprfx_14.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_15.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_15.l: New test.
        * testsuite/gas/aarch64/sve-movprfx_15.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_16.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_16.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_17.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_17.l: New test.
        * testsuite/gas/aarch64/sve-movprfx_17.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_18.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_18.l: New test.
        * testsuite/gas/aarch64/sve-movprfx_18.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_19.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_19.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_2.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_2.l: New test.
        * testsuite/gas/aarch64/sve-movprfx_2.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_20.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_20.l: New test.
        * testsuite/gas/aarch64/sve-movprfx_20.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_21.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_21.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_22.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_22.l: New test.
        * testsuite/gas/aarch64/sve-movprfx_22.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_23.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_23.l: New test.
        * testsuite/gas/aarch64/sve-movprfx_23.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_24.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_24.l: New test.
        * testsuite/gas/aarch64/sve-movprfx_24.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_25.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_25.l: New test.
        * testsuite/gas/aarch64/sve-movprfx_25.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_26.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_26.l: New test.
        * testsuite/gas/aarch64/sve-movprfx_26.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_3.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_3.l: New test.
        * testsuite/gas/aarch64/sve-movprfx_3.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_4.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_4.l: New test.
        * testsuite/gas/aarch64/sve-movprfx_4.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_5.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_5.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_6.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_6.l: New test.
        * testsuite/gas/aarch64/sve-movprfx_6.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_7.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_7.l: New test.
        * testsuite/gas/aarch64/sve-movprfx_7.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_8.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_8.l: New test.
        * testsuite/gas/aarch64/sve-movprfx_8.s: New test.
        * testsuite/gas/aarch64/sve-movprfx_9.d: New test.
        * testsuite/gas/aarch64/sve-movprfx_9.l: New test.
        * testsuite/gas/aarch64/sve-movprfx_9.s: New test.
2018-10-03 18:53:49 +01:00
Tamar Christina bde90be2cd AArch64: Constraint disassembler and assembler changes.
This patch wires in the new constraint verifiers into the assembler and
disassembler.  Because of this the MOVPRFX tests have to be split out from the
generic SVE tests into their own tests so warnings can be ignored.

These tests are only intended to test the encoding correctness and not the
constraints.

gas/

	* testsuite/gas/aarch64/sve-movprfx.d: New test.
	* testsuite/gas/aarch64/sve-movprfx.s: New test.
	* testsuite/gas/aarch64/sve.d: Refactor.
	* testsuite/gas/aarch64/sve.s: Refactor.
        * testsuite/gas/aarch64/sysreg-diagnostic.d: Update.

opcodes/

	* aarch64-asm.c (aarch64_opcode_encode): Apply constraint verifier.
	* aarch64-dis.c (print_operands): Refactor to take notes.
	(print_verifier_notes): New.
	(print_aarch64_insn): Apply constraint verifier.
	(print_insn_aarch64_word): Update call to print_aarch64_insn.
	* aarch64-opc.c (aarch64_print_operand): Remove attribute, update notes format.
2018-10-03 18:51:58 +01:00
Tamar Christina 4f5d253628 AArch64: Close sequences at the end of sections
Any open sequence at the end of a section or assembly is considered an error.
This patch adds a check at the end to ensure that all sequences have been closed
and if not reports a warning.

During disassembly it's not possible to detect this condition in the back-end so
the warning is only emitted from the assembler for now.

gas/

	* config/tc-aarch64.c (force_automatic_sequence_close,
	aarch64_frob_section): New.
	* config/tc-aarch64.h (tc_frob_section, aarch64_frob_section): New.
2018-10-03 18:50:40 +01:00
Tamar Christina a68f4cd235 AArch64: Add SVE constraints verifier.
This patch adds the verification rules for move prefix constraints.

The Arm SVE instruction MOVPRFX introduces[1] constraints on the instruction at
PC+4. Particularly the following constraints are handled by this patch

* MOVPRFX must be followed by an instruction.
* MOVPRFX can only be followed by non-layout altering directives.
* MOVPRFX destination register MUST be used as the destination register in the
  instruction at PC+4, and is not allowed to be used in any other position other than
  destructive input.  This includes registers that architecturally overlap. e.g. x1
  should be treated as z1.
* MOVPRFX must be followed by a restricted set of SVE instructions.
* The size of the destination register of MOVPRFX must be equal to that of
  the operation at PC+4.
* The predicate register and operation of MOVPRFX must match that of the instruction
  at PC+4
* The predicated instruction at PC+4 must use the merging predicate.
* Architectural aliases and pseudo-instructions need to be supported as well.
* MOVPRFX cannot be the last instruction in a sequence

Any failure to adhere to any of these constrains will emit an assembly warning
and a disassembly note.

[1] https://developer.arm.com/docs/ddi0584/latest/arm-architecture-reference-manual-supplement-the-scalable-vector-extension-sve-for-armv8-a

include/

	* opcode/aarch64.h (aarch64_inst): Remove.
	(enum err_type): Add ERR_VFI.
	(aarch64_is_destructive_by_operands): New.
	(init_insn_sequence): New.
	(aarch64_decode_insn): Remove param name.

opcodes/

	* aarch64-opc.c (init_insn_block): New.
	(verify_constraints, aarch64_is_destructive_by_operands): New.
	* aarch64-opc.h (verify_constraints): New.

gas/

        * config/tc-aarch64.c (output_operand_error_report): Order warnings.
2018-10-03 18:49:37 +01:00
Tamar Christina 7e84b55d8f AArch64: Wire through instr_sequence
This patch introduces aarch64_instr_sequence which is a structure similar to IT
blocks on Arm in order to track instructions that introduce a constraint or
dependency on instruction 1..N positions away from the instruction that opened
the block.

The struct is also wired through to the locations that require it.

gas/

	* config/tc-aarch64.c (now_instr_sequence):
	(*insn_sequence, now_instr_sequence): New.
	(output_operand_error_record, do_encode): Add insn_sequence.
	(md_assemble): Update insn_sequence.
	(try_to_encode_as_unscaled_ldst, fix_mov_imm_insn, fix_insn):
	Pass insn_sequence.
	* config/tc-aarch64.h (struct aarch64_segment_info_type):
	Add insn_sequence.

include/

	* opcode/aarch64.h (struct aarch64_instr_sequence): New.
	(aarch64_opcode_encode): Use it.

opcodes/

	* aarch64-asm.c (aarch64_opcode_encode): Add insn_sequence.
	* aarch64-dis.c (insn_sequence): New.
2018-10-03 18:33:33 +01:00
Palmer Dabbelt 64a336ac13
RISC-V: Add fence.tso instruction
The RISC-V memory model has been ratified, and it includes an additional
fence: "fence.tso".  This pseudo instruction extends one of the
previously reserved full fence patterns to be less restrictive, and
therefor will execute correctly on all existing microarchitectures.
Thus there is no reason to allow this instruction to be disabled (or
unconverted to a full fence), so it's just unconditionally allowed.

I've added a test case for GAS to check that "fence.tso" correctly
assembles on rv32i-based targets.  I checked to see that "fence.tso"
appears in "gas.log", but that's the only testing I've done.

gas/ChangeLog

2018-10-02  Palmer Dabbelt  <palmer@sifive.com>

        * testsuite/gas/riscv/fence-tso.d: New file.
        * testsuite/gas/riscv/fence-tso.s: Likewise.

include/ChangeLog

2018-10-02  Palmer Dabbelt  <palmer@sifive.com>

        * opcode/riscv-opc.h (MATCH_FENCE_TSO): New define.
        (MASK_FENCE_TSO): Likewise.

opcodes/ChangeLog

2018-10-02  Palmer Dabbelt  <palmer@sifive.com>

        * riscv-opc.c (riscv_opcodes) <fence.tso>: New opcode.
2018-10-02 08:26:32 -07:00
Sandra Loosemore ca60b3af44 Skip broken assembler test on Windows host.
2018-09-26  Sandra Loosemore  <sandra@codesourcery.com>

	gas/
	* testsuite/gas/all/gas.exp: Skip "Output file must be distinct
	from input" test on Windows host.
2018-09-26 09:45:56 -07:00
Andreas Krebbel 3d6e0c015a S/390: Fix symbolic displacement in lay
Increase the fixup length to 4 for the 20 bit displacement.

gas/ChangeLog:

2018-09-25  Andreas Krebbel  <krebbel@linux.ibm.com>

	* config/tc-s390.c (md_apply_fix): Set fx_size to 4 for 20 bit
	displacements.
	* testsuite/gas/s390/s390.exp: Run new test.
	* testsuite/gas/s390/zarch-z990-symbol-lay.s: New test.
2018-09-25 17:13:28 +02:00
H.J. Lu 0192e8aeeb Correct ChangeLog entry for commit b8426d169d
commit b8426d169d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Sep 21 04:24:40 2018 -0700

    gas: Make bfin-parse.c/rl78-parse.c/rx-parse.c depend on bfd/reloc.c

It is for PR gas/23691, not PR gas/23692.
2018-09-21 04:36:08 -07:00
H.J. Lu b8426d169d gas: Make bfin-parse.c/rl78-parse.c/rx-parse.c depend on bfd/reloc.c
Since bfin-parse.c, rl78-parse.c and rx-parse.c use BFD_RELOC_XXX, we
need to regenerate them when bfd/reloc.c changhes.

	PR gas/23692
	* Makefile.am (bfin-parse.c): Depend on $(srcdir)/../bfd/reloc.c.
	(rl78-parse.c): Likewise.
	(rx-parse.c): Likewise.
	* Makefile.in: Regenerated.
2018-09-21 04:25:06 -07:00
Alan Modra be9a9af906 Fix more fallout from 17f6ade235
gas/
	* testsuite/gas/avr/large-debug-line-table.d: Update.
ld/
	* testsuite/ld-avr/gc-section-debugline.d: Update.
2018-09-21 09:55:38 +09:30
H.J. Lu ddb77fcccb gas: Update expected outputs of "readelf -wL"
Update expected outputs of "readelf -wL" for

commit 17f6ade235
Author: John Darrington <john@darrington.wattle.id.au>
Date:   Wed Sep 19 19:56:29 2018 +0200

    binutils --dwarf=decodedline: Add display of is_stmt flag

which adds display of is_stmt flag.

	PR binutils/23695
	* testsuite/gas/elf/dwarf2-11.d: Update expected outputs of
	"readelf -wL".
	* testsuite/gas/elf/dwarf2-12.d: Likewise.
	* testsuite/gas/elf/dwarf2-13.d: Likewise.
	* testsuite/gas/elf/dwarf2-14.d: Likewise.
	* testsuite/gas/elf/dwarf2-15.d: Likewise.
	* testsuite/gas/elf/dwarf2-16.d: Likewise.
	* testsuite/gas/elf/dwarf2-17.d: Likewise.
	* testsuite/gas/elf/dwarf2-18.d: Likewise.
	* testsuite/gas/elf/dwarf2-5.d: Likewise.
	* testsuite/gas/elf/dwarf2-6.d: Likewise.
	* testsuite/gas/elf/dwarf2-7.d: Likewise.
2018-09-20 10:59:07 -07:00
Maciej W. Rozycki fa9d2bd6b8 S12Z/GAS: Correct a signed vs unsigned comparison error with GCC 4.1
Fix a build error:

cc1: warnings being treated as errors
.../gas/config/tc-s12z.c: In function 'lex_opr':
.../gas/config/tc-s12z.c:617: warning: comparison between signed and unsigned
.../gas/config/tc-s12z.c:624: warning: comparison between signed and unsigned
make[4]: *** [config/tc-s12z.o] Error 1

observed with GCC 4.1.2 with the `s12z-elf' target.

Here we have a constant assembly instruction operand, whose value is
within the 24-bit unsigned range, to be placed in a machine instruction
such as to use the least space-consuming encoding.  So the sign of that
value does not matter, because signed values are out of range and are
not supposed to appear here, and we only have this warning here because
the `X_add_number' member of `struct expressionS' is of the `offsetT'
type, which is signed.

Use an auxiliary variable of an unsigned data type then, observing that
both `offsetT' and `valueT' have the same width, as they correspond to
`bfd_signed_vma' and `bfd_vma' respectively.

	gas/
	* config/tc-s12z.c (lex_opr): Use an auxiliary unsigned variable
	in encoding a constant operand.
2018-09-20 15:49:01 +01:00
Maciej W. Rozycki 16de26a611 PPC/GAS: Correct a signed vs unsigned comparison error with GCC 4.1
Fix a build error:

cc1: warnings being treated as errors
.../gas/config/tc-ppc.c: In function 'ppc_dwsect':
.../gas/config/tc-ppc.c:4091: warning: comparison between signed and unsigned
make[4]: *** [config/tc-ppc.o] Error 1

observed with GCC 4.1.2 with the `powerpc-beos' target.

Here `flag' identifies the type of a DWARF section, as used with the the
first operand to the `.dwsect' pseudo-op, and has no notion of a sign,
or for that matter being arithmetic in the first place[1].  We already
handle this correctly with the `flag' member of the `xcoff_dwsect_name'
structure, however not in the local variable used in GAS to hold the
parsed value of said `.dwsect' pseudo-op's operand.

Use an unsigned data type in GAS then too, observing that both `offsetT'
and `valueT' have the same width, as they correspond to `bfd_signed_vma'
and `bfd_vma' respectively.

References:

[1] "AIX Version 7.2: Assembler Language Reference", IBM Corporation
    2015, 2018, Section ".dwsect pseudo-op", pp. 531-532

	gas/
	* config/tc-ppc.c (ppc_dwsect): Use `valueT' rather than
	`offsetT' as the type of `flag'.
2018-09-20 15:49:01 +01:00
Maciej W. Rozycki 53b6d6f5b2 ARC: Fix build errors with large constants and C89
Fix build errors:

cc1: warnings being treated as errors
In file included from .../opcodes/arc-opc.c:2630:
.../opcodes/arc-nps400-tbl.h:38: warning: integer constant is too large for 'long' type
.../opcodes/arc-nps400-tbl.h:38: warning: integer constant is too large for 'long' type
.../opcodes/arc-nps400-tbl.h:41: warning: integer constant is too large for 'long' type
.../opcodes/arc-nps400-tbl.h:41: warning: integer constant is too large for 'long' type
[...]
.../opcodes/arc-nps400-tbl.h:712: warning: integer constant is too large for 'long' type
.../opcodes/arc-nps400-tbl.h:712: warning: integer constant is too large for 'long' type
.../opcodes/arc-nps400-tbl.h:715: warning: integer constant is too large for 'long' type
.../opcodes/arc-nps400-tbl.h:715: warning: integer constant is too large for 'long' type
make[4]: *** [arc-opc.lo] Error 1

and:

cc1: warnings being treated as errors
.../gas/config/tc-arc.c: In function 'md_number_to_chars_midend':
.../gas/config/tc-arc.c:802: warning: integer constant is too large for 'long' type
.../gas/config/tc-arc.c:810: warning: integer constant is too large for 'long' type
make[4]: *** [config/tc-arc.o] Error 1

observed with GCC 4.1.2 and presumably other C89 compilers with the
`arc-elf' and `arc-linux-gnu' targets, caused by the use of constants
the values of which are outside the range of the `int' type (or the
`long' type if it is of the same with).  In the C89 language standard
such constants are not implicitly converted to a wider type and an
explicit suffix is required for such constants.

Add a `ull' suffix then as with such constants used in other ports.

	gas/
	* config/tc-arc.c (md_number_to_chars_midend): Append `ull' to
	large constants.

	opcodes/
	* arc-nps400-tbl.h: Append `ull' to large constants throughout.
2018-09-20 15:49:00 +01:00
Nick Clifton fbaf61ad52 Andes Technology has good news for you, we plan to update the nds32 port of binutils on upstream!
We have not only removed all unsupported and obsolete code, but also supported lost of new features,
including better link-time relaxations and TLS implementations. Besides, the files generated by the
newly assembler and linker usually get higher performance and more optimized code size.

ld	* emultempl/nds32elf.em (hyper_relax): New variable.
	(nds32_elf_create_output_section_statements):
	the parameters of bfd_elf32_nds32_set_target_option
	(PARSE_AND_LIST_PROLOGUE, PARSE_AND_LIST_OPTIONS,
	PARSE_AND_LIST_ARGS_CASES): Add new option --mhyper-relax.
	* emultempl/nds32elf.em (nds32_elf_after_open): Updated.
	* emultempl/nds32elf.em (tls_desc_trampoline): New variable.
	* (nds32_elf_create_output_section_statements): Updated.
	* (nds32_elf_after_parse): Disable relaxations when PIC is enable.
	* (PARSE_AND_LIST_PROLOGUE, PARSE_AND_LIST_OPTIONS,
	PARSE_AND_LIST_ARGS_CASES): Add new option --m[no-]tlsdesc-trampoline.

include	* elf/nds32.h: Remove the unused target features.
	* dis-asm.h (disassemble_init_nds32): Declared.
	* elf/nds32.h (E_NDS32_NULL): Removed.
	(E_NDS32_HAS_DSP_INST, E_NDS32_HAS_ZOL): New.
	* opcode/nds32.h: Ident.
	(N32_SUB6, INSN_LW): New macros.
	(enum n32_opcodes): Updated.
	* elf/nds32.h: Doc fixes.
	* elf/nds32.h: Add R_NDS32_LSI.
	* elf/nds32.h: Add new relocations for TLS.

gas 	* config/tc-nds32.c: Remove the unused target features.
	(nds32_relax_relocs, md_pseudo_table, nds32_elf_record_fixup_exp,
	nds32_set_elf_flags_by_insn, nds32_insert_relax_entry,
	nds32_apply_fix): Likewise.
	(nds32_no_ex9_begin): Removed.
	* config/tc-nds32.c (add_mapping_symbol_for_align,
	make_mapping_symbol, add_mapping_symbol): New functions.
	* config/tc-nds32.h (enum mstate): New.
	(nds32_segment_info_type): Likewise.
	* configure.ac (--enable-dsp-ext, --enable-zol-ext): New options.
	* config.in: Regenerated.
	* configure: Regenerated.
	* config/tc-nds32.c (nds32_dx_regs):
	Set the value according to the configuration.
	(nds32_perf_ext, nds32_perf_ext2, nds32_string_ext, nds32_audio_ext):
	Likewise.
	(nds32_dsp_ext): New variable. Set the value according to the
	configuration.
	(nds32_zol_ext): Likewise.
	(asm_desc, nds32_pseudo_opcode_table): Make them static.
	(nds32_set_elf_flags_by_insn): Updated.
	(nds32_check_insn_available): Updated.
	(nds32_str_tolower): New function.
	* config/tc-nds32.c (relax_table): Updated.
	(md_begin): Updated.
	(md_assemble): Use XNEW macro to allocate space for `insn.info',
	and then remember to free it.
	(md_section_align): Cast (-1) to ValueT.
	(nds32_get_align): Cast (~0U) to addressT.
	(nds32_relax_branch_instructions): Updated.
	(md_convert_frag): Add new local variable `final_r_type'.
	(invalid_prev_frag): Add new bfd_boolean parameter `relax'.
	All callers changed.
	* config/tc-nds32.c (struct nds32_relocs_pattern): Add `insn' field.
	(struct nds32_hint_map): Add `option_list' field.
	(struct suffix_name, suffix_table): Remove the unused `pic' field.
	(do_pseudo_b, do_pseudo_bal): Remove the suffix checking.
	(do_pseudo_la_internal, do_pseudo_pushpopm): Indent.
	(relax_hint_bias, relax_hint_id_current): New static variables.
	(reset_bias, relax_hint_begin): New variables.
	(nds_itoa): New function.
	(CLEAN_REG, GET_OPCODE): New macros.
	(struct relax_hint_id): New.
	(nds32_relax_hint): For .relax_hint directive, we can use `begin'
	and `end' to mark the relax pattern without giving exactly id number.
	(nds32_elf_append_relax_relocs): Handle the case that the .relax_hint
	directives are attached to pseudo instruction.
	(nds32_elf_save_pseudo_pattern): Change the second parameter from
	instruction's opcode to byte code.
	(nds32_elf_build_relax_relation): Add new bfd_boolean parameter
	`pseudo_hint'.
	(nds32_lookup_pseudo_opcode): Fix the overflow issue.
	(enum nds32_insn_type): Add N32_RELAX_ALU1 and N32_RELAX_16BIT.
	(nds32_elf_record_fixup_exp, relax_ls_table, hint_map,
	nds32_find_reloc_table, nds32_match_hint_insn, nds32_parse_name):
	Updated.
	* config/tc-nds32.h (MAX_RELAX_NUM): Extend it to 6.
	(enum nds32_relax_hint_type): Merge NDS32_RELAX_HINT_LA and
	NDS32_RELAX_HINT_LS into NDS32_RELAX_HINT_LALS. Add
	NDS32_RELAX_HINT_LA_PLT, NDS32_RELAX_HINT_LA_GOT and
	NDS32_RELAX_HINT_LA_GOTOFF.
	* config/tc-nds32.h (relax_ls_table): Add floating load/store
	to gp relax pattern.
	(hint_map, nds32_find_reloc_table): Likewise.
	* configure.ac: Define NDS32_LINUX_TOOLCHAIN.
	* configure: Regenerated.
	* config.in: Regenerated.
	* config/tc-nds32.h (enum nds32_ramp): Updated.
	(enum nds32_relax_hint_type): Likewise.
	* config/tc-nds32.c: Include "errno.h" and "limits.h".
	(relax_ls_table): Add TLS relax patterns.
	(nds32_elf_append_relax_relocs): Attach BFD_RELOC_NDS32_GROUP on
	each instructions of TLS patterns.
	(nds32_elf_record_fixup_exp): Updated.
	(nds32_apply_fix): Likewise.
	(suffix_table): Add TLSDESC suffix.

binutils* testsuite/binutils-all/objcopy.exp: Set the unsupported reloc number
	from 215 to 255 for NDS32.

bfd	* elf32-nds32.c (nds32_elf_relax_loadstore):
	Remove the unused target features.
	(bfd_elf32_nds32_set_target_option): Remove the unused parameters.
	(nds32_elf_relax_piclo12, nds32_elf_relax_letlslo12,
	nds32_elf_relax_letlsadd, nds32_elf_relax_letlsls,
	nds32_elf_relax_pltgot_suff, nds32_elf_relax_got_suff
	nds32_elf_relax_gotoff_suff, calculate_plt_memory_address,
	calculate_plt_offset, calculate_got_memory_address,
	nds32_elf_check_dup_relocs): Removed.
	All callers changed.
	* elf32-nds32.h: Remove the unused macros and defines.
	(elf_nds32_link_hash_table): Remove the unused variable.
	(bfd_elf32_nds32_set_target_option): Update prototype.
	(nds32_elf_ex9_init): Removed.
	* elf32-nds32.c (nds32_convert_32_to_16): Updated.
	* elf32-nds32.c (HOWTO2, HOWTO3): Define new HOWTO macros
	to initialize array nds32_elf_howto_table in any order
	without lots of EMPTY_HOWTO.
	(nds32_reloc_map): Updated.
	* reloc.c: Add BFD_RELOC_NDS32_LSI.
	* bfd-in2.h: Regenerated.
	* bfd/libbfd.h: Regenerated.
	* elf32-nds32.c (nds32_elf_relax_howto_table): Add R_NDS32_LSI.
	(nds32_reloc_map): Likewise.
	(nds32_elf_relax_flsi): New function.
	(nds32_elf_relax_section): Support floating load/store relaxation.
	* elf32-nds32.c (NDS32_GUARD_SEC_P, elf32_nds32_local_gp_offset):
	New macro.
	(struct elf_nds32_link_hash_entry): New `offset_to_gp' field.
	(struct elf_nds32_obj_tdata): New `offset_to_gp' and `hdr_size' fields.
	(elf32_nds32_allocate_local_sym_info, nds32_elf_relax_guard,
	nds32_elf_is_target_special_symbol, nds32_elf_maybe_function_sym):
	New functions.
	(nds32_info_to_howto_rel): Add BFD_ASSERT.
	(bfd_elf32_bfd_reloc_type_table_lookup, nds32_elf_link_hash_newfunc,
	nds32_elf_link_hash_table_create, nds32_elf_relocate_section,
	nds32_elf_relax_loadstore, nds32_elf_relax_lo12, nds32_relax_adjust_label,
	bfd_elf32_nds32_set_target_option, nds32_fag_mark_relax): Updated.
	(nds32_elf_final_sda_base): Improve it to find the better gp value.
	(insert_nds32_elf_blank): Must consider `len' when inserting blanks.
	* elf32-nds32.h (bfd_elf32_nds32_set_target_option): Update prototype.
	(struct elf_nds32_link_hash_table): Add new variable `hyper_relax'.
	* elf32-nds32.c (elf32_nds32_allocate_dynrelocs): New function.
	(create_got_section): Likewise.
	(allocate_dynrelocs, nds32_elf_size_dynamic_sections,
	nds32_elf_relocate_section, nds32_elf_finish_dynamic_symbol): Updated.
	(nds32_elf_check_relocs): Fix the issue that the shared library may
	has TEXTREL entry in the dynamic section.
	(nds32_elf_create_dynamic_sections): Enable to call readonly_dynrelocs
	since the TEXTREL issue is fixed in the nds32_elf_check_relocs.
	(nds32_elf_finish_dynamic_sections): Update and add DT_RELASZ
	dynamic entry.
	(calculate_offset): Remove the unused parameter `pic_ext_target' and
	related codes.
	All callers changed.
	(elf_backend_dtrel_excludes_plt): Disable it temporarily since it
	will cause some errors for our test cases.
	* elf32-nds32.c (nds32_elf_merge_private_bfd_data): Allow to link the
	generic object.
	* reloc.c: Add TLS relocations.
	* libbfd.h: Regenerated.
	* bfd-in2.h: Regenerated.
	* elf32-nds32.h (struct section_id_list_t): New.
	(elf32_nds32_lookup_section_id, elf32_nds32_check_relax_group,
	elf32_nds32_unify_relax_group, nds32_elf_unify_tls_model):
	New prototypes.
	(elf32_nds32_compute_jump_table_size, elf32_nds32_local_tlsdesc_gotent):
	New macro.
	(nds32_insertion_sort, bfd_elf32_nds32_set_target_option,
	elf_nds32_link_hash_table): Updated.
	* elf32-nds32.c (enum elf_nds32_tls_type): New.
	(struct elf32_nds32_relax_group_t, struct relax_group_list_t): New.
	(elf32_nds32_add_dynreloc, patch_tls_desc_to_ie, get_tls_type,
	fls, ones32, list_insert, list_insert_sibling, dump_chain,
	elf32_nds32_check_relax_group, elf32_nds32_lookup_section_id,
	elf32_nds32_unify_relax_group, nds32_elf_unify_tls_model): New functions.
	(elf_nds32_obj_tdata): Add new fields.
	(elf32_nds32_relax_group_ptr, nds32_elf_local_tlsdesc_gotent): New macros.
	(nds32_elf_howto_table): Add TLS relocations.
	(nds32_reloc_map): Likewise.
	(nds32_elf_copy_indirect_symbol, nds32_elf_size_dynamic_sections,
	nds32_elf_finish_dynamic_symbol, elf32_nds32_allocate_local_sym_info,
	nds32_elf_relocate_section, bfd_elf32_nds32_set_target_option,
	nds32_elf_check_relocs, allocate_dynrelocs): Updated.
	(nds32_elf_relax_section): Call nds32_elf_unify_tls_model.
	(dtpoff_base): Rename it to `gottpof' and then update it.

opcodes	* nds32-asm.c (operand_fields): Remove the unused fields.
	(nds32_opcodes): Remove the unused instructions.
	* nds32-dis.c (nds32_ex9_info): Removed.
	(nds32_parse_opcode): Updated.
	(print_insn_nds32): Likewise.
	* nds32-asm.c (config.h, stdlib.h, string.h): New includes.
	(LEX_SET_FIELD, LEX_GET_FIELD): Update defines.
	(nds32_asm_init, build_operand_hash_table, build_keyword_hash_table,
	build_opcode_hash_table): New functions.
	(nds32_keyword_table, nds32_keyword_count_table, nds32_field_table,
	nds32_opcode_table): New.
	(hw_ktabs): Declare it to a pointer rather than an array.
	(build_hash_table): Removed.
	* nds32-asm.h (enum): Add SYN_INPUT, SYN_OUTPUT, SYN_LOPT,
	SYN_ROPT and upadte HW_GPR and HW_INT.
	* nds32-dis.c (keywords): Remove const.
	(match_field): New function.
	(nds32_parse_opcode): Updated.
	* disassemble.c (disassemble_init_for_target):
	Add disassemble_init_nds32.
	* nds32-dis.c (eum map_type): New.
	(nds32_private_data): Likewise.
	(get_mapping_symbol_type, is_mapping_symbol, nds32_symbol_is_valid,
	nds32_add_opcode_hash_table, disassemble_init_nds32): New functions.
	(print_insn_nds32): Updated.
	* nds32-asm.c (parse_aext_reg): Add new parameter.
	(parse_re, parse_re2, parse_aext_reg): Only reduced registers
	are allowed to use.
	All callers changed.
	* nds32-asm.c (keyword_usr, keyword_sr): Updated.
	(operand_fields): Add new fields.
	(nds32_opcodes): Add new instructions.
	(keyword_aridxi_mx): New keyword.
	* nds32-asm.h (enum): Add NASM_ATTR_DSP_ISAEXT, HW_AEXT_ARIDXI_MX
	and NASM_ATTR_ZOL.
	(ALU2_1, ALU2_2, ALU2_3): New macros.
	* nds32-dis.c (nds32_filter_unknown_insn): Updated.
2018-09-20 13:32:58 +01:00
Tamar Christina af81c43b51 Fix Aarch64 bug in warning filtering.
This fixes a small bug with the warning filtering code, which when a line has
generated a warning and a template decode error (due to the way templates are
resolved) which would not have been emitted and warnings are being suppressed
with -W it would erroneously emit the error.

I have no testcase for this because the only places we generate warnings during
encoding/decoding now is using msr/mrs and system registers.  They don't have a
template that would trigger this.

However an upcoming patch series will have tests in it which would expose this bug.

gas/ChangeLog:

	* config/tc-aarch64.c (output_operand_error_report): Apply filtering to
	current instead of head message.
2018-09-18 14:37:56 +01:00
Jim Wilson 4e2b18982a RISC-V: bge[u] should get higher priority than ble[u].
2018-09-17  Kito Cheng  <kito@andestech.com>
gas/
	* testsuite/gas/riscv/bge.d: New.
	* testsuite/gas/riscv/bge.s: Likewise.
opcodes/
	* riscv-opc.c (riscv_opcodes): Adjust the order of ble and
	  bleu.
2018-09-17 11:43:08 -07:00
H.J. Lu 04e2a1829e x86: Set EVex=2 on EVEX.128 only vmovd and vmovq
EVEX "VMOVD xmm1, r32/m32", "VMOVD r32/m32, xmm2", "VMOVQ xmm1, r64/m64",
"VMOVD r64/m64, xmm2", "VMOVQ xmm1, xmm2/m64" and "VMOVQ xmm1/m64, xmm2"
can only be encoded with EVEX.128.  Set EVex=2 on EVEX.128 only vmovd and
vmovq.

gas/

	PR gas/23670
	* testsuite/gas/i386/evex-lig-2.d: New file.
	* testsuite/gas/i386/evex-lig-2.s: Likewise.
	* testsuite/gas/i386/x86-64-evex-lig-2.d: Likewise.
	* testsuite/gas/i386/x86-64-evex-lig-2.s: Likewise.
	* testsuite/gas/i386/i386.exp: Run evex-lig-2 and
	x86-64-evex-lig-2.

opcodes/

	PR gas/23670
	* i386-dis-evex.h (evex_table): Use EVEX_LEN_0F6E_P_2,
	EVEX_LEN_0F7E_P_1, EVEX_LEN_0F7E_P_2 and EVEX_LEN_0FD6_P_2.
	(EVEX_LEN_0F6E_P_2): New EVEX_LEN_TABLE entry.
	(EVEX_LEN_0F7E_P_1): Likewise.
	(EVEX_LEN_0F7E_P_2): Likewise.
	(EVEX_LEN_0FD6_P_2): Likewise.
	* i386-dis.c (USE_EVEX_LEN_TABLE): New.
	(EVEX_LEN_TABLE): Likewise.
	(EVEX_LEN_0F6E_P_2): New enum.
	(EVEX_LEN_0F7E_P_1): Likewise.
	(EVEX_LEN_0F7E_P_2): Likewise.
	(EVEX_LEN_0FD6_P_2): Likewise.
	(evex_len_table): New.
	(get_valid_dis386): Handle USE_EVEX_LEN_TABLE.
	* i386-opc.tbl: Set EVex=2 on EVEX.128 only vmovd and vmovq.
	* i386-tbl.h: Regenerated.
2018-09-17 09:33:35 -07:00
H.J. Lu d5f787c2bc x86: Set Vex=1 on VEX.128 only vmovd and vmovq
AVX "VMOVD xmm1, r32/m32", "VMOVD r32/m32, xmm2", "VMOVQ xmm1, r64/m64"
and "VMOVD r64/m64, xmm2" can only be encoded with VEX.128.  Set Vex=1
on VEX.128 only vmovd and vmovq.

gas/

	PR gas/23665
	* testsuite/gas/i386/avx-scalar.s: Remove vmovq and vmovd tests.
	* testsuite/gas/i386/x86-64-avx-scalar.s: Likewise.
	* testsuite/gas/i386/avx-scalar-intel.d: Updated.
	* testsuite/gas/i386/avx-scalar.d: Likewise.
	* testsuite/gas/i386/x86-64-avx-scalar-intel.d: Likewise.
	* testsuite/gas/i386/x86-64-avx-scalar.d: Likewise.
	* testsuite/gas/i386/i386.exp: Run avx-scalar2 and
	x86-64-avx-scalar2.
	* testsuite/gas/i386/avx-scalar-2.d: New file.
	* testsuite/gas/i386/avx-scalar-2.s: Likewise.
	* testsuite/gas/i386/x86-64-avx-scalar-2.d: Likewise.
	* testsuite/gas/i386/x86-64-avx-scalar-2.s: Likewise.

opcodes/

	PR gas/23665
	* i386-dis.c (vex_len_table): Update VEX_LEN_0F6E_P_2 and
	VEX_LEN_0F7E_P_2 entries.
	* i386-opc.tbl: Set Vex=1 on VEX.128 only vmovd and vmovq.
	* i386-tbl.h: Regenerated.
2018-09-17 09:31:17 -07:00
H.J. Lu 0375113302 x86: Add -mvexwig=[0|1] option to assembler
Add -mvexwig=[0|1] option to x86 assembler to control how the assembler
should encode the VEX.W bit in WIG VEX instructions.

	* gas/NEWS: Mention -mvexwig=[0|1] option.
	* config/tc-i386.c (vexwig): New.
	(build_vex_prefix): Set the VEX.W bit for -mvexwig=1 for WIG
	VEX instructions.
	(OPTION_MVEXWIG): New.
	(md_longopts): Add -mvexwig=.
	(md_parse_option): Handle OPTION_MVEXWIG.
	(md_show_usage): Show -mvexwig=[0|1].
	* doc/c-i386.texi: Document -mvexwig=[0|1].
	* testsuite/gas/i386/avx-wig.d: New file.
	* testsuite/gas/i386/avx-wig.s: Likewise.
	* testsuite/gas/i386/avx2-wig.d: Likewise.
	* testsuite/gas/i386/avx2-wig.s: Likewise.
	* testsuite/gas/i386/x86-64-avx-wig.d: Likewise.
	* testsuite/gas/i386/x86-64-avx-wig.s: Likewise.
	* testsuite/gas/i386/x86-64-avx2-wig.d: Likewise.
	* testsuite/gas/i386/x86-64-avx2-wig.s: Likewise.
	* testsuite/gas/i386/i386.exp: Run avx-wig, avx2-wig,
	x86-64-avx-wig and x86-64-avx2-wig.
2018-09-17 09:26:29 -07:00
Alan Modra a4b9568c7e Remove bogus notarget in gas teststuite
* testsuite/gas/arm/arch7.d: Delete notarget.
	* testsuite/gas/arm/arch7a-mp.d: Likewise.
	* testsuite/gas/arm/arch7em.d: Likewise.
	* testsuite/gas/arm/archv8m-main-dsp-5.d: Likewise.
	* testsuite/gas/arm/barrier.d: Likewise.
	* testsuite/gas/arm/bignum1.d: Likewise.
	* testsuite/gas/arm/thumb32.d: Likewise.
	* testsuite/gas/elf/dwarf2-1.d: Likewise.
	* testsuite/gas/elf/dwarf2-2.d: Likewise.
	* testsuite/gas/elf/dwarf2-4.d: Likewise.
	* testsuite/gas/elf/group2.d: Likewise.
	* testsuite/gas/arm/mapshort-elf.d: Only notarget pe and wince.
	* testsuite/gas/elf/dwarf2-3.d: Delete notarget, xfail ft32 and h8300.
	* testsuite/gas/elf/dwarf2-6.d: Delete notarget, xfail a few.
2018-09-17 23:22:30 +09:30
Alan Modra 0b1352e04c A few hppa testcase tidies
binutils/
	* testsuite/lib/binutils-common.exp (is_som_format): New proc.
	(run_dump_test): Correct target test for alternate .comm syntax.
	(get_standard_section_names): Handle som format.
	* testsuite/lib/utils-lib.exp (default_binutils_assemble_flags):
	Correct target test for alternate .comm syntax.
gas/
	* testsuite/gas/all/gas.exp (redef3): Don't xfail for hppa.
	(octa): Run for hppa.
	* testsuite/gas/elf/elf.exp (common1, common2): Likewise.
	* testsuite/gas/elf/symver.d: Delete notarget.
ld/
	* testsuite/ld-elf/comm-data5.d: Remove notarget for hppa.
	* testsuite/ld-scripts/defined6.d: Likewise.
2018-09-17 23:17:14 +09:30
Nick Clifton a0a8a9340d Ensure that binutils test names are unique.
binutils* testsuite/binutils-all/compress.exp: Rename second "objcopy
	zlib-gnu compress debug sections 3" test to "objcopy zlib-gabi
	compress debug sections 3" and use gabi object files instead
	of gnu object files.
	* testsuite/binutils-all/objcopy.exp: Add suffix to the names
	of the "ELF group" tests.
	* testsuite/binutils-all/readelf.exp (proc readelf_find_size):
	Add an iteration parameter and include it in the name of the
	test.  Update callers to include an iteration count.

gas	* testuite/gas/elf/group0a.d: Add extra details to the test
	name.
	* testuite/gas/elf/group0b.d: Likewise.
	* testuite/gas/elf/group1a.d: Likewise.
	* testuite/gas/elf/group1b.d: Likewise.
	* testuite/gas/elf/group0b.d: Likewise.
	* testuite/gas/elf/section9.d: Likewise.
	* testuite/gas/i386/ilp32/lns/lns-common-1.d: Likewise.
	* testuite/gas/i386/ilp32/lns/lns-duplicate-1.d: Likewise.

ld	* testuite/ld/ld-elf/audit.exp: Differentiate the names of the
	two "Run with shared with --audit" tests.
	* testuite/ld/ld-elf/compress.exp: Differentiate the zlib
	compressed debug output test names.
	* testuite/ld/ld-i386/tlspie1.d: Add extra details to the test
	name.
	* testuite/ld/ld-i386/tlspie2.d: Likewise.
	* testuite/ld/ld-size/size.exp: Add missing escapes to the end
	of lines in the size-3e test.
	* testuite/ld/ld-unique/unique.exp: Differentiate the names of
	the two "Checking unique PIC object" tests.
	* testuite/ld/ld-x86-64/tlspie1.d: Add extra details to the test
	name.
2018-09-17 10:10:47 +01:00
H.J. Lu 3c3741435f x86: Set Vex=1 on VEX.128 only vmovq
AVX "VMOVQ xmm1, xmm2/m64" and "VMOVQ xmm1/m64, xmm2" can only be
encoded with VEX.128.  Set Vex=1 on VEX.128 only vmovq and update
assembler tests.

gas/

	PR gas/23665
	* testsuite/gas/i386/avx-scalar-intel.d: Updated.
	* testsuite/gas/i386/avx-scalar.d: Likewise.
	* testsuite/gas/i386/x86-64-avx-scalar-intel.d: Likewise.
	* testsuite/gas/i386/x86-64-avx-scalar.d: Likewise.

opcodes/

	PR gas/23665
	* i386-dis.c (vex_len_table): Update VEX_LEN_0F7E_P_1 and
	VEX_LEN_0FD6_P_2 entries.
	* i386-opc.tbl: Set Vex=1 on VEX.128 only vmovq.
	* i386-tbl.h: Regenerated.
2018-09-15 14:50:40 -07:00
Alan Modra 8ffb70eb57 Consolidate run_dump_test
This merges the three versions of run_dump_test.  Improved warning
handling versus the old gas version shows up a number of tests that
need their disassembly updating:
arm-linuxeabi  +FAIL: ARM v1 instructions
arm-linuxeabi  +FAIL: Accepted v8-a with ARMv8.1 AdvSIMD.
arm-linuxeabi  +FAIL: bl local instructions for v4t.
arm-linuxeabi  +FAIL: UDF
and some that now fail due to detecting assembly warnings:
h8300-elf  +FAIL: binutils-all/strip-13
h8300-elf  +FAIL: binutils-all/strip-14
h8300-elf  +FAIL: binutils-all/strip-15

I've generally kept the union of all run_dump_test features, except
that the ld target aliases "cfi" and "shared" have disappeared, as has
the binutils substitution of $srcdir as $scrdir/$subdir.

binutils/
	* testsuite/binutils-all/add-symbol.d: Add "section_subst: no".
	* testsuite/binutils-all/elfedit.exp: Don't set tempfile or copyfile.
	* testsuite/binutils-all/symbols-1.d,
	* testsuite/binutils-all/symbols-2.d,
	* testsuite/binutils-all/symbols-3.d,
	* testsuite/binutils-all/symbols-4.d: Quote '*' and '!'.
	* testsuite/binutils-all/add-empty-section.d,
	* testsuite/binutils-all/add-section.d,
	* testsuite/binutils-all/elfedit.exp,
	* testsuite/binutils-all/note-1.d,
	* testsuite/binutils-all/pr23633.d: Add $subdir after $srcdir.
	* testsuite/config/default.exp (AS, ASFLAGS): Define.
	* testsuite/config/hppa.sed: Handle all common symbols.
	* testsuite/lib/binutils-common.exp (run_dump_test): New proc,
	merged from three other versions.
	(slurp_options, file_contents, set_file_contents): Likewise.
	(big_or_little_endian, get_standard_section_names): Likewise.
	* testsuite/lib/utils-lib.exp (run_dump_test): Delete.
	(slurp_options, proc file_contents): Delete.
	(get_standard_section_names): Delete.
gas/
	* testsuite/config/default.exp: Make tmpdir.
	* testsuite/lib/gas-defs.exp (run_dump_test): Delete.
	(get_standard_section_names, slurp_options): Delete.
ld/
	* testsuite/ld-d10v/reloc-007.d,
	* testsuite/ld-d10v/reloc-008.d,
	* testsuite/ld-d10v/reloc-015.d,
	* testsuite/ld-d10v/reloc-016.d: Remove "error:".
	* testsuite/ld-elf/eh-frame-hdr.d,
	* testsuite/ld-elf/eh5.d,
	* testsuite/ld-gc/personality.d: Replace "cfi" and "shared" in
	target list with appropriate proc.
	* testsuite/ld-elf/frame.exp: Use check_shared_lib_support rather
	than "istarget shared".
	* testsuite/lib/ld-lib.exp (proc big_or_little_endian): Delete.
	(run_dump_test, slurp_options, file_contents): Delete.
	(set_file_contents, istarget): Delete.
2018-09-15 16:56:55 +09:30
Alan Modra 99bcaeaf0f run_dump_test replace PROG with DUMPPROG in gas and ld
To be compatible with the binutils version, that uses PROG for the
tool under test and DUMPPROG for the dump tool.

gas/
	* testsuite/gas/mips/aent-2.d,
	* testsuite/gas/mips/aent-mdebug-2.d,
	* testsuite/gas/mips/attr-gnu-4-0.d,
	* testsuite/gas/mips/attr-gnu-4-1.d,
	* testsuite/gas/mips/attr-gnu-4-2.d,
	* testsuite/gas/mips/attr-gnu-4-3.d,
	* testsuite/gas/mips/attr-gnu-4-5.d,
	* testsuite/gas/mips/attr-gnu-4-6.d,
	* testsuite/gas/mips/attr-gnu-4-7.d,
	* testsuite/gas/mips/attr-none-double.d,
	* testsuite/gas/mips/attr-none-o32-fp64-nooddspreg.d,
	* testsuite/gas/mips/attr-none-o32-fp64.d,
	* testsuite/gas/mips/attr-none-o32-fpxx.d,
	* testsuite/gas/mips/attr-none-single-float.d,
	* testsuite/gas/mips/attr-none-soft-float.d,
	* testsuite/gas/mips/elf-rel27.d,
	* testsuite/gas/mips/loc-swap-2.d,
	* testsuite/gas/mips/loc-swap-3.d,
	* testsuite/gas/mips/loc-swap.d,
	* testsuite/gas/mips/micromips@loc-swap-2.d,
	* testsuite/gas/mips/micromips@loc-swap.d,
	* testsuite/gas/mips/micromips@stabs-symbol-type.d,
	* testsuite/gas/mips/mips16-intermix.d,
	* testsuite/gas/mips/mips16@loc-swap-2.d,
	* testsuite/gas/mips/mips16@loc-swap.d,
	* testsuite/gas/mips/mips16@stabs-symbol-type.d,
	* testsuite/gas/mips/mips16e@loc-swap.d,
	* testsuite/gas/mips/no-odd-spreg.d,
	* testsuite/gas/mips/odd-spreg.d,
	* testsuite/gas/mips/r6-attr-none-double.d,
	* testsuite/gas/mips/stabs-symbol-type.d,
	* testsuite/lib/gas-defs.exp (run_dump_test): Replace PROG
	with DUMPPROG.
ld/
	* testsuite/lib/ld-lib.exp (run_dump_test): Replace PROG
	with DUMPPROG.
2018-09-15 16:24:18 +09:30
Alan Modra 4abd8e8de7 gas testuite fixes: don't match dump.o
The consolidated run_dump_test will use object file names based on the
source file name, like the current ld version.

	* testsuite/gas/elf/symver.d,
	* testsuite/gas/ft32/insn.d,
	* testsuite/gas/ft32/insnsc.d,
	* testsuite/gas/i386/ilp32/elf/symver.d,
	* testsuite/gas/lm32/csr.d,
	* testsuite/gas/lm32/insn.d,
	* testsuite/gas/m68hc11/9s12x-exg-sex-tfr.d,
	* testsuite/gas/m68hc11/9s12x-mov.d,
	* testsuite/gas/m68hc11/hexprefix.d,
	* testsuite/gas/m68hc11/insns9s12x.d,
	* testsuite/gas/m68hc11/insns9s12xg.d,
	* testsuite/gas/mep/dj1.be.d,
	* testsuite/gas/mep/dj1.le.d,
	* testsuite/gas/mips/set-arch.d,
	* testsuite/gas/mips/tls-o32.d,
	* testsuite/gas/nios2/branch-r2.d,
	* testsuite/gas/nios2/branch.d,
	* testsuite/gas/pdp11/absreloc.d,
	* testsuite/gas/pdp11/opcode.d,
	* testsuite/gas/pdp11/pr14480.d,
	* testsuite/gas/pdp11/pr23481.d,
	* testsuite/gas/ppc/xcoff-dwsect-1-32.d,
	* testsuite/gas/ppc/xcoff-dwsect-1-64.d,
	* testsuite/gas/rx/abs.d,
	* testsuite/gas/rx/adc.d,
	* testsuite/gas/rx/add.d,
	* testsuite/gas/rx/and.d,
	* testsuite/gas/rx/bclr.d,
	* testsuite/gas/rx/bcnd.d,
	* testsuite/gas/rx/bmcnd.d,
	* testsuite/gas/rx/bnot.d,
	* testsuite/gas/rx/bra.d,
	* testsuite/gas/rx/brk.d,
	* testsuite/gas/rx/bset.d,
	* testsuite/gas/rx/bsr.d,
	* testsuite/gas/rx/btst.d,
	* testsuite/gas/rx/clrpsw.d,
	* testsuite/gas/rx/cmp.d,
	* testsuite/gas/rx/dbt.d,
	* testsuite/gas/rx/div.d,
	* testsuite/gas/rx/divu.d,
	* testsuite/gas/rx/emaca.d,
	* testsuite/gas/rx/emsba.d,
	* testsuite/gas/rx/emul.d,
	* testsuite/gas/rx/emula.d,
	* testsuite/gas/rx/emulu.d,
	* testsuite/gas/rx/fadd.d,
	* testsuite/gas/rx/fcmp.d,
	* testsuite/gas/rx/fdiv.d,
	* testsuite/gas/rx/fmul.d,
	* testsuite/gas/rx/fsqrt.d,
	* testsuite/gas/rx/fsub.d,
	* testsuite/gas/rx/ftoi.d,
	* testsuite/gas/rx/ftou.d,
	* testsuite/gas/rx/gprel.d,
	* testsuite/gas/rx/int.d,
	* testsuite/gas/rx/itof.d,
	* testsuite/gas/rx/jmp.d,
	* testsuite/gas/rx/jsr.d,
	* testsuite/gas/rx/machi.d,
	* testsuite/gas/rx/maclh.d,
	* testsuite/gas/rx/maclo.d,
	* testsuite/gas/rx/max.d,
	* testsuite/gas/rx/min.d,
	* testsuite/gas/rx/mov.d,
	* testsuite/gas/rx/movco.d,
	* testsuite/gas/rx/movli.d,
	* testsuite/gas/rx/movu.d,
	* testsuite/gas/rx/msbhi.d,
	* testsuite/gas/rx/msblh.d,
	* testsuite/gas/rx/msblo.d,
	* testsuite/gas/rx/mul.d,
	* testsuite/gas/rx/mulhi.d,
	* testsuite/gas/rx/mullh.d,
	* testsuite/gas/rx/mullo.d,
	* testsuite/gas/rx/mvfacgu.d,
	* testsuite/gas/rx/mvfachi.d,
	* testsuite/gas/rx/mvfaclo.d,
	* testsuite/gas/rx/mvfacmi.d,
	* testsuite/gas/rx/mvfc.d,
	* testsuite/gas/rx/mvfcp.d,
	* testsuite/gas/rx/mvtacgu.d,
	* testsuite/gas/rx/mvtachi.d,
	* testsuite/gas/rx/mvtaclo.d,
	* testsuite/gas/rx/mvtc.d,
	* testsuite/gas/rx/mvtcp.d,
	* testsuite/gas/rx/neg.d,
	* testsuite/gas/rx/nop.d,
	* testsuite/gas/rx/not.d,
	* testsuite/gas/rx/opecp.d,
	* testsuite/gas/rx/or.d,
	* testsuite/gas/rx/pop.d,
	* testsuite/gas/rx/popc.d,
	* testsuite/gas/rx/popm.d,
	* testsuite/gas/rx/pr19665.d,
	* testsuite/gas/rx/pr22737.d,
	* testsuite/gas/rx/push.d,
	* testsuite/gas/rx/pushc.d,
	* testsuite/gas/rx/pushm.d,
	* testsuite/gas/rx/r-bcc.d,
	* testsuite/gas/rx/r-bra.d,
	* testsuite/gas/rx/racl.d,
	* testsuite/gas/rx/racw.d,
	* testsuite/gas/rx/rdacl.d,
	* testsuite/gas/rx/rdacw.d,
	* testsuite/gas/rx/revl.d,
	* testsuite/gas/rx/revw.d,
	* testsuite/gas/rx/rmpa.d,
	* testsuite/gas/rx/rolc.d,
	* testsuite/gas/rx/rorc.d,
	* testsuite/gas/rx/rotl.d,
	* testsuite/gas/rx/rotr.d,
	* testsuite/gas/rx/round.d,
	* testsuite/gas/rx/rte.d,
	* testsuite/gas/rx/rtfi.d,
	* testsuite/gas/rx/rts.d,
	* testsuite/gas/rx/rtsd.d,
	* testsuite/gas/rx/sat.d,
	* testsuite/gas/rx/satr.d,
	* testsuite/gas/rx/sbb.d,
	* testsuite/gas/rx/sccnd.d,
	* testsuite/gas/rx/scmpu.d,
	* testsuite/gas/rx/setpsw.d,
	* testsuite/gas/rx/shar.d,
	* testsuite/gas/rx/shll.d,
	* testsuite/gas/rx/shlr.d,
	* testsuite/gas/rx/smovb.d,
	* testsuite/gas/rx/smovf.d,
	* testsuite/gas/rx/smovu.d,
	* testsuite/gas/rx/sstr.d,
	* testsuite/gas/rx/stnz.d,
	* testsuite/gas/rx/stz.d,
	* testsuite/gas/rx/sub.d,
	* testsuite/gas/rx/suntil.d,
	* testsuite/gas/rx/swhile.d,
	* testsuite/gas/rx/tst.d,
	* testsuite/gas/rx/utof.d,
	* testsuite/gas/rx/wait.d,
	* testsuite/gas/rx/xchg.d,
	* testsuite/gas/rx/xor.d,
	* testsuite/gas/s12z/abs.d,
	* testsuite/gas/s12z/adc-imm.d,
	* testsuite/gas/s12z/adc-opr.d,
	* testsuite/gas/s12z/add-imm.d,
	* testsuite/gas/s12z/add-opr.d,
	* testsuite/gas/s12z/and-imm.d,
	* testsuite/gas/s12z/and-opr.d,
	* testsuite/gas/s12z/and-or-cc.d,
	* testsuite/gas/s12z/bfext-special.d,
	* testsuite/gas/s12z/bfext.d,
	* testsuite/gas/s12z/bit-manip.d,
	* testsuite/gas/s12z/bit.d,
	* testsuite/gas/s12z/bra-expression-defined.d,
	* testsuite/gas/s12z/bra-expression-undef.d,
	* testsuite/gas/s12z/bra.d,
	* testsuite/gas/s12z/brclr-symbols.d,
	* testsuite/gas/s12z/brset-clr-opr-imm-rel.d,
	* testsuite/gas/s12z/brset-clr-opr-reg-rel.d,
	* testsuite/gas/s12z/brset-clr-reg-imm-rel.d,
	* testsuite/gas/s12z/brset-clr-reg-reg-rel.d,
	* testsuite/gas/s12z/clb.d,
	* testsuite/gas/s12z/clr-opr.d,
	* testsuite/gas/s12z/clr.d,
	* testsuite/gas/s12z/cmp-imm.d,
	* testsuite/gas/s12z/cmp-opr-inc.d,
	* testsuite/gas/s12z/cmp-opr-rdirect.d,
	* testsuite/gas/s12z/cmp-opr-reg.d,
	* testsuite/gas/s12z/cmp-opr-rindirect.d,
	* testsuite/gas/s12z/cmp-opr-sxe4.d,
	* testsuite/gas/s12z/cmp-opr-xys.d,
	* testsuite/gas/s12z/cmp-s-imm.d,
	* testsuite/gas/s12z/cmp-s-opr.d,
	* testsuite/gas/s12z/cmp-xy.d,
	* testsuite/gas/s12z/com-opr.d,
	* testsuite/gas/s12z/complex-shifts.d,
	* testsuite/gas/s12z/db-tb-cc-opr.d,
	* testsuite/gas/s12z/db-tb-cc-reg.d,
	* testsuite/gas/s12z/dbCC.d,
	* testsuite/gas/s12z/dec-opr.d,
	* testsuite/gas/s12z/dec.d,
	* testsuite/gas/s12z/div.d,
	* testsuite/gas/s12z/eor.d,
	* testsuite/gas/s12z/exg.d,
	* testsuite/gas/s12z/ext24-ld-xy.d,
	* testsuite/gas/s12z/inc-opr.d,
	* testsuite/gas/s12z/inc.d,
	* testsuite/gas/s12z/inh.d,
	* testsuite/gas/s12z/jmp.d,
	* testsuite/gas/s12z/jsr.d,
	* testsuite/gas/s12z/ld-imm-page2.d,
	* testsuite/gas/s12z/ld-imm.d,
	* testsuite/gas/s12z/ld-immu18.d,
	* testsuite/gas/s12z/ld-large-direct.d,
	* testsuite/gas/s12z/ld-opr.d,
	* testsuite/gas/s12z/ld-s-opr.d,
	* testsuite/gas/s12z/ld-small-direct.d,
	* testsuite/gas/s12z/lea-immu18.d,
	* testsuite/gas/s12z/lea.d,
	* testsuite/gas/s12z/mac.d,
	* testsuite/gas/s12z/min-max.d,
	* testsuite/gas/s12z/mod.d,
	* testsuite/gas/s12z/mov.d,
	* testsuite/gas/s12z/mul-imm.d,
	* testsuite/gas/s12z/mul-opr-opr.d,
	* testsuite/gas/s12z/mul-opr.d,
	* testsuite/gas/s12z/mul-reg.d,
	* testsuite/gas/s12z/mul.d,
	* testsuite/gas/s12z/neg-opr.d,
	* testsuite/gas/s12z/not-so-simple-shifts.d,
	* testsuite/gas/s12z/opr-18u.d,
	* testsuite/gas/s12z/opr-expr.d,
	* testsuite/gas/s12z/opr-ext-18.d,
	* testsuite/gas/s12z/opr-idx-24-reg.d,
	* testsuite/gas/s12z/opr-idx3-reg.d,
	* testsuite/gas/s12z/opr-idx3-xysp-24.d,
	* testsuite/gas/s12z/opr-indirect-expr.d,
	* testsuite/gas/s12z/opr-symbol.d,
	* testsuite/gas/s12z/or-imm.d,
	* testsuite/gas/s12z/or-opr.d,
	* testsuite/gas/s12z/p2-mul.d,
	* testsuite/gas/s12z/page2-inh.d,
	* testsuite/gas/s12z/psh-pul.d,
	* testsuite/gas/s12z/qmul.d,
	* testsuite/gas/s12z/rotate.d,
	* testsuite/gas/s12z/sat.d,
	* testsuite/gas/s12z/sbc-imm.d,
	* testsuite/gas/s12z/sbc-opr.d,
	* testsuite/gas/s12z/shift.d,
	* testsuite/gas/s12z/simple-shift.d,
	* testsuite/gas/s12z/single-ops.d,
	* testsuite/gas/s12z/specd6.d,
	* testsuite/gas/s12z/st-large-direct.d,
	* testsuite/gas/s12z/st-opr.d,
	* testsuite/gas/s12z/st-s-opr.d,
	* testsuite/gas/s12z/st-small-direct.d,
	* testsuite/gas/s12z/st-xy.d,
	* testsuite/gas/s12z/sub-imm.d,
	* testsuite/gas/s12z/sub-opr.d,
	* testsuite/gas/s12z/tfr.d,
	* testsuite/gas/s12z/trap.d,
	* testsuite/gas/sh/fdpic.d,
	* testsuite/gas/sh/sh2a-pic.d,
	* testsuite/gas/sh/sh2a.d: Don't match object file name.
	* testsuite/gas/wasm32/disass-2.d,
	* testsuite/gas/wasm32/disass.d: Likewise, and tidy regexps.
2018-09-15 16:24:18 +09:30
Alan Modra e643ed088a gas run_dump_test rename stderr and error-output
Use warning_output and error_output, like the ld version of
run_dump_test.  Note that some tests used the wrong option, and this
went undetected since the gas version of run_dump_test doesn't
properly check tool error status.  This patch corrects wrong options,
in preparation for a later patch that will check error status.

	* testsuite/gas/aarch64/armv8_2-a-crypto-fp16-illegal.d,
	* testsuite/gas/aarch64/armv8_2-a-illegal.d,
	* testsuite/gas/aarch64/armv8_4-a-illegal.d,
	* testsuite/gas/aarch64/armv8_4-a-registers-illegal.d,
	* testsuite/gas/aarch64/deprecated.d,
	* testsuite/gas/aarch64/diagnostic.d,
	* testsuite/gas/aarch64/illegal-2.d,
	* testsuite/gas/aarch64/illegal-by-element.d,
	* testsuite/gas/aarch64/illegal-crypto-nofp.d,
	* testsuite/gas/aarch64/illegal-fcmla.d,
	* testsuite/gas/aarch64/illegal-fjcvtzs.d,
	* testsuite/gas/aarch64/illegal-fp16-nofp.d,
	* testsuite/gas/aarch64/illegal-ldapr.d,
	* testsuite/gas/aarch64/illegal-ldraa.d,
	* testsuite/gas/aarch64/illegal-lse.d,
	* testsuite/gas/aarch64/illegal-nofp-armv8_3.d,
	* testsuite/gas/aarch64/illegal-nofp16.d,
	* testsuite/gas/aarch64/illegal-ras-1.d,
	* testsuite/gas/aarch64/illegal-sysreg-2.d,
	* testsuite/gas/aarch64/illegal-sysreg-3.d,
	* testsuite/gas/aarch64/illegal.d,
	* testsuite/gas/aarch64/legacy_reg_names.d,
	* testsuite/gas/aarch64/pan-illegal.d,
	* testsuite/gas/aarch64/pr22529.d,
	* testsuite/gas/aarch64/rm-simd-ext.d,
	* testsuite/gas/aarch64/sve-invalid.d,
	* testsuite/gas/aarch64/sve-reg-diagnostic.d,
	* testsuite/gas/aarch64/sve-sysreg-invalid.d,
	* testsuite/gas/aarch64/sysreg-diagnostic.d,
	* testsuite/gas/aarch64/verbose-error.d,
	* testsuite/gas/all/byte.d,
	* testsuite/gas/all/org-1.d,
	* testsuite/gas/all/org-2.d,
	* testsuite/gas/all/org-3.d,
	* testsuite/gas/all/sleb128-9.d,
	* testsuite/gas/arc/asm-errors-2.d,
	* testsuite/gas/arc/asm-errors-3.d,
	* testsuite/gas/arc/asm-errors.d,
	* testsuite/gas/arc/attr-rf16.d,
	* testsuite/gas/arc/relocs-errors.d,
	* testsuite/gas/arc/textinsn-errors.d,
	* testsuite/gas/arm/addsw-bad.d,
	* testsuite/gas/arm/addthumb2err.d,
	* testsuite/gas/arm/adr-invalid.d,
	* testsuite/gas/arm/arch7em-bad-1.d,
	* testsuite/gas/arm/arch7em-bad-2.d,
	* testsuite/gas/arm/arch7em-bad-3.d,
	* testsuite/gas/arm/arch7m-bad.d,
	* testsuite/gas/arm/archv6s-m-bad.d,
	* testsuite/gas/arm/archv6t2-bad.d,
	* testsuite/gas/arm/arm-idiv-bad.d,
	* testsuite/gas/arm/arm-it-bad-2.d,
	* testsuite/gas/arm/arm-it-bad-3.d,
	* testsuite/gas/arm/arm-it-bad.d,
	* testsuite/gas/arm/arm3-bad.d,
	* testsuite/gas/arm/arm7-bad.d,
	* testsuite/gas/arm/armv1-bad.d,
	* testsuite/gas/arm/armv1.d,
	* testsuite/gas/arm/armv2-mp-bad.d,
	* testsuite/gas/arm/armv8-2-fp16-scalar-bad.d,
	* testsuite/gas/arm/armv8-2-fp16-simd-warning-thumb.d,
	* testsuite/gas/arm/armv8-2-fp16-simd-warning.d,
	* testsuite/gas/arm/armv8-a+rdma-warning.d,
	* testsuite/gas/arm/armv8-a-bad.d,
	* testsuite/gas/arm/armv8-a-it-bad.d,
	* testsuite/gas/arm/armv8-r-bad.d,
	* testsuite/gas/arm/armv8-r-it-bad.d,
	* testsuite/gas/arm/armv8_2-a-fp16-illegal.d,
	* testsuite/gas/arm/armv8_3-a-fp-bad.d,
	* testsuite/gas/arm/armv8_3-a-simd-bad.d,
	* testsuite/gas/arm/barrier-bad-thumb.d,
	* testsuite/gas/arm/barrier-bad.d,
	* testsuite/gas/arm/bl-local-v4t.d,
	* testsuite/gas/arm/blx-bl-convert.d,
	* testsuite/gas/arm/blx-local.d,
	* testsuite/gas/arm/branch-reloc.d,
	* testsuite/gas/arm/copro-arm_v2plus-arm_v1.d,
	* testsuite/gas/arm/copro-arm_v5plus-arm_v4.d,
	* testsuite/gas/arm/copro-arm_v5teplus-arm_v5.d,
	* testsuite/gas/arm/copro-arm_v6plus-arm_v5te.d,
	* testsuite/gas/arm/copro-thumb_v6t2plus-thumb_v4t-1.d,
	* testsuite/gas/arm/copro-thumb_v6t2plus-thumb_v4t-2.d,
	* testsuite/gas/arm/copro-thumb_v6t2plus-thumb_v4t-3.d,
	* testsuite/gas/arm/copro-thumb_v6t2plus-thumb_v4t-4.d,
	* testsuite/gas/arm/crc32-armv8-a-bad.d,
	* testsuite/gas/arm/crc32-armv8-r-bad.d,
	* testsuite/gas/arm/depr-swp.d,
	* testsuite/gas/arm/dest-unpredictable.d,
	* testsuite/gas/arm/dotprod-illegal.d,
	* testsuite/gas/arm/dotprod-legacy-arch.d,
	* testsuite/gas/arm/forbid-armv7-idiv-ext.d,
	* testsuite/gas/arm/group-reloc-alu-encoding-bad.d,
	* testsuite/gas/arm/group-reloc-alu-parsing-bad.d,
	* testsuite/gas/arm/group-reloc-ldc-encoding-bad.d,
	* testsuite/gas/arm/group-reloc-ldc-parsing-bad.d,
	* testsuite/gas/arm/group-reloc-ldr-encoding-bad.d,
	* testsuite/gas/arm/group-reloc-ldr-parsing-bad.d,
	* testsuite/gas/arm/group-reloc-ldrs-encoding-bad.d,
	* testsuite/gas/arm/group-reloc-ldrs-parsing-bad.d,
	* testsuite/gas/arm/insn-error-a.d,
	* testsuite/gas/arm/insn-error-t.d,
	* testsuite/gas/arm/inst-po-2.d,
	* testsuite/gas/arm/iwmmxt-bad.d,
	* testsuite/gas/arm/iwmmxt-bad2.d,
	* testsuite/gas/arm/ld-sp-warn-cortex-m3.d,
	* testsuite/gas/arm/ld-sp-warn-cortex-m4.d,
	* testsuite/gas/arm/ld-sp-warn-v7.d,
	* testsuite/gas/arm/ld-sp-warn-v7a.d,
	* testsuite/gas/arm/ld-sp-warn-v7em.d,
	* testsuite/gas/arm/ld-sp-warn-v7m.d,
	* testsuite/gas/arm/ld-sp-warn-v7r.d,
	* testsuite/gas/arm/ld-sp-warn.d,
	* testsuite/gas/arm/ldgesb-bad.d,
	* testsuite/gas/arm/ldgesh-bad.d,
	* testsuite/gas/arm/ldr-bad.d,
	* testsuite/gas/arm/ldr-t-bad.d,
	* testsuite/gas/arm/ldrd-unpredictable.d,
	* testsuite/gas/arm/ldsgeb.d,
	* testsuite/gas/arm/ldsgeh.d,
	* testsuite/gas/arm/missing.d,
	* testsuite/gas/arm/mrs-msr-arm-v7-a-bad.d,
	* testsuite/gas/arm/mrs-msr-thumb-v7-m-bad.d,
	* testsuite/gas/arm/msr-imm-bad.d,
	* testsuite/gas/arm/msr-reg-bad.d,
	* testsuite/gas/arm/mul-overlap.d,
	* testsuite/gas/arm/neon-addressing-bad.d,
	* testsuite/gas/arm/neon-cond-bad.d,
	* testsuite/gas/arm/neon-ldst-align-bad.d,
	* testsuite/gas/arm/neon-ldst-es-bad.d,
	* testsuite/gas/arm/neon-suffix-bad.d,
	* testsuite/gas/arm/neon-vmov-bad.d,
	* testsuite/gas/arm/noarm.d,
	* testsuite/gas/arm/pr18256.d,
	* testsuite/gas/arm/pr18347.d,
	* testsuite/gas/arm/pr20429.d,
	* testsuite/gas/arm/pr22773.d,
	* testsuite/gas/arm/r15-bad.d,
	* testsuite/gas/arm/reloc-bad.d,
	* testsuite/gas/arm/req.d,
	* testsuite/gas/arm/shift-bad-pc.d,
	* testsuite/gas/arm/shift-bad.d,
	* testsuite/gas/arm/simd_by_scalar_low_regbank.d,
	* testsuite/gas/arm/simd_by_scalar_low_regbank_thumb.d,
	* testsuite/gas/arm/sp-pc-validations-bad-t-v8a.d,
	* testsuite/gas/arm/sp-pc-validations-bad-t.d,
	* testsuite/gas/arm/sp-pc-validations-bad.d,
	* testsuite/gas/arm/sp-usage-thumb2-relax-on-v7.d,
	* testsuite/gas/arm/srs-arm.d,
	* testsuite/gas/arm/srs-t2.d,
	* testsuite/gas/arm/strex-bad-t.d,
	* testsuite/gas/arm/t16-bad.d,
	* testsuite/gas/arm/thumb-b-bad.d,
	* testsuite/gas/arm/thumb-w-bad.d,
	* testsuite/gas/arm/thumb2_bad_reg.d,
	* testsuite/gas/arm/thumb2_it_bad.d,
	* testsuite/gas/arm/thumb2_it_bad_auto.d,
	* testsuite/gas/arm/thumb2_ldmstm_bad.d,
	* testsuite/gas/arm/thumb2_ldstd_unpredictable.d,
	* testsuite/gas/arm/thumb2_mul-bad.d,
	* testsuite/gas/arm/thumb2_str-bad.d,
	* testsuite/gas/arm/thumb32.d,
	* testsuite/gas/arm/udf-bad.d,
	* testsuite/gas/arm/udf.d,
	* testsuite/gas/arm/undefined.d,
	* testsuite/gas/arm/undefined_coff.d,
	* testsuite/gas/arm/vcmp-zero-bad.d,
	* testsuite/gas/arm/vcvt-bad.d,
	* testsuite/gas/arm/vfp-bad.d,
	* testsuite/gas/arm/vfp-bad_t2.d,
	* testsuite/gas/arm/vfpv3-d16-bad.d,
	* testsuite/gas/arm/vldm-thumb-bad.d,
	* testsuite/gas/arm/vldmw-arm-bad.d,
	* testsuite/gas/arm/vldmw-thumb-bad.d,
	* testsuite/gas/arm/vstr-arm-bad.d,
	* testsuite/gas/arm/vstr-thumb-bad.d,
	* testsuite/gas/arm/weakdef-2.d,
	* testsuite/gas/avr/pr21621.d,
	* testsuite/gas/elf/bad-bss.d,
	* testsuite/gas/elf/bad-group.d,
	* testsuite/gas/elf/bad-group.err,
	* testsuite/gas/elf/bad-section-flag.d,
	* testsuite/gas/elf/bad-section-flag.err,
	* testsuite/gas/elf/bad-size.d,
	* testsuite/gas/elf/bad-size.err,
	* testsuite/gas/elf/common1.d,
	* testsuite/gas/elf/common2.d,
	* testsuite/gas/elf/common5a.d,
	* testsuite/gas/elf/common5b.d,
	* testsuite/gas/elf/common5c.d,
	* testsuite/gas/elf/common5d.d,
	* testsuite/gas/elf/dwarf2-10.d,
	* testsuite/gas/elf/dwarf2-8.d,
	* testsuite/gas/elf/dwarf2-9.d,
	* testsuite/gas/elf/pr21661.d,
	* testsuite/gas/elf/pseudo.d,
	* testsuite/gas/elf/section13.d,
	* testsuite/gas/i386/bad-size.d,
	* testsuite/gas/i386/bundle-bad.d,
	* testsuite/gas/i386/ilp32/x86-64-sse-check-warn.d,
	* testsuite/gas/i386/intel-intel.d,
	* testsuite/gas/i386/intel.d,
	* testsuite/gas/i386/intelok.d,
	* testsuite/gas/i386/mpx-add-bnd-prefix.d,
	* testsuite/gas/i386/sse-check-warn.d,
	* testsuite/gas/i386/string-ok.d,
	* testsuite/gas/i386/vgather-check-warn.d,
	* testsuite/gas/i386/x86-64-mpx-add-bnd-prefix.d,
	* testsuite/gas/i386/x86-64-sse-check-warn.d,
	* testsuite/gas/i386/x86-64-vgather-check-warn.d,
	* testsuite/gas/mips/addiu-error.d,
	* testsuite/gas/mips/branch-extern-3.d,
	* testsuite/gas/mips/branch-extern-4.d,
	* testsuite/gas/mips/branch-local-2.d,
	* testsuite/gas/mips/branch-local-3.d,
	* testsuite/gas/mips/branch-local-5.d,
	* testsuite/gas/mips/branch-local-6.d,
	* testsuite/gas/mips/branch-local-n32-2.d,
	* testsuite/gas/mips/branch-local-n32-3.d,
	* testsuite/gas/mips/branch-local-n32-5.d,
	* testsuite/gas/mips/branch-local-n32-6.d,
	* testsuite/gas/mips/branch-local-n64-2.d,
	* testsuite/gas/mips/branch-local-n64-3.d,
	* testsuite/gas/mips/branch-local-n64-5.d,
	* testsuite/gas/mips/branch-local-n64-6.d,
	* testsuite/gas/mips/branch-section-3.d,
	* testsuite/gas/mips/branch-section-4.d,
	* testsuite/gas/mips/branch-weak-3.d,
	* testsuite/gas/mips/branch-weak-4.d,
	* testsuite/gas/mips/break-error.d,
	* testsuite/gas/mips/crc-err.d,
	* testsuite/gas/mips/crc64-err.d,
	* testsuite/gas/mips/ginv-err.d,
	* testsuite/gas/mips/interaptiv-mr2@isa-override-1.d,
	* testsuite/gas/mips/interaptiv-mr2@isa-override-2.d,
	* testsuite/gas/mips/isa-override-2.d,
	* testsuite/gas/mips/lui-1.d,
	* testsuite/gas/mips/lui-2.d,
	* testsuite/gas/mips/macro-warn-1-n32.d,
	* testsuite/gas/mips/macro-warn-1.d,
	* testsuite/gas/mips/macro-warn-2.d,
	* testsuite/gas/mips/macro-warn-3.d,
	* testsuite/gas/mips/macro-warn-4.d,
	* testsuite/gas/mips/micromips-branch-delay.d,
	* testsuite/gas/mips/micromips-branch-relax-insn32-pic.d,
	* testsuite/gas/mips/micromips-branch-relax-insn32.d,
	* testsuite/gas/mips/micromips-branch-relax-pic.d,
	* testsuite/gas/mips/micromips-branch-relax.d,
	* testsuite/gas/mips/micromips-compact.d,
	* testsuite/gas/mips/micromips-insn32.d,
	* testsuite/gas/mips/micromips-noinsn32.d,
	* testsuite/gas/mips/micromips-size-1.d,
	* testsuite/gas/mips/micromips-trap.d,
	* testsuite/gas/mips/micromips-warn-branch-delay.d,
	* testsuite/gas/mips/micromips.d,
	* testsuite/gas/mips/micromips@addiu-error.d,
	* testsuite/gas/mips/micromips@mips5-fp.d,
	* testsuite/gas/mips/micromips@msa-relax.d,
	* testsuite/gas/mips/micromips@relax-at.d,
	* testsuite/gas/mips/micromips@relax-offset.d,
	* testsuite/gas/mips/micromips@relax.d,
	* testsuite/gas/mips/mips-gp32-fp64-pic.d,
	* testsuite/gas/mips/mips-gp32-fp64.d,
	* testsuite/gas/mips/mips-gp64-fp32-pic.d,
	* testsuite/gas/mips/mips-gp64-fp32.d,
	* testsuite/gas/mips/mips-gp64-fp64.d,
	* testsuite/gas/mips/mips16-32@mips16-insn-e.d,
	* testsuite/gas/mips/mips16-32@mips16-insn-t.d,
	* testsuite/gas/mips/mips16-32@mips16-macro-e.d,
	* testsuite/gas/mips/mips16-32@mips16-macro-t.d,
	* testsuite/gas/mips/mips16-32@mips16-macro.d,
	* testsuite/gas/mips/mips16-64@mips16-insn-e.d,
	* testsuite/gas/mips/mips16-64@mips16-insn-t.d,
	* testsuite/gas/mips/mips16-absolute-reloc-2.d,
	* testsuite/gas/mips/mips16-absolute-reloc-3.d,
	* testsuite/gas/mips/mips16-branch-addend-5.d,
	* testsuite/gas/mips/mips16-branch-unextended-1.d,
	* testsuite/gas/mips/mips16-branch-unextended-2.d,
	* testsuite/gas/mips/mips16-insn-e.d,
	* testsuite/gas/mips/mips16-insn-t.d,
	* testsuite/gas/mips/mips16-jal-t.d,
	* testsuite/gas/mips/mips16-macro-e.d,
	* testsuite/gas/mips/mips16-macro-t.d,
	* testsuite/gas/mips/mips16-pcrel-2.d,
	* testsuite/gas/mips/mips16-pcrel-3.d,
	* testsuite/gas/mips/mips16-pcrel-4.d,
	* testsuite/gas/mips/mips16-pcrel-5.d,
	* testsuite/gas/mips/mips16-pcrel-absolute-n64-4.d,
	* testsuite/gas/mips/mips16-pcrel-absolute-n64-6.d,
	* testsuite/gas/mips/mips16-pcrel-absolute-pic-n64-4.d,
	* testsuite/gas/mips/mips16-pcrel-absolute-pic-n64-6.d,
	* testsuite/gas/mips/mips16-pcrel-addend-n64-8.d,
	* testsuite/gas/mips/mips16-pcrel-addend-n64-9.d,
	* testsuite/gas/mips/mips16-pcrel-addend-pic-8.d,
	* testsuite/gas/mips/mips16-pcrel-addend-pic-9.d,
	* testsuite/gas/mips/mips16-pcrel-delay-0.d,
	* testsuite/gas/mips/mips16-pcrel-delay-1.d,
	* testsuite/gas/mips/mips16-pcrel-n64-0.d,
	* testsuite/gas/mips/mips16-pcrel-n64-1.d,
	* testsuite/gas/mips/mips16-pcrel-pic-0.d,
	* testsuite/gas/mips/mips16-pcrel-pic-1.d,
	* testsuite/gas/mips/mips16-reg-error.d,
	* testsuite/gas/mips/mips16-relax-unextended-1.d,
	* testsuite/gas/mips/mips16-relax-unextended-2.d,
	* testsuite/gas/mips/mips16-reloc-error.d,
	* testsuite/gas/mips/mips16-sdrasp.d,
	* testsuite/gas/mips/mips16@addiu-error.d,
	* testsuite/gas/mips/mips16e-32@mips16-insn-e.d,
	* testsuite/gas/mips/mips16e-32@mips16-insn-t.d,
	* testsuite/gas/mips/mips16e-32@mips16-macro-e.d,
	* testsuite/gas/mips/mips16e-32@mips16-macro-t.d,
	* testsuite/gas/mips/mips16e-32@mips16-macro.d,
	* testsuite/gas/mips/mips16e-32@mips16e-64.d,
	* testsuite/gas/mips/mips16e2-32@mips16-insn-e.d,
	* testsuite/gas/mips/mips16e2-32@mips16-insn-t.d,
	* testsuite/gas/mips/mips16e2-32@mips16-macro-e.d,
	* testsuite/gas/mips/mips16e2-32@mips16-macro-t.d,
	* testsuite/gas/mips/mips16e2-32@mips16-macro.d,
	* testsuite/gas/mips/mips16e2-32@mips16e-64.d,
	* testsuite/gas/mips/mips16e2-copy-err.d,
	* testsuite/gas/mips/mips16e2-imm-error.d,
	* testsuite/gas/mips/mips16e2-interaptiv-mr2@mips16-insn-e.d,
	* testsuite/gas/mips/mips16e2-interaptiv-mr2@mips16-insn-t.d,
	* testsuite/gas/mips/mips16e2-interaptiv-mr2@mips16-macro-e.d,
	* testsuite/gas/mips/mips16e2-interaptiv-mr2@mips16-macro-t.d,
	* testsuite/gas/mips/mips16e2-interaptiv-mr2@mips16-macro.d,
	* testsuite/gas/mips/mips16e2-interaptiv-mr2@mips16-sub.d,
	* testsuite/gas/mips/mips16e2-interaptiv-mr2@mips16e-64-sub.d,
	* testsuite/gas/mips/mips16e2-interaptiv-mr2@mips16e-64.d,
	* testsuite/gas/mips/mips16e2-interaptiv-mr2@mips16e-sub.d,
	* testsuite/gas/mips/mips16e2-mt-err.d,
	* testsuite/gas/mips/mips16e2-reloc-error.d,
	* testsuite/gas/mips/mips16e2@lui-2.d,
	* testsuite/gas/mips/mips16e2@mips16-pcrel-2.d,
	* testsuite/gas/mips/mips16e2@mips16-pcrel-delay-0.d,
	* testsuite/gas/mips/mips16e2@mips16-pcrel-delay-1.d,
	* testsuite/gas/mips/mips1@isa-override-2.d,
	* testsuite/gas/mips/mips1@relax-offset.d,
	* testsuite/gas/mips/mips2@isa-override-2.d,
	* testsuite/gas/mips/mips32-mt.d,
	* testsuite/gas/mips/mips32@isa-override-2.d,
	* testsuite/gas/mips/mips32r2@isa-override-2.d,
	* testsuite/gas/mips/mips32r3@isa-override-2.d,
	* testsuite/gas/mips/mips32r5@isa-override-2.d,
	* testsuite/gas/mips/mips32r6@isa-override-2.d,
	* testsuite/gas/mips/mips5-fp.d,
	* testsuite/gas/mips/mips64-mips3d-incl.d,
	* testsuite/gas/mips/mips64-mips3d.d,
	* testsuite/gas/mips/mipsr6@mips5-fp.d,
	* testsuite/gas/mips/msa-relax.d,
	* testsuite/gas/mips/octeon3@isa-override-1.d,
	* testsuite/gas/mips/octeon3@isa-override-2.d,
	* testsuite/gas/mips/option-pic-relax-2.d,
	* testsuite/gas/mips/option-pic-relax-3.d,
	* testsuite/gas/mips/option-pic-relax-4.d,
	* testsuite/gas/mips/option-pic-relax-5.d,
	* testsuite/gas/mips/org-1.d,
	* testsuite/gas/mips/org-10.d,
	* testsuite/gas/mips/org-4.d,
	* testsuite/gas/mips/org-5.d,
	* testsuite/gas/mips/org-6.d,
	* testsuite/gas/mips/r3000@isa-override-2.d,
	* testsuite/gas/mips/r3000@relax-offset.d,
	* testsuite/gas/mips/r3900@isa-override-2.d,
	* testsuite/gas/mips/r3900@relax-offset.d,
	* testsuite/gas/mips/reginfo-2-n32.d,
	* testsuite/gas/mips/reginfo-2.d,
	* testsuite/gas/mips/relax-at.d,
	* testsuite/gas/mips/relax-offset.d,
	* testsuite/gas/mips/relax-swap1-mips1.d,
	* testsuite/gas/mips/relax-swap1-mips2.d,
	* testsuite/gas/mips/relax-swap2.d,
	* testsuite/gas/mips/relax.d,
	* testsuite/gas/mips/save-err.d,
	* testsuite/gas/mips/set-arch.d,
	* testsuite/gas/mips/xpa-err.d,
	* testsuite/gas/mips/xpa-virt-err.d,
	* testsuite/gas/msp430/bad.d,
	* testsuite/gas/msp430/errata_warns.d,
	* testsuite/gas/msp430/pr22133.d,
	* testsuite/gas/ppc/lsp-checks.d,
	* testsuite/gas/ppc/misalign.d,
	* testsuite/gas/ppc/spe2-checks.d,
	* testsuite/gas/riscv/bad-csr.d,
	* testsuite/gas/riscv/c-addi16sp-fail.d,
	* testsuite/gas/riscv/c-addi4spn-fail.d,
	* testsuite/gas/riscv/c-fld-fsd-fail.d,
	* testsuite/gas/riscv/c-lui-fail.d,
	* testsuite/gas/riscv/c-nonzero-imm.d,
	* testsuite/gas/riscv/c-nonzero-reg.d,
	* testsuite/gas/riscv/fence-fail.d,
	* testsuite/gas/riscv/lla64-fail.d,
	* testsuite/gas/riscv/rouding-fail.d,
	* testsuite/gas/sh/pcrel-hms.d,
	* testsuite/gas/sh/pcrel.d,
	* testsuite/gas/sparc/dcti-couples-v8.d,
	* testsuite/gas/sparc/dcti-couples-v9c.d,
	* testsuite/gas/tic6x/arch-invalid-1.d,
	* testsuite/gas/tic6x/arch-invalid-2.d,
	* testsuite/gas/tic6x/dir-junk.d,
	* testsuite/gas/tic6x/insns-bad-1.d,
	* testsuite/gas/tic6x/insns-bad-2.d,
	* testsuite/gas/tic6x/parallel-bad-1.d,
	* testsuite/gas/tic6x/parallel-bad-2.d,
	* testsuite/gas/tic6x/parallel-bad-3.d,
	* testsuite/gas/tic6x/parallel-bad-4.d,
	* testsuite/gas/tic6x/predicate-bad-1.d,
	* testsuite/gas/tic6x/predicate-bad-2.d,
	* testsuite/gas/tic6x/predicate-bad-3.d,
	* testsuite/gas/tic6x/reloc-bad-1.d,
	* testsuite/gas/tic6x/reloc-bad-2.d,
	* testsuite/gas/tic6x/reloc-bad-3.d,
	* testsuite/gas/tic6x/reloc-bad-4.d,
	* testsuite/gas/tic6x/reloc-bad-5.d,
	* testsuite/gas/tic6x/reloc-bad-6.d,
	* testsuite/gas/tic6x/resource-func-unit-1.d,
	* testsuite/gas/tic6x/resource-func-unit-2.d,
	* testsuite/gas/tic6x/sploop-bad-1.d,
	* testsuite/gas/tic6x/sploop-bad-2.d,
	* testsuite/gas/tic6x/sploop-bad-3.d,
	* testsuite/gas/tic6x/sploop-bad-4.d,
	* testsuite/gas/tic6x/sploop-bad-5.d,
	* testsuite/gas/tic6x/sploop-bad-6.d,
	* testsuite/gas/tic6x/sploop-bad-7.d,
	* testsuite/gas/tic6x/unwind-bad-1.d,
	* testsuite/gas/tic6x/unwind-bad-2.d,
	* testsuite/lib/gas-defs.exp (run_dump_tests): Replace stderr
	and error-output with warning_output and error_output.
	(slurp_options): Accept underscore rather than dash.
2018-09-15 16:24:18 +09:30
Alan Modra b47b60aad8 gas run_dump_test rename not-target and not-skip
Use notarget and noskip, like the ld testsuite.

	* testsuite/gas/aarch64/codealign.d,
	* testsuite/gas/aarch64/litpool.d,
	* testsuite/gas/aarch64/mapmisc.d,
	* testsuite/gas/aarch64/mapping.d,
	* testsuite/gas/aarch64/mapping2.d,
	* testsuite/gas/aarch64/mapping3.d,
	* testsuite/gas/aarch64/mapping4.d,
	* testsuite/gas/all/align.d,
	* testsuite/gas/all/fill-1.d,
	* testsuite/gas/all/incbin.d,
	* testsuite/gas/all/redef2.d,
	* testsuite/gas/all/redef3.d,
	* testsuite/gas/all/relax.d,
	* testsuite/gas/all/sleb128-2.d,
	* testsuite/gas/all/sleb128-4.d,
	* testsuite/gas/all/sleb128-5.d,
	* testsuite/gas/all/sleb128-7.d,
	* testsuite/gas/all/sleb128-9.d,
	* testsuite/gas/all/weakref1.d,
	* testsuite/gas/all/weakref1g.d,
	* testsuite/gas/all/weakref1l.d,
	* testsuite/gas/all/weakref1u.d,
	* testsuite/gas/all/weakref1w.d,
	* testsuite/gas/arm/abs12.d,
	* testsuite/gas/arm/arch4t.d,
	* testsuite/gas/arm/arch7.d,
	* testsuite/gas/arm/arch7a-mp.d,
	* testsuite/gas/arm/arch7em.d,
	* testsuite/gas/arm/archv8m-main-dsp-5.d,
	* testsuite/gas/arm/armv8a-automatic-hlt.d,
	* testsuite/gas/arm/armv8a-automatic-lda.d,
	* testsuite/gas/arm/attr-syntax.d,
	* testsuite/gas/arm/automatic-bw.d,
	* testsuite/gas/arm/automatic-cbz.d,
	* testsuite/gas/arm/automatic-clrex.d,
	* testsuite/gas/arm/automatic-lda.d,
	* testsuite/gas/arm/automatic-ldaex.d,
	* testsuite/gas/arm/automatic-ldaexb.d,
	* testsuite/gas/arm/automatic-ldrex.d,
	* testsuite/gas/arm/automatic-ldrexd.d,
	* testsuite/gas/arm/automatic-movw.d,
	* testsuite/gas/arm/automatic-sdiv.d,
	* testsuite/gas/arm/automatic-strexb.d,
	* testsuite/gas/arm/barrier-thumb.d,
	* testsuite/gas/arm/barrier.d,
	* testsuite/gas/arm/bignum1.d,
	* testsuite/gas/arm/blx-bad.d,
	* testsuite/gas/arm/blx-local.s,
	* testsuite/gas/arm/crc32-armv8-a-bad.d,
	* testsuite/gas/arm/crc32-armv8-a.d,
	* testsuite/gas/arm/crc32-armv8-r-bad.d,
	* testsuite/gas/arm/crc32-armv8-r.d,
	* testsuite/gas/arm/eabi_attr_1.d,
	* testsuite/gas/arm/fp-save.d,
	* testsuite/gas/arm/local_function.d,
	* testsuite/gas/arm/local_label_coff.d,
	* testsuite/gas/arm/local_label_wince.d,
	* testsuite/gas/arm/mapping.d,
	* testsuite/gas/arm/mapping2.d,
	* testsuite/gas/arm/mapping3.d,
	* testsuite/gas/arm/mapping4.d,
	* testsuite/gas/arm/mapshort-elf.d,
	* testsuite/gas/arm/mask_1-armv8-a.d,
	* testsuite/gas/arm/mask_1-armv8-r.d,
	* testsuite/gas/arm/mrs-msr-thumb-v6t2.d,
	* testsuite/gas/arm/mrs-msr-thumb-v7-m.d,
	* testsuite/gas/arm/mrs-msr-thumb-v7e-m.d,
	* testsuite/gas/arm/nomapping.d,
	* testsuite/gas/arm/pic.d,
	* testsuite/gas/arm/pic_vxworks.d,
	* testsuite/gas/arm/plt-1.d,
	* testsuite/gas/arm/reloc-bad.d,
	* testsuite/gas/arm/reloc-fdpic.d,
	* testsuite/gas/arm/t2-branch-global.d,
	* testsuite/gas/arm/thumb.d,
	* testsuite/gas/arm/thumb2_ldr_immediate_armv6.d,
	* testsuite/gas/arm/thumb2_ldr_immediate_highregs_armv6t2.d,
	* testsuite/gas/arm/thumb2_pool.d,
	* testsuite/gas/arm/thumb2_vpool.d,
	* testsuite/gas/arm/thumb2_vpool_be.d,
	* testsuite/gas/arm/thumb32.d,
	* testsuite/gas/arm/thumbver.d,
	* testsuite/gas/arm/tls.d,
	* testsuite/gas/arm/tls_vxworks.d,
	* testsuite/gas/arm/undefined_coff.d,
	* testsuite/gas/arm/unwind.d,
	* testsuite/gas/arm/unwind_vxworks.d,
	* testsuite/gas/arm/v4bx.d,
	* testsuite/gas/arm/vfma1.d,
	* testsuite/gas/arm/vldm-arm.d,
	* testsuite/gas/arm/weakdef-1.d,
	* testsuite/gas/arm/weakdef-2.d,
	* testsuite/gas/arm/wince.d,
	* testsuite/gas/arm/wince_inst.d,
	* testsuite/gas/elf/bignums.d,
	* testsuite/gas/elf/common5a.d,
	* testsuite/gas/elf/common5b.d,
	* testsuite/gas/elf/common5c.d,
	* testsuite/gas/elf/common5d.d,
	* testsuite/gas/elf/dwarf2-1.d,
	* testsuite/gas/elf/dwarf2-10.d,
	* testsuite/gas/elf/dwarf2-11.d,
	* testsuite/gas/elf/dwarf2-12.d,
	* testsuite/gas/elf/dwarf2-13.d,
	* testsuite/gas/elf/dwarf2-14.d,
	* testsuite/gas/elf/dwarf2-15.d,
	* testsuite/gas/elf/dwarf2-16.d,
	* testsuite/gas/elf/dwarf2-17.d,
	* testsuite/gas/elf/dwarf2-18.d,
	* testsuite/gas/elf/dwarf2-2.d,
	* testsuite/gas/elf/dwarf2-3.d,
	* testsuite/gas/elf/dwarf2-4.d,
	* testsuite/gas/elf/dwarf2-5.d,
	* testsuite/gas/elf/dwarf2-6.d,
	* testsuite/gas/elf/dwarf2-7.d,
	* testsuite/gas/elf/dwarf2-8.d,
	* testsuite/gas/elf/dwarf2-9.d,
	* testsuite/gas/elf/group0c.d,
	* testsuite/gas/elf/group1a.d,
	* testsuite/gas/elf/group2.d,
	* testsuite/gas/elf/groupautoa.d,
	* testsuite/gas/elf/ifunc-1.d,
	* testsuite/gas/elf/section11.d,
	* testsuite/gas/elf/section4.d,
	* testsuite/gas/elf/section7.d,
	* testsuite/gas/elf/syms.d,
	* testsuite/gas/elf/symver.d,
	* testsuite/gas/i386/iamcu-1.d,
	* testsuite/gas/i386/iamcu-2.d,
	* testsuite/gas/i386/iamcu-3.d,
	* testsuite/gas/i386/iamcu-4.d,
	* testsuite/gas/i386/iamcu-5.d,
	* testsuite/gas/i386/ilp32/rex.d,
	* testsuite/gas/i386/k1om.d,
	* testsuite/gas/i386/l1om.d,
	* testsuite/gas/i386/rex.d,
	* testsuite/gas/mach-o/sections-3.d,
	* testsuite/gas/macros/irp.d,
	* testsuite/gas/macros/repeat.d,
	* testsuite/gas/macros/rept.d,
	* testsuite/gas/macros/semi.d,
	* testsuite/gas/macros/test2.d,
	* testsuite/gas/macros/test3.d,
	* testsuite/gas/macros/vararg.d,
	* testsuite/gas/mips/jal-svr4pic-local.d,
	* testsuite/gas/mips/micromips@jal-svr4pic-local.d,
	* testsuite/gas/mips/mips1@jal-svr4pic-local.d,
	* testsuite/gas/mips/r3000@jal-svr4pic-local.d,
	* testsuite/gas/ppc/machine.d,
	* testsuite/lib/gas-defs.exp (run_dump_test): Replace not-target
	and not-skip with notarget and noskip.
2018-09-15 16:24:18 +09:30
Alan Modra 04ade4bc66 Remove run_dump_test support for objcopy as a dump program
We have three copies of run_dump_test in the testsuite.  This is a first
step towards consolidating them.

A few tests use objcopy to convert to verilog or srec output, then
check that output is as expected.  Those tests can just as easily use
objdump, keeping the set of dump programs (addr2line, nm, objdump,
readelf, size) separate from utilities under test.  That in turn makes
auto-detecting the dump program possible in more places.

binutils/
	* testsuite/binutils-all/group-7a.d,
	* testsuite/binutils-all/group-7b.d,
	* testsuite/binutils-all/group-7c.d,
	* testsuite/binutils-all/symbols-1.d,
	* testsuite/binutils-all/symbols-2.d,
	* testsuite/binutils-all/symbols-3.d,
	* testsuite/binutils-all/symbols-4.d: Remove DUMPPROG.
gas/
	* testsuite/gas/mri/char.d: Don't objcopy to srec, objdump instead.
	* testsuite/gas/mri/float.d: Likewise.
	* testsuite/lib/gas-defs.exp (run_dump_test): Remove support
	for objcopy as a dump tool.
ld/
	* testsuite/ld-elf/interleave-0.d,
	* testsuite/ld-elf/interleave-4.d: Don't objcopy to srec,
	objdump instead.
	* testsuite/ld-gc/all-debug-sections.d,
	* testsuite/ld-scripts/provide-4.d,
	* testsuite/ld-scripts/provide-5.d,
	* testsuite/ld-scripts/provide-6.d,
	* testsuite/ld-scripts/provide-7.d,
	* testsuite/ld-scripts/provide-8.d,
	* testsuite/ld-scripts/segment-start.d: Remove PROG, specify
	nm instead.
	* testsuite/lib/ld-lib.exp (run_dump_test): Remove support
	for objcopy as a dump tool.
2018-09-15 16:24:18 +09:30
H.J. Lu 606cc04085 x86: Check non-WIG EVEX instruction encoding with -mevexwig=1
Verify that -mevexwig=1 has no impact on non-WIG EVEX instruction encoding.

	PR gas/23642
	* testsuite/gas/i386/evex-wig2.d: New file.
	* testsuite/gas/i386/evex-wig2.s: Likewise.
	* testsuite/gas/i386/x86-64-evex-wig2.d: Likewise.
	* testsuite/gas/i386/x86-64-evex-wig2.s: Likewise.
	* testsuite/gas/i386/i386.exp: Run evex-wig2 and
	x86-64-evex-wig2.
2018-09-14 12:21:19 -07:00
H.J. Lu 6865c0435a x86: Support VEX/EVEX WIG encoding
Add VEXWIG, defined as 3, to indicate that the VEX.W/EVEX.W bit is
ignored by such VEX/EVEX instructions, aka WIG instructions.  Set
VexW=3 on VEX/EVEX WIG instructions.  Update assembler to check
VEXWIG when setting the VEX.W bit.

gas/

	PR gas/23642
	* config/tc-i386.c (build_vex_prefix): Check VEXWIG when setting
	the VEX.W bit.
	(build_evex_prefix): Check VEXWIG when setting the EVEX.W bit.

opcodes/

	PR gas/23642
	* i386-opc.h (VEXWIG): New.
	* i386-opc.tbl: Set VexW=3 on VEX/EVEX WIG instructions.
	* i386-tbl.h: Regenerated.
2018-09-14 12:20:10 -07:00
H.J. Lu 70df6fc9bc x86: Handle unsupported static rounding in vcvt[u]si2sd in 32-bit mode
Update x86 disassembler to handle the unsupported static rounding in
vcvt[u]si2sd in 32-bit mode.

gas/

	PR binutils/23655
	* testsuite/gas/i386/evex.d: Updated.

opcodes/

	PR binutils/23655
	* i386-dis-evex.h: Replace EXxEVexR with EXxEVexR64 for
	vcvtsi2sd%LQ and vcvtusi2sd%LQ.
	* i386-dis.c (EXxEVexR64): New.
	(evex_rounding_64_mode): Likewise.
	(OP_Rounding): Handle evex_rounding_64_mode.
2018-09-14 11:25:13 -07:00
H.J. Lu d20dee9efa x86: Properly decode EVEX.W in vcvt[u]si2s[sd] in 32-bit mode
Update x86 disassembler to ignore the EVEX.W bit in EVEX vcvt[u]si2s[sd]
instructions in 32-bit mode.

gas/

	PR binutils/23655
	* testsuite/gas/i386/evex.d: New file.
	* testsuite/gas/i386/evex.s: Likewise.
	* testsuite/gas/i386/i386.exp: Run evex.

opcodes/

	PR binutils/23655
	* i386-dis-evex.h (evex_table): Replace Eq with Edqa for
	vcvtsi2ss%LQ, vcvtsi2sd%LQ, vcvtusi2ss%LQ and vcvtusi2sd%LQ.
	* i386-dis.c (Edqa): New.
	(dqa_mode): Likewise.
	(intel_operand_size): Handle dqa_mode as m_mode.
	(OP_E_register): Handle dqa_mode as dq_mode.
	(OP_E_memory): Set shift for dqa_mode based on address_mode.
2018-09-14 10:49:53 -07:00
Lifang Xia fe75f42ee1 csky: Support PC relative diff relocation
Define DIFF_EXPR_OK to Support PC relative diff relocation,
and add CKCORE_PCREL32 relocation process

bfd/
        * elf32-csky.c (csky_elf_howto_table): Fill special_function of
        R_CKCORE_PCREL32.
        (csky_elf_relocate_section): Add R_CKCORE_PCREL32 process.
gas/
        * config/tc-csky.c (md_apply_fix): Transmit
        BFD_RELOC_32_PCREL to BFD_RELOC_CKCORE_PCREL32.
        (tc_gen_reloc): Trasmit BFD_RELOC_CKCORE_ADDR32 to
        BFD_RELOC_CKCORE_PCREL32 while pc-relative.
        * config/tc-csky.h (DIFF_EXPR_OK): Define to enable PC relative
        diff relocs.
2018-09-14 21:04:47 +08:00
Jan Beulich 556059dd13 x86: fold CRC32 templates
Just like other insns having byte and word forms, these can also make
use of the W modifier, which at the same time allows simplifying some
other code a little bit.
2018-09-14 11:21:15 +02:00
H.J. Lu 79f0fa25b9 x86: Swap destination/source to encode VEX only if possible
When encoding VEX, we can swap destination and source only if there are
more than 1 register operand.

	* config/tc-i386.c (build_vex_prefix): Swap destination and
	source only if there are more than 1 register operand.
2018-09-13 06:12:31 -07:00
Jan Beulich f5eb1d70fb x86: also allow D on 3-operand insns
For now this is just for VMOVS{D,S}.
2018-09-13 11:07:55 +02:00