1 # RUN: llvm-mc %s -triple=riscv32 -mattr=+a -riscv-no-aliases \
2 # RUN: | FileCheck -check-prefixes=CHECK-S-NOALIAS,CHECK-S-OBJ-NOALIAS %s
3 # RUN: llvm-mc %s -triple=riscv32 -mattr=+a \
4 # RUN: | FileCheck -check-prefixes=CHECK-S,CHECK-S-OBJ %s
5 # RUN: llvm-mc %s -triple=riscv64 -mattr=+a -riscv-no-aliases\
6 # RUN: | FileCheck -check-prefixes=CHECK-S-NOALIAS,CHECK-S-OBJ-NOALIAS %s
7 # RUN: llvm-mc %s -triple=riscv64 -mattr=+a \
8 # RUN: | FileCheck -check-prefixes=CHECK-S,CHECK-S-OBJ %s
9 # RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+a < %s \
10 # RUN: | llvm-objdump -d -mattr=+a -M no-aliases - \
11 # RUN: | FileCheck -check-prefixes=CHECK-OBJ-NOALIAS,CHECK-S-OBJ-NOALIAS %s
12 # RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+a < %s \
13 # RUN: | llvm-objdump -d -mattr=+a - \
14 # RUN: | FileCheck -check-prefixes=CHECK-OBJ,CHECK-S-OBJ %s
15 # RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+a < %s \
16 # RUN: | llvm-objdump -d -mattr=+a -M no-aliases - \
17 # RUN: | FileCheck -check-prefixes=CHECK-OBJ-NOALIAS,CHECK-S-OBJ-NOALIAS %s
18 # RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+a < %s \
19 # RUN: | llvm-objdump -d -mattr=+a - \
20 # RUN: | FileCheck -check-prefixes=CHECK-OBJ,CHECK-S-OBJ %s
22 # The following check prefixes are used in this test:
23 # CHECK-S Match the .s output with aliases enabled
24 # CHECK-S-NOALIAS Match the .s output with aliases disabled
25 # CHECK-OBJ Match the objdumped object output with aliases enabled
26 # CHECK-OBJ-NOALIAS Match the objdumped object output with aliases enabled
27 # CHECK-S-OBJ Match both the .s and objdumped object output with
29 # CHECK-S-OBJ-NOALIAS Match both the .s and objdumped object output with
32 # The below tests for lr.w, sc.w and amo*.w, using `0(reg)` are actually
33 # implemented using a custom parser, but we test them as if they're aliases.
35 # CHECK-S: lr.w a1, (a0)
36 # CHECK-S-NOALIAS: lr.w a1, (a0)
37 # CHECK-OBJ: lr.w a1, (a0)
38 # CHECK-OBJ-NOALIAS: lr.w a1, (a0)
41 # CHECK-S: lr.w.aq a1, (a0)
42 # CHECK-S-NOALIAS: lr.w.aq a1, (a0)
43 # CHECK-OBJ: lr.w.aq a1, (a0)
44 # CHECK-OBJ-NOALIAS: lr.w.aq a1, (a0)
47 # CHECK-S: lr.w.rl a1, (a0)
48 # CHECK-S-NOALIAS: lr.w.rl a1, (a0)
49 # CHECK-OBJ: lr.w.rl a1, (a0)
50 # CHECK-OBJ-NOALIAS: lr.w.rl a1, (a0)
53 # CHECK-S: lr.w.aqrl a1, (a0)
54 # CHECK-S-NOALIAS: lr.w.aqrl a1, (a0)
55 # CHECK-OBJ: lr.w.aqrl a1, (a0)
56 # CHECK-OBJ-NOALIAS: lr.w.aqrl a1, (a0)
59 # CHECK-S: sc.w a2, a1, (a0)
60 # CHECK-S-NOALIAS: sc.w a2, a1, (a0)
61 # CHECK-OBJ: sc.w a2, a1, (a0)
62 # CHECK-OBJ-NOALIAS: sc.w a2, a1, (a0)
65 # CHECK-S: sc.w.aq a2, a1, (a0)
66 # CHECK-S-NOALIAS: sc.w.aq a2, a1, (a0)
67 # CHECK-OBJ: sc.w.aq a2, a1, (a0)
68 # CHECK-OBJ-NOALIAS: sc.w.aq a2, a1, (a0)
71 # CHECK-S: sc.w.rl a2, a1, (a0)
72 # CHECK-S-NOALIAS: sc.w.rl a2, a1, (a0)
73 # CHECK-OBJ: sc.w.rl a2, a1, (a0)
74 # CHECK-OBJ-NOALIAS: sc.w.rl a2, a1, (a0)
77 # CHECK-S: sc.w.aqrl a2, a1, (a0)
78 # CHECK-S-NOALIAS: sc.w.aqrl a2, a1, (a0)
79 # CHECK-OBJ: sc.w.aqrl a2, a1, (a0)
80 # CHECK-OBJ-NOALIAS: sc.w.aqrl a2, a1, (a0)
81 sc.w.aqrl a2
, a1
, 0(a0
)
83 # CHECK-S: amoswap.w a2, a1, (a0)
84 # CHECK-S-NOALIAS: amoswap.w a2, a1, (a0)
85 # CHECK-OBJ: amoswap.w a2, a1, (a0)
86 # CHECK-OBJ-NOALIAS: amoswap.w a2, a1, (a0)
87 amoswap.w a2
, a1
, 0(a0
)
89 # CHECK-S: amoswap.w.aq a2, a1, (a0)
90 # CHECK-S-NOALIAS: amoswap.w.aq a2, a1, (a0)
91 # CHECK-OBJ: amoswap.w.aq a2, a1, (a0)
92 # CHECK-OBJ-NOALIAS: amoswap.w.aq a2, a1, (a0)
93 amoswap.w.aq a2
, a1
, 0(a0
)
95 # CHECK-S: amoswap.w.rl a2, a1, (a0)
96 # CHECK-S-NOALIAS: amoswap.w.rl a2, a1, (a0)
97 # CHECK-OBJ: amoswap.w.rl a2, a1, (a0)
98 # CHECK-OBJ-NOALIAS: amoswap.w.rl a2, a1, (a0)
99 amoswap.w.rl a2
, a1
, 0(a0
)
101 # CHECK-S: amoswap.w.aqrl a2, a1, (a0)
102 # CHECK-S-NOALIAS: amoswap.w.aqrl a2, a1, (a0)
103 # CHECK-OBJ: amoswap.w.aqrl a2, a1, (a0)
104 # CHECK-OBJ-NOALIAS: amoswap.w.aqrl a2, a1, (a0)
105 amoswap.w.aqrl a2
, a1
, 0(a0
)
107 # CHECK-S: amoadd.w a2, a1, (a0)
108 # CHECK-S-NOALIAS: amoadd.w a2, a1, (a0)
109 # CHECK-OBJ: amoadd.w a2, a1, (a0)
110 # CHECK-OBJ-NOALIAS: amoadd.w a2, a1, (a0)
111 amoadd.w a2
, a1
, 0(a0
)
113 # CHECK-S: amoadd.w.aq a2, a1, (a0)
114 # CHECK-S-NOALIAS: amoadd.w.aq a2, a1, (a0)
115 # CHECK-OBJ: amoadd.w.aq a2, a1, (a0)
116 # CHECK-OBJ-NOALIAS: amoadd.w.aq a2, a1, (a0)
117 amoadd.w.aq a2
, a1
, 0(a0
)
119 # CHECK-S: amoadd.w.rl a2, a1, (a0)
120 # CHECK-S-NOALIAS: amoadd.w.rl a2, a1, (a0)
121 # CHECK-OBJ: amoadd.w.rl a2, a1, (a0)
122 # CHECK-OBJ-NOALIAS: amoadd.w.rl a2, a1, (a0)
123 amoadd.w.rl a2
, a1
, 0(a0
)
125 # CHECK-S: amoadd.w.aqrl a2, a1, (a0)
126 # CHECK-S-NOALIAS: amoadd.w.aqrl a2, a1, (a0)
127 # CHECK-OBJ: amoadd.w.aqrl a2, a1, (a0)
128 # CHECK-OBJ-NOALIAS: amoadd.w.aqrl a2, a1, (a0)
129 amoadd.w.aqrl a2
, a1
, 0(a0
)
131 # CHECK-S: amoxor.w a2, a1, (a0)
132 # CHECK-S-NOALIAS: amoxor.w a2, a1, (a0)
133 # CHECK-OBJ: amoxor.w a2, a1, (a0)
134 # CHECK-OBJ-NOALIAS: amoxor.w a2, a1, (a0)
135 amoxor.w a2
, a1
, 0(a0
)
137 # CHECK-S: amoxor.w.aq a2, a1, (a0)
138 # CHECK-S-NOALIAS: amoxor.w.aq a2, a1, (a0)
139 # CHECK-OBJ: amoxor.w.aq a2, a1, (a0)
140 # CHECK-OBJ-NOALIAS: amoxor.w.aq a2, a1, (a0)
141 amoxor.w.aq a2
, a1
, 0(a0
)
143 # CHECK-S: amoxor.w.rl a2, a1, (a0)
144 # CHECK-S-NOALIAS: amoxor.w.rl a2, a1, (a0)
145 # CHECK-OBJ: amoxor.w.rl a2, a1, (a0)
146 # CHECK-OBJ-NOALIAS: amoxor.w.rl a2, a1, (a0)
147 amoxor.w.rl a2
, a1
, 0(a0
)
149 # CHECK-S: amoxor.w.aqrl a2, a1, (a0)
150 # CHECK-S-NOALIAS: amoxor.w.aqrl a2, a1, (a0)
151 # CHECK-OBJ: amoxor.w.aqrl a2, a1, (a0)
152 # CHECK-OBJ-NOALIAS: amoxor.w.aqrl a2, a1, (a0)
153 amoxor.w.aqrl a2
, a1
, 0(a0
)
155 # CHECK-S: amoand.w a2, a1, (a0)
156 # CHECK-S-NOALIAS: amoand.w a2, a1, (a0)
157 # CHECK-OBJ: amoand.w a2, a1, (a0)
158 # CHECK-OBJ-NOALIAS: amoand.w a2, a1, (a0)
159 amoand.w a2
, a1
, 0(a0
)
161 # CHECK-S: amoand.w.aq a2, a1, (a0)
162 # CHECK-S-NOALIAS: amoand.w.aq a2, a1, (a0)
163 # CHECK-OBJ: amoand.w.aq a2, a1, (a0)
164 # CHECK-OBJ-NOALIAS: amoand.w.aq a2, a1, (a0)
165 amoand.w.aq a2
, a1
, 0(a0
)
167 # CHECK-S: amoand.w.rl a2, a1, (a0)
168 # CHECK-S-NOALIAS: amoand.w.rl a2, a1, (a0)
169 # CHECK-OBJ: amoand.w.rl a2, a1, (a0)
170 # CHECK-OBJ-NOALIAS: amoand.w.rl a2, a1, (a0)
171 amoand.w.rl a2
, a1
, 0(a0
)
173 # CHECK-S: amoand.w.aqrl a2, a1, (a0)
174 # CHECK-S-NOALIAS: amoand.w.aqrl a2, a1, (a0)
175 # CHECK-OBJ: amoand.w.aqrl a2, a1, (a0)
176 # CHECK-OBJ-NOALIAS: amoand.w.aqrl a2, a1, (a0)
177 amoand.w.aqrl a2
, a1
, 0(a0
)
179 # CHECK-S: amoor.w a2, a1, (a0)
180 # CHECK-S-NOALIAS: amoor.w a2, a1, (a0)
181 # CHECK-OBJ: amoor.w a2, a1, (a0)
182 # CHECK-OBJ-NOALIAS: amoor.w a2, a1, (a0)
183 amoor.w a2
, a1
, 0(a0
)
185 # CHECK-S: amoor.w.aq a2, a1, (a0)
186 # CHECK-S-NOALIAS: amoor.w.aq a2, a1, (a0)
187 # CHECK-OBJ: amoor.w.aq a2, a1, (a0)
188 # CHECK-OBJ-NOALIAS: amoor.w.aq a2, a1, (a0)
189 amoor.w.aq a2
, a1
, 0(a0
)
191 # CHECK-S: amoor.w.rl a2, a1, (a0)
192 # CHECK-S-NOALIAS: amoor.w.rl a2, a1, (a0)
193 # CHECK-OBJ: amoor.w.rl a2, a1, (a0)
194 # CHECK-OBJ-NOALIAS: amoor.w.rl a2, a1, (a0)
195 amoor.w.rl a2
, a1
, 0(a0
)
197 # CHECK-S: amoor.w.aqrl a2, a1, (a0)
198 # CHECK-S-NOALIAS: amoor.w.aqrl a2, a1, (a0)
199 # CHECK-OBJ: amoor.w.aqrl a2, a1, (a0)
200 # CHECK-OBJ-NOALIAS: amoor.w.aqrl a2, a1, (a0)
201 amoor.w.aqrl a2
, a1
, 0(a0
)
203 # CHECK-S: amomin.w a2, a1, (a0)
204 # CHECK-S-NOALIAS: amomin.w a2, a1, (a0)
205 # CHECK-OBJ: amomin.w a2, a1, (a0)
206 # CHECK-OBJ-NOALIAS: amomin.w a2, a1, (a0)
207 amomin.w a2
, a1
, 0(a0
)
209 # CHECK-S: amomin.w.aq a2, a1, (a0)
210 # CHECK-S-NOALIAS: amomin.w.aq a2, a1, (a0)
211 # CHECK-OBJ: amomin.w.aq a2, a1, (a0)
212 # CHECK-OBJ-NOALIAS: amomin.w.aq a2, a1, (a0)
213 amomin.w.aq a2
, a1
, 0(a0
)
215 # CHECK-S: amomin.w.rl a2, a1, (a0)
216 # CHECK-S-NOALIAS: amomin.w.rl a2, a1, (a0)
217 # CHECK-OBJ: amomin.w.rl a2, a1, (a0)
218 # CHECK-OBJ-NOALIAS: amomin.w.rl a2, a1, (a0)
219 amomin.w.rl a2
, a1
, 0(a0
)
221 # CHECK-S: amomin.w.aqrl a2, a1, (a0)
222 # CHECK-S-NOALIAS: amomin.w.aqrl a2, a1, (a0)
223 # CHECK-OBJ: amomin.w.aqrl a2, a1, (a0)
224 # CHECK-OBJ-NOALIAS: amomin.w.aqrl a2, a1, (a0)
225 amomin.w.aqrl a2
, a1
, 0(a0
)
227 # CHECK-S: amomax.w a2, a1, (a0)
228 # CHECK-S-NOALIAS: amomax.w a2, a1, (a0)
229 # CHECK-OBJ: amomax.w a2, a1, (a0)
230 # CHECK-OBJ-NOALIAS: amomax.w a2, a1, (a0)
231 amomax.w a2
, a1
, 0(a0
)
233 # CHECK-S: amomax.w.aq a2, a1, (a0)
234 # CHECK-S-NOALIAS: amomax.w.aq a2, a1, (a0)
235 # CHECK-OBJ: amomax.w.aq a2, a1, (a0)
236 # CHECK-OBJ-NOALIAS: amomax.w.aq a2, a1, (a0)
237 amomax.w.aq a2
, a1
, 0(a0
)
239 # CHECK-S: amomax.w.rl a2, a1, (a0)
240 # CHECK-S-NOALIAS: amomax.w.rl a2, a1, (a0)
241 # CHECK-OBJ: amomax.w.rl a2, a1, (a0)
242 # CHECK-OBJ-NOALIAS: amomax.w.rl a2, a1, (a0)
243 amomax.w.rl a2
, a1
, 0(a0
)
245 # CHECK-S: amomax.w.aqrl a2, a1, (a0)
246 # CHECK-S-NOALIAS: amomax.w.aqrl a2, a1, (a0)
247 # CHECK-OBJ: amomax.w.aqrl a2, a1, (a0)
248 # CHECK-OBJ-NOALIAS: amomax.w.aqrl a2, a1, (a0)
249 amomax.w.aqrl a2
, a1
, 0(a0
)
251 # CHECK-S: amominu.w a2, a1, (a0)
252 # CHECK-S-NOALIAS: amominu.w a2, a1, (a0)
253 # CHECK-OBJ: amominu.w a2, a1, (a0)
254 # CHECK-OBJ-NOALIAS: amominu.w a2, a1, (a0)
255 amominu.w a2
, a1
, 0(a0
)
257 # CHECK-S: amominu.w.aq a2, a1, (a0)
258 # CHECK-S-NOALIAS: amominu.w.aq a2, a1, (a0)
259 # CHECK-OBJ: amominu.w.aq a2, a1, (a0)
260 # CHECK-OBJ-NOALIAS: amominu.w.aq a2, a1, (a0)
261 amominu.w.aq a2
, a1
, 0(a0
)
263 # CHECK-S: amominu.w.rl a2, a1, (a0)
264 # CHECK-S-NOALIAS: amominu.w.rl a2, a1, (a0)
265 # CHECK-OBJ: amominu.w.rl a2, a1, (a0)
266 # CHECK-OBJ-NOALIAS: amominu.w.rl a2, a1, (a0)
267 amominu.w.rl a2
, a1
, 0(a0
)
269 # CHECK-S: amominu.w.aqrl a2, a1, (a0)
270 # CHECK-S-NOALIAS: amominu.w.aqrl a2, a1, (a0)
271 # CHECK-OBJ: amominu.w.aqrl a2, a1, (a0)
272 # CHECK-OBJ-NOALIAS: amominu.w.aqrl a2, a1, (a0)
273 amominu.w.aqrl a2
, a1
, 0(a0
)
275 # CHECK-S: amomaxu.w a2, a1, (a0)
276 # CHECK-S-NOALIAS: amomaxu.w a2, a1, (a0)
277 # CHECK-OBJ: amomaxu.w a2, a1, (a0)
278 # CHECK-OBJ-NOALIAS: amomaxu.w a2, a1, (a0)
279 amomaxu.w a2
, a1
, 0(a0
)
281 # CHECK-S: amomaxu.w.aq a2, a1, (a0)
282 # CHECK-S-NOALIAS: amomaxu.w.aq a2, a1, (a0)
283 # CHECK-OBJ: amomaxu.w.aq a2, a1, (a0)
284 # CHECK-OBJ-NOALIAS: amomaxu.w.aq a2, a1, (a0)
285 amomaxu.w.aq a2
, a1
, 0(a0
)
287 # CHECK-S: amomaxu.w.rl a2, a1, (a0)
288 # CHECK-S-NOALIAS: amomaxu.w.rl a2, a1, (a0)
289 # CHECK-OBJ: amomaxu.w.rl a2, a1, (a0)
290 # CHECK-OBJ-NOALIAS: amomaxu.w.rl a2, a1, (a0)
291 amomaxu.w.rl a2
, a1
, 0(a0
)
293 # CHECK-S: amomaxu.w.aqrl a2, a1, (a0)
294 # CHECK-S-NOALIAS: amomaxu.w.aqrl a2, a1, (a0)
295 # CHECK-OBJ: amomaxu.w.aqrl a2, a1, (a0)
296 # CHECK-OBJ-NOALIAS: amomaxu.w.aqrl a2, a1, (a0)
297 amomaxu.w.aqrl a2
, a1
, 0(a0
)