diff options
author | Sudakshina Das <sudi.das@arm.com> | 2018-11-12 12:52:55 +0000 |
---|---|---|
committer | Sudakshina Das <sudi.das@arm.com> | 2018-11-12 12:59:22 +0000 |
commit | 193614f2b908c2b55c188cb14c3ef78993ff85b0 (patch) | |
tree | 4a762f9576281e236a28853ba62089abdd1b43e8 /opcodes/aarch64-opc.c | |
parent | 73b605ec3f546ff5a1c343ae02e6322aaa451bcf (diff) | |
download | gdb-193614f2b908c2b55c188cb14c3ef78993ff85b0.zip gdb-193614f2b908c2b55c188cb14c3ef78993ff85b0.tar.gz gdb-193614f2b908c2b55c188cb14c3ef78993ff85b0.tar.bz2 |
[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.
Diffstat (limited to 'opcodes/aarch64-opc.c')
-rw-r--r-- | opcodes/aarch64-opc.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/opcodes/aarch64-opc.c b/opcodes/aarch64-opc.c index 44d2ca6..d73542f 100644 --- a/opcodes/aarch64-opc.c +++ b/opcodes/aarch64-opc.c @@ -243,6 +243,7 @@ const aarch64_field fields[] = { 15, 6 }, /* imm6_2: in rmif instructions. */ { 11, 4 }, /* imm4: in advsimd ext and advsimd ins instructions. */ { 0, 4 }, /* imm4_2: in rmif instructions. */ + { 10, 4 }, /* imm4_3: in adddg/subg instructions. */ { 16, 5 }, /* imm5: in conditional compare (immediate) instructions. */ { 15, 7 }, /* imm7: in load/store pair pre/post index instructions. */ { 13, 8 }, /* imm8: in floating-point scalar move immediate inst. */ @@ -2091,6 +2092,7 @@ operand_general_constraint_met_p (const aarch64_opnd_info *opnds, int idx, case AARCH64_OPND_CCMP_IMM: case AARCH64_OPND_EXCEPTION: case AARCH64_OPND_UIMM4: + case AARCH64_OPND_UIMM4_ADDG: case AARCH64_OPND_UIMM7: case AARCH64_OPND_UIMM3_OP1: case AARCH64_OPND_UIMM3_OP2: @@ -2108,6 +2110,21 @@ operand_general_constraint_met_p (const aarch64_opnd_info *opnds, int idx, } break; + case AARCH64_OPND_UIMM10: + /* Scaled unsigned 10 bits immediate offset. */ + if (!value_in_range_p (opnd->imm.value, 0, 1008)) + { + set_imm_out_of_range_error (mismatch_detail, idx, 0, 1008); + return 0; + } + + if (!value_aligned_p (opnd->imm.value, 16)) + { + set_unaligned_error (mismatch_detail, idx, 16); + return 0; + } + break; + case AARCH64_OPND_SIMM5: case AARCH64_OPND_SVE_SIMM5: case AARCH64_OPND_SVE_SIMM5B: @@ -3434,7 +3451,9 @@ aarch64_print_operand (char *buf, size_t size, bfd_vma pc, case AARCH64_OPND_NZCV: case AARCH64_OPND_EXCEPTION: case AARCH64_OPND_UIMM4: + case AARCH64_OPND_UIMM4_ADDG: case AARCH64_OPND_UIMM7: + case AARCH64_OPND_UIMM10: if (optional_operand_p (opcode, idx) == TRUE && (opnd->imm.value == (int64_t) get_optional_operand_default_value (opcode))) |