[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / RISCV / rvv / sub.s
blob9b66677a34ab67ac93392b62d8164bdf28c884a5
1 # RUN: llvm-mc -triple=riscv64 -show-encoding --mattr=+experimental-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=+experimental-v %s \
6 # RUN: | llvm-objdump -d --mattr=+experimental-v - \
7 # RUN: | FileCheck %s --check-prefix=CHECK-INST
8 # RUN: llvm-mc -triple=riscv64 -filetype=obj --mattr=+experimental-v %s \
9 # RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
11 vsub.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 Instructions)
15 # CHECK-UNKNOWN: 57 04 4a 08 <unknown>
17 vsub.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 Instructions)
21 # CHECK-UNKNOWN: 57 04 4a 0a <unknown>
23 vsub.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 Instructions)
27 # CHECK-UNKNOWN: 57 44 45 08 <unknown>
29 vsub.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 Instructions)
33 # CHECK-UNKNOWN: 57 44 45 0a <unknown>
35 vrsub.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 Instructions)
39 # CHECK-UNKNOWN: 57 44 45 0c <unknown>
41 vrsub.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 Instructions)
45 # CHECK-UNKNOWN: 57 44 45 0e <unknown>
47 vrsub.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 Instructions)
51 # CHECK-UNKNOWN: 57 b4 47 0c <unknown>
53 vrsub.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 Instructions)
57 # CHECK-UNKNOWN: 57 b4 47 0e <unknown>
59 vwsubu.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 Instructions)
63 # CHECK-UNKNOWN: 57 24 4a c8 <unknown>
65 vwsubu.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 Instructions)
69 # CHECK-UNKNOWN: 57 24 4a ca <unknown>
71 vwsubu.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 Instructions)
75 # CHECK-UNKNOWN: 57 64 45 c8 <unknown>
77 vwsubu.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 Instructions)
81 # CHECK-UNKNOWN: 57 64 45 ca <unknown>
83 vwsub.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 Instructions)
87 # CHECK-UNKNOWN: 57 24 4a cc <unknown>
89 vwsub.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 Instructions)
93 # CHECK-UNKNOWN: 57 24 4a ce <unknown>
95 vwsub.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 Instructions)
99 # CHECK-UNKNOWN: 57 64 45 cc <unknown>
101 vwsub.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 Instructions)
105 # CHECK-UNKNOWN: 57 64 45 ce <unknown>
107 vwsubu.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 Instructions)
111 # CHECK-UNKNOWN: 57 24 4a d8 <unknown>
113 vwsubu.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 Instructions)
117 # CHECK-UNKNOWN: 57 24 4a da <unknown>
119 vwsubu.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 Instructions)
123 # CHECK-UNKNOWN: 57 64 45 d8 <unknown>
125 vwsubu.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 Instructions)
129 # CHECK-UNKNOWN: 57 64 45 da <unknown>
131 vwsub.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 Instructions)
135 # CHECK-UNKNOWN: 57 24 4a dc <unknown>
137 vwsub.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 Instructions)
141 # CHECK-UNKNOWN: 57 24 4a de <unknown>
143 vwsub.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 Instructions)
147 # CHECK-UNKNOWN: 57 64 45 dc <unknown>
149 vwsub.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 Instructions)
153 # CHECK-UNKNOWN: 57 64 45 de <unknown>
155 vsbc.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 Instructions)
159 # CHECK-UNKNOWN: 57 04 4a 48 <unknown>
161 vsbc.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 Instructions)
165 # CHECK-UNKNOWN: 57 02 4a 48 <unknown>
167 vsbc.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 Instructions)
171 # CHECK-UNKNOWN: 57 04 44 48 <unknown>
173 vsbc.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 Instructions)
177 # CHECK-UNKNOWN: 57 44 45 48 <unknown>
179 vmsbc.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 Instructions)
183 # CHECK-UNKNOWN: 57 04 4a 4c <unknown>
185 vmsbc.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 Instructions)
189 # CHECK-UNKNOWN: 57 02 4a 4c <unknown>
191 vmsbc.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 Instructions)
195 # CHECK-UNKNOWN: 57 04 44 4c <unknown>
197 vmsbc.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 Instructions)
201 # CHECK-UNKNOWN: 57 44 45 4c <unknown>
203 vmsbc.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 Instructions)
207 # CHECK-UNKNOWN: 57 04 4a 4e <unknown>
209 vmsbc.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 Instructions)
213 # CHECK-UNKNOWN: 57 44 45 4e <unknown>
215 vssubu.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 Instructions)
219 # CHECK-UNKNOWN: 57 04 4a 88 <unknown>
221 vssubu.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 Instructions)
225 # CHECK-UNKNOWN: 57 04 4a 8a <unknown>
227 vssubu.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 Instructions)
231 # CHECK-UNKNOWN: 57 44 45 88 <unknown>
233 vssubu.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 Instructions)
237 # CHECK-UNKNOWN: 57 44 45 8a <unknown>
239 vssub.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 Instructions)
243 # CHECK-UNKNOWN: 57 04 4a 8c <unknown>
245 vssub.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 Instructions)
249 # CHECK-UNKNOWN: 57 04 4a 8e <unknown>
251 vssub.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 Instructions)
255 # CHECK-UNKNOWN: 57 44 45 8c <unknown>
257 vssub.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 Instructions)
261 # CHECK-UNKNOWN: 57 44 45 8e <unknown>
263 vasub.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 Instructions)
267 # CHECK-UNKNOWN: 57 24 4a 2c <unknown>
269 vasub.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 Instructions)
273 # CHECK-UNKNOWN: 57 24 4a 2e <unknown>
275 vasub.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 Instructions)
279 # CHECK-UNKNOWN: 57 64 45 2c <unknown>
281 vasub.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 Instructions)
285 # CHECK-UNKNOWN: 57 64 45 2e <unknown>
287 vasubu.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 Instructions)
291 # CHECK-UNKNOWN: 57 24 4a 28 <unknown>
293 vasubu.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 Instructions)
297 # CHECK-UNKNOWN: 57 24 4a 2a <unknown>
299 vasubu.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 Instructions)
303 # CHECK-UNKNOWN: 57 64 45 28 <unknown>
305 vasubu.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 Instructions)
309 # CHECK-UNKNOWN: 57 64 45 2a <unknown>