Skip to content

Commit 70ab81b

Browse files
authored
[AArch64] Ensure APAS instruction passes register parameter (#121928)
In PR #112341, the `APAS` instruction was added as part of the Armv9.6-A specification, but it didn't take the Xt register parameter. This change fixes this.
1 parent e534178 commit 70ab81b

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

llvm/lib/Target/AArch64/AArch64InstrFormats.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,7 +1804,9 @@ class TMSystemException<bits<3> op1, string asm, list<dag> pattern>
18041804
}
18051805

18061806
class APASI : SimpleSystemI<0, (ins GPR64:$Xt), "apas", "\t$Xt">, Sched<[]> {
1807+
bits<5> Xt;
18071808
let Inst{20-5} = 0b0111001110000000;
1809+
let Inst{4-0} = Xt;
18081810
let DecoderNamespace = "APAS";
18091811
}
18101812

llvm/test/MC/AArch64/armv9.6a-rme-gpc3.s

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,18 @@
22
// RUN: llvm-mc -triple aarch64 -show-encoding %s | FileCheck %s
33
.func:
44
apas x0
5+
apas x1
6+
apas x2
7+
apas x17
8+
apas x30
59
mrs x3, GPCBW_EL3
610
msr GPCBW_EL3, x4
711

812
# CHECK: .func:
9-
# CHECK-NEXT: apas x0 // encoding: [0x1f,0x70,0x0e,0xd5]
13+
# CHECK-NEXT: apas x0 // encoding: [0x00,0x70,0x0e,0xd5]
14+
# CHECK-NEXT: apas x1 // encoding: [0x01,0x70,0x0e,0xd5]
15+
# CHECK-NEXT: apas x2 // encoding: [0x02,0x70,0x0e,0xd5]
16+
# CHECK-NEXT: apas x17 // encoding: [0x11,0x70,0x0e,0xd5]
17+
# CHECK-NEXT: apas x30 // encoding: [0x1e,0x70,0x0e,0xd5]
1018
# CHECK-NEXT: mrs x3, GPCBW_EL3 // encoding: [0xa3,0x21,0x3e,0xd5]
1119
# CHECK-NEXT: msr GPCBW_EL3, x4 // encoding: [0xa4,0x21,0x1e,0xd5]
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
# NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py
22
# RUN: llvm-mc -triple aarch64 -disassemble %s | FileCheck %s
33

4-
[0x1f,0x70,0x0e,0xd5]
4+
[0x00,0x70,0x0e,0xd5]
5+
[0x01,0x70,0x0e,0xd5]
6+
[0x02,0x70,0x0e,0xd5]
7+
[0x11,0x70,0x0e,0xd5]
8+
[0x1e,0x70,0x0e,0xd5]
59
[0xa3,0x21,0x3e,0xd5]
610
[0xa4,0x21,0x1e,0xd5]
711

8-
# CHECK: sys #6, c7, c0, #0
12+
# CHECK: sys #6, c7, c0, #0, x0
13+
# CHECK-NEXT: sys #6, c7, c0, #0, x1
14+
# CHECK-NEXT: sys #6, c7, c0, #0, x2
15+
# CHECK-NEXT: sys #6, c7, c0, #0, x17
16+
# CHECK-NEXT: sys #6, c7, c0, #0, x30
917
# CHECK-NEXT: mrs x3, GPCBW_EL3
1018
# CHECK-NEXT: msr GPCBW_EL3, x4

0 commit comments

Comments
 (0)