diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2016-09-21 16:55:22 +0100 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2016-09-21 16:55:22 +0100 |
commit | 2442d8466e221ba6cf4ec4bd2a819fdcb1e5ea7e (patch) | |
tree | 3cf11472e060354947af66613dd1b4a6361f9b02 /opcodes/aarch64-dis-2.c | |
parent | 245d2e3fe8d9ff35c65ed1329609fb7e59034877 (diff) | |
download | gdb-2442d8466e221ba6cf4ec4bd2a819fdcb1e5ea7e.zip gdb-2442d8466e221ba6cf4ec4bd2a819fdcb1e5ea7e.tar.gz gdb-2442d8466e221ba6cf4ec4bd2a819fdcb1e5ea7e.tar.bz2 |
[AArch64][SVE 24/32] Add AARCH64_OPND_SVE_PATTERN_SCALED
Some SVE instructions count the number of elements in a given vector
pattern and allow a scale factor of [1, 16] to be applied to the result.
This scale factor is written ", MUL #n", where "MUL" is a new operator.
E.g.:
UQINCD X0, POW2, MUL #2
This patch adds support for this kind of operand.
All existing operators were shifts of some kind, so there was a natural
range of [0, 63] regardless of context. This was then narrowered further
by later checks (e.g. to [0, 31] when used for 32-bit values).
In contrast, MUL doesn't really have a natural context-independent range.
Rather than pick one arbitrarily, it seemed better to make the "shift"
amount a full 64-bit value and leave the range test to the usual
operand-checking code. I've rearranged the fields of aarch64_opnd_info
so that this doesn't increase the size of the structure (although I don't
think its size is critical anyway).
include/
* opcode/aarch64.h (AARCH64_OPND_SVE_PATTERN_SCALED): New
aarch64_opnd.
(AARCH64_MOD_MUL): New aarch64_modifier_kind.
(aarch64_opnd_info): Make shifter.amount an int64_t and
rearrange the fields.
opcodes/
* aarch64-tbl.h (AARCH64_OPERANDS): Add an entry for
AARCH64_OPND_SVE_PATTERN_SCALED.
* aarch64-opc.h (FLD_SVE_imm4): New aarch64_field_kind.
* aarch64-opc.c (fields): Add a corresponding entry.
(set_multiplier_out_of_range_error): New function.
(aarch64_operand_modifiers): Add entry for AARCH64_MOD_MUL.
(operand_general_constraint_met_p): Handle
AARCH64_OPND_SVE_PATTERN_SCALED.
(print_register_offset_address): Use PRIi64 to print the
shift amount.
(aarch64_print_operand): Likewise. Handle
AARCH64_OPND_SVE_PATTERN_SCALED.
* aarch64-opc-2.c: Regenerate.
* aarch64-asm.h (ins_sve_scale): New inserter.
* aarch64-asm.c (aarch64_ins_sve_scale): New function.
* aarch64-asm-2.c: Regenerate.
* aarch64-dis.h (ext_sve_scale): New inserter.
* aarch64-dis.c (aarch64_ext_sve_scale): New function.
* aarch64-dis-2.c: Regenerate.
gas/
* config/tc-aarch64.c (SHIFTED_MUL): New parse_shift_mode.
(parse_shift): Handle it. Reject AARCH64_MOD_MUL for all other
shift modes. Skip range tests for AARCH64_MOD_MUL.
(process_omitted_operand): Handle AARCH64_OPND_SVE_PATTERN_SCALED.
(parse_operands): Likewise.
Diffstat (limited to 'opcodes/aarch64-dis-2.c')
-rw-r--r-- | opcodes/aarch64-dis-2.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/opcodes/aarch64-dis-2.c b/opcodes/aarch64-dis-2.c index 9f936f0..124385d 100644 --- a/opcodes/aarch64-dis-2.c +++ b/opcodes/aarch64-dis-2.c @@ -10426,7 +10426,6 @@ aarch64_extract_operand (const aarch64_operand *self, case 27: case 35: case 36: - case 91: case 92: case 93: case 94: @@ -10440,7 +10439,8 @@ aarch64_extract_operand (const aarch64_operand *self, case 102: case 103: case 104: - case 107: + case 105: + case 108: return aarch64_ext_regno (self, info, code, inst); case 8: return aarch64_ext_regrt_sysins (self, info, code, inst); @@ -10483,7 +10483,7 @@ aarch64_extract_operand (const aarch64_operand *self, case 69: case 70: case 89: - case 90: + case 91: return aarch64_ext_imm (self, info, code, inst); case 38: case 39: @@ -10536,10 +10536,12 @@ aarch64_extract_operand (const aarch64_operand *self, return aarch64_ext_prfop (self, info, code, inst); case 88: return aarch64_ext_hint (self, info, code, inst); - case 105: - return aarch64_ext_sve_index (self, info, code, inst); + case 90: + return aarch64_ext_sve_scale (self, info, code, inst); case 106: - case 108: + return aarch64_ext_sve_index (self, info, code, inst); + case 107: + case 109: return aarch64_ext_sve_reglist (self, info, code, inst); default: assert (0); abort (); } |