xref: /llvm-project/llvm/test/MC/AArch64/armv8.4a-ldst.s (revision 9c9067316be2b802a3af689b94aadc2740a47bcc)
1// RUN: llvm-mc -triple aarch64-none-linux-gnu -show-encoding -mattr=+v8.4a -o - %s | FileCheck %s
2// RUN: llvm-mc -triple aarch64-none-linux-gnu -show-encoding -mattr=-v8.4a,+rcpc-immo -o - %s 2>&1 | FileCheck %s
3// RUN: not llvm-mc -triple aarch64-none-linux-gnu -show-encoding -mattr=+v8.4a,-rcpc-immo -o - %s 2>&1 | FileCheck %s --check-prefix=CHECK-NO-V84
4// RUN: not llvm-mc -triple aarch64-none-linux-gnu -show-encoding -mattr=-v8.4a -o - %s 2>&1 | FileCheck %s --check-prefix=CHECK-NO-V84
5// RUN: not llvm-mc -triple aarch64-none-linux-gnu -show-encoding -o - %s 2>&1 | FileCheck %s --check-prefix=CHECK-NO-V84
6
7//------------------------------------------------------------------------------
8// Armv8.4-A LDAPR and STLR instructions with immediate offsets
9//------------------------------------------------------------------------------
10
11STLURB   WZR, [X10]
12STLURB   W1, [X10]
13STLURB   W1, [X10, #-256]
14stlurb   w2, [x11, #255]
15STLURB   W3, [SP, #-3]
16
17//CHECK:       stlurb  w1, [x10]               // encoding: [0x41,0x01,0x00,0x19]
18//CHECK-NEXT:  stlurb  w1, [x10, #-256]        // encoding: [0x41,0x01,0x10,0x19]
19//CHECK-NEXT:  stlurb  w2, [x11, #255]         // encoding: [0x62,0xf1,0x0f,0x19]
20//CHECK-NEXT:  stlurb  w3, [sp, #-3]           // encoding: [0xe3,0xd3,0x1f,0x19]
21
22ldapurb  wzr, [x12]
23ldapurb  w4, [x12]
24ldapurb  w4, [x12, #-256]
25LDAPURB  W5, [X13, #255]
26LDAPURB  W6, [SP, #-2]
27
28//CHECK:       ldapurb wzr, [x12]              // encoding: [0x9f,0x01,0x40,0x19]
29//CHECK-NEXT:  ldapurb w4, [x12]               // encoding: [0x84,0x01,0x40,0x19]
30//CHECK-NEXT:  ldapurb w4, [x12, #-256]        // encoding: [0x84,0x01,0x50,0x19]
31//CHECK-NEXT:  ldapurb w5, [x13, #255]         // encoding: [0xa5,0xf1,0x4f,0x19]
32//CHECK-NEXT:  ldapurb w6, [sp, #-2]           // encoding: [0xe6,0xe3,0x5f,0x19]
33
34LDAPURSB W7, [X14]
35LDAPURSB W7, [X14, #-256]
36ldapursb w8, [x15, #255]
37ldapursb w9, [sp, #-1]
38
39//CHECK:       ldapursb    w7, [x14]           // encoding: [0xc7,0x01,0xc0,0x19]
40//CHECK-NEXT:  ldapursb  w7, [x14, #-256]      // encoding: [0xc7,0x01,0xd0,0x19]
41//CHECK-NEXT:  ldapursb  w8, [x15, #255]       // encoding: [0xe8,0xf1,0xcf,0x19]
42//CHECK-NEXT:  ldapursb  w9, [sp, #-1]         // encoding: [0xe9,0xf3,0xdf,0x19]
43
44LDAPURSB X0, [X16]
45LDAPURSB X0, [X16, #-256]
46LDAPURSB X1, [X17, #255]
47ldapursb x2, [sp, #0]
48ldapursb x2, [sp]
49
50//CHECK:       ldapursb    x0, [x16]           // encoding: [0x00,0x02,0x80,0x19]
51//CHECK-NEXT:  ldapursb  x0, [x16, #-256]      // encoding: [0x00,0x02,0x90,0x19]
52//CHECK-NEXT:  ldapursb  x1, [x17, #255]       // encoding: [0x21,0xf2,0x8f,0x19]
53//CHECK-NEXT:  ldapursb  x2, [sp]              // encoding: [0xe2,0x03,0x80,0x19]
54//CHECK-NEXT:  ldapursb  x2, [sp]              // encoding: [0xe2,0x03,0x80,0x19]
55
56stlurh   w10, [x18]
57stlurh   w10, [x18, #-256]
58STLURH   W11, [X19, #255]
59STLURH   W12, [SP, #1]
60
61//CHECK:       stlurh    w10, [x18]            // encoding: [0x4a,0x02,0x00,0x59]
62//CHECK-NEXT:  stlurh  w10, [x18, #-256]       // encoding: [0x4a,0x02,0x10,0x59]
63//CHECK-NEXT:  stlurh  w11, [x19, #255]        // encoding: [0x6b,0xf2,0x0f,0x59]
64//CHECK-NEXT:  stlurh  w12, [sp, #1]           // encoding: [0xec,0x13,0x00,0x59]
65
66LDAPURH  W13, [X20]
67LDAPURH  W13, [X20, #-256]
68ldapurh  w14, [x21, #255]
69LDAPURH  W15, [SP, #2]
70
71//CHECK:       ldapurh   w13, [x20]            // encoding: [0x8d,0x02,0x40,0x59]
72//CHECK-NEXT:  ldapurh w13, [x20, #-256]       // encoding: [0x8d,0x02,0x50,0x59]
73//CHECK-NEXT:  ldapurh w14, [x21, #255]        // encoding: [0xae,0xf2,0x4f,0x59]
74//CHECK-NEXT:  ldapurh w15, [sp, #2]           // encoding: [0xef,0x23,0x40,0x59]
75
76LDAPURSH W16, [X22]
77LDAPURSH W16, [X22, #-256]
78LDAPURSH W17, [X23, #255]
79ldapursh w18, [sp, #3]
80
81//CHECK:       ldapursh    w16, [x22]          // encoding: [0xd0,0x02,0xc0,0x59]
82//CHECK-NEXT:  ldapursh  w16, [x22, #-256]     // encoding: [0xd0,0x02,0xd0,0x59]
83//CHECK-NEXT:  ldapursh  w17, [x23, #255]      // encoding: [0xf1,0xf2,0xcf,0x59]
84//CHECK-NEXT:  ldapursh  w18, [sp, #3]         // encoding: [0xf2,0x33,0xc0,0x59]
85
86ldapursh x3, [x24]
87ldapursh x3, [x24, #-256]
88LDAPURSH X4, [X25, #255]
89LDAPURSH X5, [SP, #4]
90
91//CHECK:       ldapursh    x3, [x24]          // encoding: [0x03,0x03,0x80,0x59]
92//CHECK-NEXT:  ldapursh  x3, [x24, #-256]     // encoding: [0x03,0x03,0x90,0x59]
93//CHECK-NEXT:  ldapursh  x4, [x25, #255]      // encoding: [0x24,0xf3,0x8f,0x59]
94//CHECK-NEXT:  ldapursh  x5, [sp, #4]         // encoding: [0xe5,0x43,0x80,0x59]
95
96STLUR    W19, [X26]
97STLUR    W19, [X26, #-256]
98stlur    w20, [x27, #255]
99STLUR    W21, [SP, #5]
100
101//CHECK:       stlur   w19, [x26]            // encoding: [0x53,0x03,0x00,0x99]
102//CHECK-NEXT:  stlur w19, [x26, #-256]       // encoding: [0x53,0x03,0x10,0x99]
103//CHECK-NEXT:  stlur w20, [x27, #255]        // encoding: [0x74,0xf3,0x0f,0x99]
104//CHECK-NEXT:  stlur w21, [sp, #5]           // encoding: [0xf5,0x53,0x00,0x99]
105
106LDAPUR   W22, [X28]
107LDAPUR   W22, [X28, #-256]
108LDAPUR   W23, [X29, #255]
109ldapur   w24, [sp, #6]
110
111//CHECK:       ldapur    w22, [x28]          // encoding: [0x96,0x03,0x40,0x99]
112//CHECK-NEXT:  ldapur  w22, [x28, #-256]     // encoding: [0x96,0x03,0x50,0x99]
113//CHECK-NEXT:  ldapur  w23, [x29, #255]      // encoding: [0xb7,0xf3,0x4f,0x99]
114//CHECK-NEXT:  ldapur  w24, [sp, #6]         // encoding: [0xf8,0x63,0x40,0x99]
115
116ldapursw x6, [x30]
117ldapursw x6, [x30, #-256]
118LDAPURSW X7, [X0, #255]
119LDAPURSW X8, [SP, #7]
120
121//CHECK:       ldapursw    x6, [x30]         // encoding: [0xc6,0x03,0x80,0x99]
122//CHECK-NEXT:  ldapursw  x6, [x30, #-256]    // encoding: [0xc6,0x03,0x90,0x99]
123//CHECK-NEXT:  ldapursw  x7, [x0, #255]      // encoding: [0x07,0xf0,0x8f,0x99]
124//CHECK-NEXT:  ldapursw  x8, [sp, #7]        // encoding: [0xe8,0x73,0x80,0x99]
125
126STLUR    X9, [X1]
127STLUR    X9, [X1, #-256]
128stlur    x10, [x2, #255]
129STLUR    X11, [SP, #8]
130
131//CHECK:       stlur   x9, [x1]              // encoding: [0x29,0x00,0x00,0xd9]
132//CHECK-NEXT:  stlur x9, [x1, #-256]         // encoding: [0x29,0x00,0x10,0xd9]
133//CHECK-NEXT:  stlur x10, [x2, #255]         // encoding: [0x4a,0xf0,0x0f,0xd9]
134//CHECK-NEXT:  stlur x11, [sp, #8]           // encoding: [0xeb,0x83,0x00,0xd9]
135
136LDAPUR   X12, [X3]
137LDAPUR   X12, [X3, #-256]
138LDAPUR   X13, [X4, #255]
139ldapur   x14, [sp, #9]
140
141//CHECK:       ldapur    x12, [x3]             // encoding: [0x6c,0x00,0x40,0xd9]
142//CHECK-NEXT:  ldapur  x12, [x3, #-256]        // encoding: [0x6c,0x00,0x50,0xd9]
143//CHECK-NEXT:  ldapur  x13, [x4, #255]         // encoding: [0x8d,0xf0,0x4f,0xd9]
144//CHECK-NEXT:  ldapur  x14, [sp, #9]           // encoding: [0xee,0x93,0x40,0xd9]
145
146//CHECK-NO-V84:      error: instruction requires: rcpc-immo
147//CHECK-NO-V84-NEXT: STLURB   WZR, [X10]
148//CHECK-NO-V84-NEXT: ^
149//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
150//CHECK-NO-V84-NEXT: STLURB   W1, [X10]
151//CHECK-NO-V84-NEXT: ^
152//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
153//CHECK-NO-V84-NEXT: STLURB   W1, [X10, #-256]
154//CHECK-NO-V84-NEXT: ^
155//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
156//CHECK-NO-V84-NEXT: stlurb   w2, [x11, #255]
157//CHECK-NO-V84-NEXT: ^
158//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
159//CHECK-NO-V84-NEXT: STLURB   W3, [SP, #-3]
160//CHECK-NO-V84-NEXT: ^
161//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
162//CHECK-NO-V84-NEXT: ldapurb  wzr, [x12]
163//CHECK-NO-V84-NEXT: ^
164//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
165//CHECK-NO-V84-NEXT: ldapurb  w4, [x12]
166//CHECK-NO-V84-NEXT: ^
167//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
168//CHECK-NO-V84-NEXT: ldapurb  w4, [x12, #-256]
169//CHECK-NO-V84-NEXT: ^
170//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
171//CHECK-NO-V84-NEXT: LDAPURB  W5, [X13, #255]
172//CHECK-NO-V84-NEXT: ^
173//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
174//CHECK-NO-V84-NEXT: LDAPURB  W6, [SP, #-2]
175//CHECK-NO-V84-NEXT: ^
176//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
177//CHECK-NO-V84-NEXT: LDAPURSB W7, [X14]
178//CHECK-NO-V84-NEXT: ^
179//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
180//CHECK-NO-V84-NEXT: LDAPURSB W7, [X14, #-256]
181//CHECK-NO-V84-NEXT: ^
182//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
183//CHECK-NO-V84-NEXT: ldapursb w8, [x15, #255]
184//CHECK-NO-V84-NEXT: ^
185//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
186//CHECK-NO-V84-NEXT: ldapursb w9, [sp, #-1]
187//CHECK-NO-V84-NEXT: ^
188//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
189//CHECK-NO-V84-NEXT: LDAPURSB X0, [X16]
190//CHECK-NO-V84-NEXT: ^
191//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
192//CHECK-NO-V84-NEXT: LDAPURSB X0, [X16, #-256]
193//CHECK-NO-V84-NEXT: ^
194//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
195//CHECK-NO-V84-NEXT: LDAPURSB X1, [X17, #255]
196//CHECK-NO-V84-NEXT: ^
197//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
198//CHECK-NO-V84-NEXT: ldapursb x2, [sp, #0]
199//CHECK-NO-V84-NEXT: ^
200//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
201//CHECK-NO-V84-NEXT: ldapursb x2, [sp]
202//CHECK-NO-V84-NEXT: ^
203//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
204//CHECK-NO-V84-NEXT: stlurh   w10, [x18]
205//CHECK-NO-V84-NEXT: ^
206//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
207//CHECK-NO-V84-NEXT: stlurh   w10, [x18, #-256]
208//CHECK-NO-V84-NEXT: ^
209//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
210//CHECK-NO-V84-NEXT: STLURH   W11, [X19, #255]
211//CHECK-NO-V84-NEXT: ^
212//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
213//CHECK-NO-V84-NEXT: STLURH   W12, [SP, #1]
214//CHECK-NO-V84-NEXT: ^
215//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
216//CHECK-NO-V84-NEXT: LDAPURH  W13, [X20]
217//CHECK-NO-V84-NEXT: ^
218//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
219//CHECK-NO-V84-NEXT: LDAPURH  W13, [X20, #-256]
220//CHECK-NO-V84-NEXT: ^
221//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
222//CHECK-NO-V84-NEXT: ldapurh  w14, [x21, #255]
223//CHECK-NO-V84-NEXT: ^
224//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
225//CHECK-NO-V84-NEXT: LDAPURH  W15, [SP, #2]
226//CHECK-NO-V84-NEXT: ^
227//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
228//CHECK-NO-V84-NEXT: LDAPURSH W16, [X22]
229//CHECK-NO-V84-NEXT: ^
230//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
231//CHECK-NO-V84-NEXT: LDAPURSH W16, [X22, #-256]
232//CHECK-NO-V84-NEXT: ^
233//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
234//CHECK-NO-V84-NEXT: LDAPURSH W17, [X23, #255]
235//CHECK-NO-V84-NEXT: ^
236//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
237//CHECK-NO-V84-NEXT: ldapursh w18, [sp, #3]
238//CHECK-NO-V84-NEXT: ^
239//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
240//CHECK-NO-V84-NEXT: ldapursh x3, [x24]
241//CHECK-NO-V84-NEXT: ^
242//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
243//CHECK-NO-V84-NEXT: ldapursh x3, [x24, #-256]
244//CHECK-NO-V84-NEXT: ^
245//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
246//CHECK-NO-V84-NEXT: LDAPURSH X4, [X25, #255]
247//CHECK-NO-V84-NEXT: ^
248//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
249//CHECK-NO-V84-NEXT: LDAPURSH X5, [SP, #4]
250//CHECK-NO-V84-NEXT: ^
251//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
252//CHECK-NO-V84-NEXT: STLUR    W19, [X26]
253//CHECK-NO-V84-NEXT: ^
254//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
255//CHECK-NO-V84-NEXT: STLUR    W19, [X26, #-256]
256//CHECK-NO-V84-NEXT: ^
257//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
258//CHECK-NO-V84-NEXT: stlur    w20, [x27, #255]
259//CHECK-NO-V84-NEXT: ^
260//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
261//CHECK-NO-V84-NEXT: STLUR    W21, [SP, #5]
262//CHECK-NO-V84-NEXT: ^
263//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
264//CHECK-NO-V84-NEXT: LDAPUR   W22, [X28]
265//CHECK-NO-V84-NEXT: ^
266//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
267//CHECK-NO-V84-NEXT: LDAPUR   W22, [X28, #-256]
268//CHECK-NO-V84-NEXT: ^
269//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
270//CHECK-NO-V84-NEXT: LDAPUR   W23, [X29, #255]
271//CHECK-NO-V84-NEXT: ^
272//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
273//CHECK-NO-V84-NEXT: ldapur   w24, [sp, #6]
274//CHECK-NO-V84-NEXT: ^
275//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
276//CHECK-NO-V84-NEXT: ldapursw x6, [x30]
277//CHECK-NO-V84-NEXT: ^
278//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
279//CHECK-NO-V84-NEXT: ldapursw x6, [x30, #-256]
280//CHECK-NO-V84-NEXT: ^
281//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
282//CHECK-NO-V84-NEXT: LDAPURSW X7, [X0, #255]
283//CHECK-NO-V84-NEXT: ^
284//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
285//CHECK-NO-V84-NEXT: LDAPURSW X8, [SP, #7]
286//CHECK-NO-V84-NEXT: ^
287//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
288//CHECK-NO-V84-NEXT: STLUR    X9, [X1]
289//CHECK-NO-V84-NEXT: ^
290//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
291//CHECK-NO-V84-NEXT: STLUR    X9, [X1, #-256]
292//CHECK-NO-V84-NEXT: ^
293//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
294//CHECK-NO-V84-NEXT: stlur    x10, [x2, #255]
295//CHECK-NO-V84-NEXT: ^
296//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
297//CHECK-NO-V84-NEXT: STLUR    X11, [SP, #8]
298//CHECK-NO-V84-NEXT: ^
299//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
300//CHECK-NO-V84-NEXT: LDAPUR   X12, [X3]
301//CHECK-NO-V84-NEXT: ^
302//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
303//CHECK-NO-V84-NEXT: LDAPUR   X12, [X3, #-256]
304//CHECK-NO-V84-NEXT: ^
305//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
306//CHECK-NO-V84-NEXT: LDAPUR   X13, [X4, #255]
307//CHECK-NO-V84-NEXT: ^
308//CHECK-NO-V84-NEXT: error: instruction requires: rcpc-immo
309//CHECK-NO-V84-NEXT: ldapur   x14, [sp, #9]
310//CHECK-NO-V84-NEXT: ^
311