xref: /llvm-project/llvm/test/MC/RISCV/rvv/sub.s (revision b27f86b40b20942c0e809128214b43d6edde365a)
1# RUN: llvm-mc -triple=riscv64 -show-encoding --mattr=+v %s \
2# RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3# RUN: not llvm-mc -triple=riscv64 -show-encoding %s 2>&1 \
4# RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
5# RUN: llvm-mc -triple=riscv64 -filetype=obj --mattr=+v %s \
6# RUN:        | llvm-objdump -d --mattr=+v --no-print-imm-hex - \
7# RUN:        | FileCheck %s --check-prefix=CHECK-INST
8# RUN: llvm-mc -triple=riscv64 -filetype=obj --mattr=+v %s \
9# RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
10
11vsub.vv v8, v4, v20, v0.t
12# CHECK-INST: vsub.vv v8, v4, v20, v0.t
13# CHECK-ENCODING: [0x57,0x04,0x4a,0x08]
14# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
15# CHECK-UNKNOWN: 084a0457 <unknown>
16
17vsub.vv v8, v4, v20
18# CHECK-INST: vsub.vv v8, v4, v20
19# CHECK-ENCODING: [0x57,0x04,0x4a,0x0a]
20# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
21# CHECK-UNKNOWN: 0a4a0457 <unknown>
22
23vsub.vx v8, v4, a0, v0.t
24# CHECK-INST: vsub.vx v8, v4, a0, v0.t
25# CHECK-ENCODING: [0x57,0x44,0x45,0x08]
26# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
27# CHECK-UNKNOWN: 08454457 <unknown>
28
29vsub.vx v8, v4, a0
30# CHECK-INST: vsub.vx v8, v4, a0
31# CHECK-ENCODING: [0x57,0x44,0x45,0x0a]
32# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
33# CHECK-UNKNOWN: 0a454457 <unknown>
34
35vrsub.vx v8, v4, a0, v0.t
36# CHECK-INST: vrsub.vx v8, v4, a0, v0.t
37# CHECK-ENCODING: [0x57,0x44,0x45,0x0c]
38# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
39# CHECK-UNKNOWN: 0c454457 <unknown>
40
41vrsub.vx v8, v4, a0
42# CHECK-INST: vrsub.vx v8, v4, a0
43# CHECK-ENCODING: [0x57,0x44,0x45,0x0e]
44# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
45# CHECK-UNKNOWN: 0e454457 <unknown>
46
47vrsub.vi v8, v4, 15, v0.t
48# CHECK-INST: vrsub.vi v8, v4, 15, v0.t
49# CHECK-ENCODING: [0x57,0xb4,0x47,0x0c]
50# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
51# CHECK-UNKNOWN: 0c47b457 <unknown>
52
53vrsub.vi v8, v4, 15
54# CHECK-INST: vrsub.vi v8, v4, 15
55# CHECK-ENCODING: [0x57,0xb4,0x47,0x0e]
56# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
57# CHECK-UNKNOWN: 0e47b457 <unknown>
58
59vwsubu.vv v8, v4, v20, v0.t
60# CHECK-INST: vwsubu.vv v8, v4, v20, v0.t
61# CHECK-ENCODING: [0x57,0x24,0x4a,0xc8]
62# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
63# CHECK-UNKNOWN: c84a2457 <unknown>
64
65vwsubu.vv v8, v4, v20
66# CHECK-INST: vwsubu.vv v8, v4, v20
67# CHECK-ENCODING: [0x57,0x24,0x4a,0xca]
68# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
69# CHECK-UNKNOWN: ca4a2457 <unknown>
70
71vwsubu.vx v8, v4, a0, v0.t
72# CHECK-INST: vwsubu.vx v8, v4, a0, v0.t
73# CHECK-ENCODING: [0x57,0x64,0x45,0xc8]
74# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
75# CHECK-UNKNOWN: c8456457 <unknown>
76
77vwsubu.vx v8, v4, a0
78# CHECK-INST: vwsubu.vx v8, v4, a0
79# CHECK-ENCODING: [0x57,0x64,0x45,0xca]
80# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
81# CHECK-UNKNOWN: ca456457 <unknown>
82
83vwsub.vv v8, v4, v20, v0.t
84# CHECK-INST: vwsub.vv v8, v4, v20, v0.t
85# CHECK-ENCODING: [0x57,0x24,0x4a,0xcc]
86# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
87# CHECK-UNKNOWN: cc4a2457 <unknown>
88
89vwsub.vv v8, v4, v20
90# CHECK-INST: vwsub.vv v8, v4, v20
91# CHECK-ENCODING: [0x57,0x24,0x4a,0xce]
92# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
93# CHECK-UNKNOWN: ce4a2457 <unknown>
94
95vwsub.vx v8, v4, a0, v0.t
96# CHECK-INST: vwsub.vx v8, v4, a0, v0.t
97# CHECK-ENCODING: [0x57,0x64,0x45,0xcc]
98# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
99# CHECK-UNKNOWN: cc456457 <unknown>
100
101vwsub.vx v8, v4, a0
102# CHECK-INST: vwsub.vx v8, v4, a0
103# CHECK-ENCODING: [0x57,0x64,0x45,0xce]
104# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
105# CHECK-UNKNOWN: ce456457 <unknown>
106
107vwsubu.wv v8, v4, v20, v0.t
108# CHECK-INST: vwsubu.wv v8, v4, v20, v0.t
109# CHECK-ENCODING: [0x57,0x24,0x4a,0xd8]
110# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
111# CHECK-UNKNOWN: d84a2457 <unknown>
112
113vwsubu.wv v8, v4, v20
114# CHECK-INST: vwsubu.wv v8, v4, v20
115# CHECK-ENCODING: [0x57,0x24,0x4a,0xda]
116# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
117# CHECK-UNKNOWN: da4a2457 <unknown>
118
119vwsubu.wx v8, v4, a0, v0.t
120# CHECK-INST: vwsubu.wx v8, v4, a0, v0.t
121# CHECK-ENCODING: [0x57,0x64,0x45,0xd8]
122# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
123# CHECK-UNKNOWN: d8456457 <unknown>
124
125vwsubu.wx v8, v4, a0
126# CHECK-INST: vwsubu.wx v8, v4, a0
127# CHECK-ENCODING: [0x57,0x64,0x45,0xda]
128# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
129# CHECK-UNKNOWN: da456457 <unknown>
130
131vwsub.wv v8, v4, v20, v0.t
132# CHECK-INST: vwsub.wv v8, v4, v20, v0.t
133# CHECK-ENCODING: [0x57,0x24,0x4a,0xdc]
134# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
135# CHECK-UNKNOWN: dc4a2457 <unknown>
136
137vwsub.wv v8, v4, v20
138# CHECK-INST: vwsub.wv v8, v4, v20
139# CHECK-ENCODING: [0x57,0x24,0x4a,0xde]
140# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
141# CHECK-UNKNOWN: de4a2457 <unknown>
142
143vwsub.wx v8, v4, a0, v0.t
144# CHECK-INST: vwsub.wx v8, v4, a0, v0.t
145# CHECK-ENCODING: [0x57,0x64,0x45,0xdc]
146# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
147# CHECK-UNKNOWN: dc456457 <unknown>
148
149vwsub.wx v8, v4, a0
150# CHECK-INST: vwsub.wx v8, v4, a0
151# CHECK-ENCODING: [0x57,0x64,0x45,0xde]
152# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
153# CHECK-UNKNOWN: de456457 <unknown>
154
155vsbc.vvm v8, v4, v20, v0
156# CHECK-INST: vsbc.vvm v8, v4, v20, v0
157# CHECK-ENCODING: [0x57,0x04,0x4a,0x48]
158# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
159# CHECK-UNKNOWN: 484a0457 <unknown>
160
161vsbc.vvm v4, v4, v20, v0
162# CHECK-INST: vsbc.vvm v4, v4, v20, v0
163# CHECK-ENCODING: [0x57,0x02,0x4a,0x48]
164# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
165# CHECK-UNKNOWN: 484a0257 <unknown>
166
167vsbc.vvm v8, v4, v8, v0
168# CHECK-INST: vsbc.vvm v8, v4, v8, v0
169# CHECK-ENCODING: [0x57,0x04,0x44,0x48]
170# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
171# CHECK-UNKNOWN: 48440457 <unknown>
172
173vsbc.vxm v8, v4, a0, v0
174# CHECK-INST: vsbc.vxm v8, v4, a0, v0
175# CHECK-ENCODING: [0x57,0x44,0x45,0x48]
176# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
177# CHECK-UNKNOWN: 48454457 <unknown>
178
179vmsbc.vvm v8, v4, v20, v0
180# CHECK-INST: vmsbc.vvm v8, v4, v20, v0
181# CHECK-ENCODING: [0x57,0x04,0x4a,0x4c]
182# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
183# CHECK-UNKNOWN: 4c4a0457 <unknown>
184
185vmsbc.vvm v4, v4, v20, v0
186# CHECK-INST: vmsbc.vvm v4, v4, v20, v0
187# CHECK-ENCODING: [0x57,0x02,0x4a,0x4c]
188# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
189# CHECK-UNKNOWN: 4c4a0257 <unknown>
190
191vmsbc.vvm v8, v4, v8, v0
192# CHECK-INST: vmsbc.vvm v8, v4, v8, v0
193# CHECK-ENCODING: [0x57,0x04,0x44,0x4c]
194# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
195# CHECK-UNKNOWN: 4c440457 <unknown>
196
197vmsbc.vxm v8, v4, a0, v0
198# CHECK-INST: vmsbc.vxm v8, v4, a0, v0
199# CHECK-ENCODING: [0x57,0x44,0x45,0x4c]
200# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
201# CHECK-UNKNOWN: 4c454457 <unknown>
202
203vmsbc.vv v8, v4, v20
204# CHECK-INST: vmsbc.vv v8, v4, v20
205# CHECK-ENCODING: [0x57,0x04,0x4a,0x4e]
206# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
207# CHECK-UNKNOWN: 4e4a0457 <unknown>
208
209vmsbc.vx v8, v4, a0
210# CHECK-INST: vmsbc.vx v8, v4, a0
211# CHECK-ENCODING: [0x57,0x44,0x45,0x4e]
212# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
213# CHECK-UNKNOWN: 4e454457 <unknown>
214
215vssubu.vv v8, v4, v20, v0.t
216# CHECK-INST: vssubu.vv v8, v4, v20, v0.t
217# CHECK-ENCODING: [0x57,0x04,0x4a,0x88]
218# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
219# CHECK-UNKNOWN: 884a0457 <unknown>
220
221vssubu.vv v8, v4, v20
222# CHECK-INST: vssubu.vv v8, v4, v20
223# CHECK-ENCODING: [0x57,0x04,0x4a,0x8a]
224# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
225# CHECK-UNKNOWN: 8a4a0457 <unknown>
226
227vssubu.vx v8, v4, a0, v0.t
228# CHECK-INST: vssubu.vx v8, v4, a0, v0.t
229# CHECK-ENCODING: [0x57,0x44,0x45,0x88]
230# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
231# CHECK-UNKNOWN: 88454457 <unknown>
232
233vssubu.vx v8, v4, a0
234# CHECK-INST: vssubu.vx v8, v4, a0
235# CHECK-ENCODING: [0x57,0x44,0x45,0x8a]
236# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
237# CHECK-UNKNOWN: 8a454457 <unknown>
238
239vssub.vv v8, v4, v20, v0.t
240# CHECK-INST: vssub.vv v8, v4, v20, v0.t
241# CHECK-ENCODING: [0x57,0x04,0x4a,0x8c]
242# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
243# CHECK-UNKNOWN: 8c4a0457 <unknown>
244
245vssub.vv v8, v4, v20
246# CHECK-INST: vssub.vv v8, v4, v20
247# CHECK-ENCODING: [0x57,0x04,0x4a,0x8e]
248# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
249# CHECK-UNKNOWN: 8e4a0457 <unknown>
250
251vssub.vx v8, v4, a0, v0.t
252# CHECK-INST: vssub.vx v8, v4, a0, v0.t
253# CHECK-ENCODING: [0x57,0x44,0x45,0x8c]
254# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
255# CHECK-UNKNOWN: 8c454457 <unknown>
256
257vssub.vx v8, v4, a0
258# CHECK-INST: vssub.vx v8, v4, a0
259# CHECK-ENCODING: [0x57,0x44,0x45,0x8e]
260# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
261# CHECK-UNKNOWN: 8e454457 <unknown>
262
263vasub.vv v8, v4, v20, v0.t
264# CHECK-INST: vasub.vv v8, v4, v20, v0.t
265# CHECK-ENCODING: [0x57,0x24,0x4a,0x2c]
266# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
267# CHECK-UNKNOWN: 2c4a2457 <unknown>
268
269vasub.vv v8, v4, v20
270# CHECK-INST: vasub.vv v8, v4, v20
271# CHECK-ENCODING: [0x57,0x24,0x4a,0x2e]
272# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
273# CHECK-UNKNOWN: 2e4a2457 <unknown>
274
275vasub.vx v8, v4, a0, v0.t
276# CHECK-INST: vasub.vx v8, v4, a0, v0.t
277# CHECK-ENCODING: [0x57,0x64,0x45,0x2c]
278# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
279# CHECK-UNKNOWN: 2c456457 <unknown>
280
281vasub.vx v8, v4, a0
282# CHECK-INST: vasub.vx v8, v4, a0
283# CHECK-ENCODING: [0x57,0x64,0x45,0x2e]
284# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
285# CHECK-UNKNOWN: 2e456457 <unknown>
286
287vasubu.vv v8, v4, v20, v0.t
288# CHECK-INST: vasubu.vv v8, v4, v20, v0.t
289# CHECK-ENCODING: [0x57,0x24,0x4a,0x28]
290# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
291# CHECK-UNKNOWN: 284a2457 <unknown>
292
293vasubu.vv v8, v4, v20
294# CHECK-INST: vasubu.vv v8, v4, v20
295# CHECK-ENCODING: [0x57,0x24,0x4a,0x2a]
296# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
297# CHECK-UNKNOWN: 2a4a2457 <unknown>
298
299vasubu.vx v8, v4, a0, v0.t
300# CHECK-INST: vasubu.vx v8, v4, a0, v0.t
301# CHECK-ENCODING: [0x57,0x64,0x45,0x28]
302# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
303# CHECK-UNKNOWN: 28456457 <unknown>
304
305vasubu.vx v8, v4, a0
306# CHECK-INST: vasubu.vx v8, v4, a0
307# CHECK-ENCODING: [0x57,0x64,0x45,0x2a]
308# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
309# CHECK-UNKNOWN: 2a456457 <unknown>
310