Skip to content

Commit f5ab0bb

Browse files
[AArch64] paci<k>171615 auti<k>171615 assembly (#76227)
This adds the following instructions which are added in PAuthLR: - PACIA171615 - PACIB171615 - AUTIA171615 - AUTIB171615 Also updates some encodings to match final published values. Documentation can be found here: https://developer.arm.com/documentation/ddi0602/2023-12/Base-Instructions Co-authored-by: Lucas Prates <[email protected]>
1 parent 85b2327 commit f5ab0bb

File tree

3 files changed

+52
-4
lines changed

3 files changed

+52
-4
lines changed

llvm/lib/Target/AArch64/AArch64InstrInfo.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,6 +1671,11 @@ let Predicates = [HasPAuthLR] in {
16711671
// opcode2, opcode, asm
16721672
def AUTIASPPCr : SignAuthOneReg<0b00001, 0b100100, "autiasppc">;
16731673
def AUTIBSPPCr : SignAuthOneReg<0b00001, 0b100101, "autibsppc">;
1674+
// opcode2, opcode, asm
1675+
def PACIA171615 : SignAuthFixedRegs<0b00001, 0b100010, "pacia171615">;
1676+
def PACIB171615 : SignAuthFixedRegs<0b00001, 0b100011, "pacib171615">;
1677+
def AUTIA171615 : SignAuthFixedRegs<0b00001, 0b101110, "autia171615">;
1678+
def AUTIB171615 : SignAuthFixedRegs<0b00001, 0b101111, "autib171615">;
16741679
}
16751680

16761681
let Uses = [LR, SP], isReturn = 1, isTerminator = 1, isBarrier = 1 in {

llvm/test/MC/AArch64/armv9.5a-pauthlr.s

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,33 +98,60 @@ label1:
9898
// CHECK-ERROR: instruction requires: pauth-lr
9999
// CHECK-UNKNOWN: dac197fe <unknown>
100100

101+
pacia171615
102+
// CHECK-INST: pacia171615
103+
// CHECK-DISASS: pacia171615
104+
// CHECK-ENCODING: [0xfe,0x8b,0xc1,0xda]
105+
// CHECK-ERROR: instruction requires: pauth-lr
106+
// CHECK-UNKNOWN: dac18bfe <unknown>
107+
108+
pacib171615
109+
// CHECK-INST: pacib171615
110+
// CHECK-DISASS: pacib171615
111+
// CHECK-ENCODING: [0xfe,0x8f,0xc1,0xda]
112+
// CHECK-ERROR: instruction requires: pauth-lr
113+
// CHECK-UNKNOWN: dac18ffe <unknown>
114+
115+
autia171615
116+
// CHECK-INST: autia171615
117+
// CHECK-DISASS: autia171615
118+
// CHECK-ENCODING: [0xfe,0xbb,0xc1,0xda]
119+
// CHECK-ERROR: instruction requires: pauth-lr
120+
// CHECK-UNKNOWN: dac1bbfe <unknown>
121+
122+
autib171615
123+
// CHECK-INST: autib171615
124+
// CHECK-DISASS: autib171615
125+
// CHECK-ENCODING: [0xfe,0xbf,0xc1,0xda]
126+
// CHECK-ERROR: instruction requires: pauth-lr
127+
// CHECK-UNKNOWN: dac1bffe <unknown>
101128

102129
retaasppc label1
103130
// CHECK-INST: retaasppc label1
104131
// CHECK-DISASS: retaasppc 0x4 <label1>
105132
// CHECK-ENCODING: [0bAAA11111,A,0b000AAAAA,0x55]
106133
// CHECK-ENCODING: // fixup A - offset: 0, value: label1, kind: fixup_aarch64_pcrel_branch16
107134
// CHECK-ERROR: instruction requires: pauth-lr
108-
// CHECK-UNKNOWN: 5500019f <unknown>
135+
// CHECK-UNKNOWN: 5500021f <unknown>
109136

110137
retabsppc label1
111138
// CHECK-INST: retabsppc label1
112139
// CHECK-DISASS: retabsppc 0x4 <label1>
113140
// CHECK-ENCODING: [0bAAA11111,A,0b001AAAAA,0x55]
114141
// CHECK-ENCODING: // fixup A - offset: 0, value: label1, kind: fixup_aarch64_pcrel_branch16
115142
// CHECK-ERROR: instruction requires: pauth-lr
116-
// CHECK-UNKNOWN: 552001bf <unknown>
143+
// CHECK-UNKNOWN: 5520023f <unknown>
117144

118145
retaasppc #0
119146
// CHECK-INST: retaasppc #0
120-
// CHECK-DISASS: retaasppc 0x3c <label1+0x38>
147+
// CHECK-DISASS: retaasppc 0x4c <label1+0x48>
121148
// CHECK-ENCODING: [0x1f,0x00,0x00,0x55]
122149
// CHECK-ERROR: instruction requires: pauth-lr
123150
// CHECK-UNKNOWN: 5500001f <unknown>
124151

125152
retaasppc #-(1<<18)+4
126153
// CHECK-INST: retaasppc #-262140
127-
// CHECK-DISASS: retaasppc 0xfffffffffffc0044 <label1+0xfffffffffffc0040>
154+
// CHECK-DISASS: retaasppc 0xfffffffffffc0054 <label1+0xfffffffffffc0050>
128155
// CHECK-ENCODING: [0xff,0xff,0x1f,0x55]
129156
// CHECK-ERROR: instruction requires: pauth-lr
130157
// CHECK-UNKNOWN: 551fffff <unknown>

llvm/test/MC/Disassembler/AArch64/armv9.5a-pauthlr.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,22 @@
4949
# CHECK: autibsppc xzr
5050
# NO-PAUTHLR: invalid instruction encoding
5151

52+
[0xfe,0x8b,0xc1,0xda]
53+
# CHECK: pacia171615
54+
# NO-PAUTHLR: invalid instruction encoding
55+
56+
[0xfe,0x8f,0xc1,0xda]
57+
# CHECK: pacib171615
58+
# NO-PAUTHLR: invalid instruction encoding
59+
60+
[0xfe,0xbb,0xc1,0xda]
61+
# CHECK: autia171615
62+
# NO-PAUTHLR: invalid instruction encoding
63+
64+
[0xfe,0xbf,0xc1,0xda]
65+
# CHECK: autib171615
66+
# NO-PAUTHLR: invalid instruction encoding
67+
5268
[0xbf,0x01,0x00,0x55]
5369
# CHECK: retaasppc #-52
5470
# NO-PAUTHLR: invalid instruction encoding

0 commit comments

Comments
 (0)