]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[AArch64] Add SVE condition codes users/ARM/sve
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 15 Aug 2016 11:00:49 +0000 (12:00 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 23 Aug 2016 08:41:05 +0000 (09:41 +0100)
commit2e2bd2dfc23a1dc11e3074ea9c1b19977eb8ef42
treea2251b2e5c1335334cd7b8af6d536b837596cd15
parent1fdbf5977f0eac8b5b3951b28fbaf09324d04ca6
[AArch64] Add SVE condition codes

SVE defines new names for existing NZCV conditions, to reflect the
result of instructions like PTEST.  This patch adds support for these
names.

The patch also adds comments to the disassembly output to show the
alternative names of a condition code.  For example:

cinv x0, x1, cc

becomes:

  cinv x0, x1, cc  // cc = lo, ul, last

and:

b.cc f0 <...>

becomes:

  b.cc f0 <...>  // b.lo, b.ul, b.last

Doing this for the SVE names follows the practice recommended by the
SVE specification and is definitely useful when reading SVE code.
If the feeling is that it's too distracting elsewhere, we could add
an option to turn it off.

include/
* opcode/aarch64.h (aarch64_cond): Bump array size to 4.

opcodes/
* aarch64-dis.c (remove_dot_suffix): New function, split out from...
(print_mnemonic_name): ...here.
(print_comment): New function.
(print_aarch64_insn): Call it.
* aarch64-opc.c (aarch64_conds): Add SVE names.
(aarch64_print_operand): Print alternative condition names in
a comment.

gas/
* config/tc-aarch64.c (opcode_lookup): Search for the end of
a condition name, rather than assuming that it will have exactly
2 characters.
(parse_operands): Likewise.
* testsuite/gas/aarch64/alias.d: Add new condition-code comments
to the expected output.
* testsuite/gas/aarch64/beq_1.d: Likewise.
* testsuite/gas/aarch64/float-fp16.d: Likewise.
* testsuite/gas/aarch64/int-insns.d: Likewise.
* testsuite/gas/aarch64/no-aliases.d: Likewise.
* testsuite/gas/aarch64/programmer-friendly.d: Likewise.
* testsuite/gas/aarch64/reloc-insn.d: Likewise.
* testsuite/gas/aarch64/b_c_1.d, testsuite/gas/aarch64/b_c_1.s:
New test.

Change-Id: I8b7feb02a08aa97706955cf11f59c41ab87d6b96
13 files changed:
gas/config/tc-aarch64.c
gas/testsuite/gas/aarch64/alias.d
gas/testsuite/gas/aarch64/b_c_1.d [new file with mode: 0644]
gas/testsuite/gas/aarch64/b_c_1.s [new file with mode: 0644]
gas/testsuite/gas/aarch64/beq_1.d
gas/testsuite/gas/aarch64/float-fp16.d
gas/testsuite/gas/aarch64/int-insns.d
gas/testsuite/gas/aarch64/no-aliases.d
gas/testsuite/gas/aarch64/programmer-friendly.d
gas/testsuite/gas/aarch64/reloc-insn.d
include/opcode/aarch64.h
opcodes/aarch64-dis.c
opcodes/aarch64-opc.c