Skip to content

Commit 3521a28

Browse files
author
Victor Do Nascimento
committed
aarch64: Add support for the SYSP 128-bit system instruction
Mirroring the use of the `sys' - System Instruction assembly instruction, this implements its 128-bit counterpart, `sysp'. This optionally takes two contiguous general-purpose registers starting at an even number or, when these are omitted, by default sets both of these to xzr. Syntax: sysp #<op1>, <Cn>, <Cm>, #<op2>{, <Xt1>, <Xt2>}
1 parent f89c290 commit 3521a28

File tree

5 files changed

+20
-3
lines changed

5 files changed

+20
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.*: Assembler messages:
2+
.*: Error: C8 - C9 expected at operand 2 -- `sysp #0,C7,C0,#0,x0,x1'
3+
.*: Error: C8 - C9 expected at operand 2 -- `sysp #0,C10,C0,#0,x0,x1'
4+
.*: Error: C0 - C7 expected at operand 3 -- `sysp #6,C9,C8,#7,x27,x28'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.arch armv8-a+d128
2+
3+
sysp #0, C7, C0, #0, x0, x1
4+
sysp #0, C10, C0, #0, x0, x1
5+
sysp #6, C9, C8, #7, x27, x28

opcodes/aarch64-dis.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ aarch64_ext_regno_pair (const aarch64_operand *self ATTRIBUTE_UNUSED, aarch64_op
302302
aarch64_operand_error *errors ATTRIBUTE_UNUSED)
303303
{
304304
assert (info->idx == 1
305-
|| info->idx == 3);
305+
|| info->idx == 3
306+
|| info->idx == 5);
306307

307308
unsigned prev_regno = inst->operands[info->idx - 1].reg.regno;
308309
info->reg.regno = (prev_regno == 0x1f) ? 0x1f

opcodes/aarch64-opc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,7 @@ operand_general_constraint_met_p (const aarch64_opnd_info *opnds, int idx,
17101710
else if (type == AARCH64_OPND_PAIRREG
17111711
|| type == AARCH64_OPND_PAIRREG_OR_XZR)
17121712
{
1713-
assert (idx == 1 || idx == 3);
1713+
assert (idx == 1 || idx == 3 || idx == 5);
17141714
if (opnds[idx - 1].reg.regno % 2 != 0)
17151715
{
17161716
set_syntax_error (mismatch_detail, idx - 1,

opcodes/aarch64-tbl.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#define QLF3(a,b,c) {QLF(a), QLF(b), QLF(c)}
4343
#define QLF4(a,b,c,d) {QLF(a), QLF(b), QLF(c), QLF(d)}
4444
#define QLF5(a,b,c,d,e) {QLF(a), QLF(b), QLF(c), QLF(d), QLF(e)}
45-
#define QLF6(a,b,c,d,e) {QLF(a), QLF(b), QLF(c), QLF(d), QLF(e), QLF(f)}
45+
#define QLF6(a,b,c,d,e,f) {QLF(a), QLF(b), QLF(c), QLF(d), QLF(e), QLF(f)}
4646

4747
/* Qualifiers list. */
4848

@@ -70,6 +70,12 @@
7070
QLF5(X,NIL,CR,CR,NIL), \
7171
}
7272

73+
/* e.g. SYSP #<op1>, <Cn>, <Cm>, #<op2>{, <Xt>, <Xt+1>}. */
74+
#define QL_SYSP \
75+
{ \
76+
QLF6(NIL,CR,CR,NIL,X,X), \
77+
}
78+
7379
/* e.g. ADRP <Xd>, <label>. */
7480
#define QL_ADRP \
7581
{ \
@@ -4195,6 +4201,7 @@ const struct aarch64_opcode aarch64_opcode_table[] =
41954201
GCS_INSN ("gcssttr", 0xd91f1c00, 0xfffffc00, OP2 (Rt, Rn_SP), QL_I2SAMEX, 0),
41964202
CORE_INSN ("gcsb", 0xd503227f, 0xffffffff, ic_system, 0, OP1 (BARRIER_GCSB), {}, F_ALIAS),
41974203
CORE_INSN ("sys", 0xd5080000, 0xfff80000, ic_system, 0, OP5 (UIMM3_OP1, CRn, CRm, UIMM3_OP2, Rt), QL_SYS, F_HAS_ALIAS | F_OPD4_OPT | F_DEFAULT (0x1F)),
4204+
D128_INSN ("sysp", 0xd5480000, 0xfff80000, OP6 (UIMM3_OP1, CRn, CRm, UIMM3_OP2, Rt, PAIRREG_OR_XZR), QL_SYSP, F_HAS_ALIAS | F_OPD4_OPT | F_OPD_PAIR_OPT | F_DEFAULT (0x1f)),
41984205
CORE_INSN ("at", 0xd5080000, 0xfff80000, ic_system, 0, OP2 (SYSREG_AT, Rt), QL_SRC_X, F_ALIAS),
41994206
CORE_INSN ("dc", 0xd5080000, 0xfff80000, ic_system, 0, OP2 (SYSREG_DC, Rt), QL_SRC_X, F_ALIAS),
42004207
CORE_INSN ("ic", 0xd5080000, 0xfff80000, ic_system, 0, OP2 (SYSREG_IC, Rt_SYS), QL_SRC_X, F_ALIAS | F_OPD1_OPT | F_DEFAULT (0x1F)),

0 commit comments

Comments
 (0)