1 ; RUN: llc < %s -asm-verbose=false -verify-machineinstrs -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -mattr=+unimplemented-simd128 | FileCheck %s --check-prefixes CHECK,SIMD128
2 ; RUN: llc < %s -asm-verbose=false -verify-machineinstrs -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -mattr=+unimplemented-simd128 -fast-isel | FileCheck %s --check-prefixes CHECK,SIMD128
4 ; Test that SIMD128 intrinsics lower as expected. These intrinsics are
5 ; only expected to lower successfully if the simd128 attribute is
6 ; enabled and legal types are used.
8 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
9 target triple = "wasm32-unknown-unknown"
11 ; ==============================================================================
13 ; ==============================================================================
14 ; CHECK-LABEL: swizzle_v16i8:
15 ; SIMD128-NEXT: .functype swizzle_v16i8 (v128, v128) -> (v128){{$}}
16 ; SIMD128-NEXT: v8x16.swizzle $push[[R:[0-9]+]]=, $0, $1{{$}}
17 ; SIMD128-NEXT: return $pop[[R]]{{$}}
18 declare <16 x i8> @llvm.wasm.swizzle(<16 x i8>, <16 x i8>)
19 define <16 x i8> @swizzle_v16i8(<16 x i8> %x, <16 x i8> %y) {
20 %a = call <16 x i8> @llvm.wasm.swizzle(<16 x i8> %x, <16 x i8> %y)
24 ; CHECK-LABEL: add_sat_s_v16i8:
25 ; SIMD128-NEXT: .functype add_sat_s_v16i8 (v128, v128) -> (v128){{$}}
26 ; SIMD128-NEXT: i8x16.add_saturate_s $push[[R:[0-9]+]]=, $0, $1{{$}}
27 ; SIMD128-NEXT: return $pop[[R]]{{$}}
28 declare <16 x i8> @llvm.sadd.sat.v16i8(<16 x i8>, <16 x i8>)
29 define <16 x i8> @add_sat_s_v16i8(<16 x i8> %x, <16 x i8> %y) {
30 %a = call <16 x i8> @llvm.sadd.sat.v16i8(<16 x i8> %x, <16 x i8> %y)
34 ; CHECK-LABEL: add_sat_u_v16i8:
35 ; SIMD128-NEXT: .functype add_sat_u_v16i8 (v128, v128) -> (v128){{$}}
36 ; SIMD128-NEXT: i8x16.add_saturate_u $push[[R:[0-9]+]]=, $0, $1{{$}}
37 ; SIMD128-NEXT: return $pop[[R]]{{$}}
38 declare <16 x i8> @llvm.uadd.sat.v16i8(<16 x i8>, <16 x i8>)
39 define <16 x i8> @add_sat_u_v16i8(<16 x i8> %x, <16 x i8> %y) {
40 %a = call <16 x i8> @llvm.uadd.sat.v16i8(<16 x i8> %x, <16 x i8> %y)
44 ; CHECK-LABEL: sub_sat_s_v16i8:
45 ; SIMD128-NEXT: .functype sub_sat_s_v16i8 (v128, v128) -> (v128){{$}}
46 ; SIMD128-NEXT: i8x16.sub_saturate_s $push[[R:[0-9]+]]=, $0, $1{{$}}
47 ; SIMD128-NEXT: return $pop[[R]]{{$}}
48 declare <16 x i8> @llvm.wasm.sub.saturate.signed.v16i8(<16 x i8>, <16 x i8>)
49 define <16 x i8> @sub_sat_s_v16i8(<16 x i8> %x, <16 x i8> %y) {
50 %a = call <16 x i8> @llvm.wasm.sub.saturate.signed.v16i8(
51 <16 x i8> %x, <16 x i8> %y
56 ; CHECK-LABEL: sub_sat_u_v16i8:
57 ; SIMD128-NEXT: .functype sub_sat_u_v16i8 (v128, v128) -> (v128){{$}}
58 ; SIMD128-NEXT: i8x16.sub_saturate_u $push[[R:[0-9]+]]=, $0, $1{{$}}
59 ; SIMD128-NEXT: return $pop[[R]]{{$}}
60 declare <16 x i8> @llvm.wasm.sub.saturate.unsigned.v16i8(<16 x i8>, <16 x i8>)
61 define <16 x i8> @sub_sat_u_v16i8(<16 x i8> %x, <16 x i8> %y) {
62 %a = call <16 x i8> @llvm.wasm.sub.saturate.unsigned.v16i8(
63 <16 x i8> %x, <16 x i8> %y
68 ; CHECK-LABEL: any_v16i8:
69 ; SIMD128-NEXT: .functype any_v16i8 (v128) -> (i32){{$}}
70 ; SIMD128-NEXT: i8x16.any_true $push[[R:[0-9]+]]=, $0{{$}}
71 ; SIMD128-NEXT: return $pop[[R]]{{$}}
72 declare i32 @llvm.wasm.anytrue.v16i8(<16 x i8>)
73 define i32 @any_v16i8(<16 x i8> %x) {
74 %a = call i32 @llvm.wasm.anytrue.v16i8(<16 x i8> %x)
78 ; CHECK-LABEL: all_v16i8:
79 ; SIMD128-NEXT: .functype all_v16i8 (v128) -> (i32){{$}}
80 ; SIMD128-NEXT: i8x16.all_true $push[[R:[0-9]+]]=, $0{{$}}
81 ; SIMD128-NEXT: return $pop[[R]]{{$}}
82 declare i32 @llvm.wasm.alltrue.v16i8(<16 x i8>)
83 define i32 @all_v16i8(<16 x i8> %x) {
84 %a = call i32 @llvm.wasm.alltrue.v16i8(<16 x i8> %x)
88 ; CHECK-LABEL: bitselect_v16i8:
89 ; SIMD128-NEXT: .functype bitselect_v16i8 (v128, v128, v128) -> (v128){{$}}
90 ; SIMD128-NEXT: v128.bitselect $push[[R:[0-9]+]]=, $0, $1, $2{{$}}
91 ; SIMD128-NEXT: return $pop[[R]]{{$}}
92 declare <16 x i8> @llvm.wasm.bitselect.v16i8(<16 x i8>, <16 x i8>, <16 x i8>)
93 define <16 x i8> @bitselect_v16i8(<16 x i8> %v1, <16 x i8> %v2, <16 x i8> %c) {
94 %a = call <16 x i8> @llvm.wasm.bitselect.v16i8(
95 <16 x i8> %v1, <16 x i8> %v2, <16 x i8> %c
100 ; CHECK-LABEL: narrow_signed_v16i8:
101 ; SIMD128-NEXT: .functype narrow_signed_v16i8 (v128, v128) -> (v128){{$}}
102 ; SIMD128-NEXT: i8x16.narrow_i16x8_s $push[[R:[0-9]+]]=, $0, $1{{$}}
103 ; SIMD128-NEXT: return $pop[[R]]{{$}}
104 declare <16 x i8> @llvm.wasm.narrow.signed.v16i8.v8i16(<8 x i16>, <8 x i16>)
105 define <16 x i8> @narrow_signed_v16i8(<8 x i16> %low, <8 x i16> %high) {
106 %a = call <16 x i8> @llvm.wasm.narrow.signed.v16i8.v8i16(
107 <8 x i16> %low, <8 x i16> %high
112 ; CHECK-LABEL: narrow_unsigned_v16i8:
113 ; SIMD128-NEXT: .functype narrow_unsigned_v16i8 (v128, v128) -> (v128){{$}}
114 ; SIMD128-NEXT: i8x16.narrow_i16x8_u $push[[R:[0-9]+]]=, $0, $1{{$}}
115 ; SIMD128-NEXT: return $pop[[R]]{{$}}
116 declare <16 x i8> @llvm.wasm.narrow.unsigned.v16i8.v8i16(<8 x i16>, <8 x i16>)
117 define <16 x i8> @narrow_unsigned_v16i8(<8 x i16> %low, <8 x i16> %high) {
118 %a = call <16 x i8> @llvm.wasm.narrow.unsigned.v16i8.v8i16(
119 <8 x i16> %low, <8 x i16> %high
124 ; ==============================================================================
126 ; ==============================================================================
127 ; CHECK-LABEL: add_sat_s_v8i16:
128 ; SIMD128-NEXT: .functype add_sat_s_v8i16 (v128, v128) -> (v128){{$}}
129 ; SIMD128-NEXT: i16x8.add_saturate_s $push[[R:[0-9]+]]=, $0, $1{{$}}
130 ; SIMD128-NEXT: return $pop[[R]]{{$}}
131 declare <8 x i16> @llvm.sadd.sat.v8i16(<8 x i16>, <8 x i16>)
132 define <8 x i16> @add_sat_s_v8i16(<8 x i16> %x, <8 x i16> %y) {
133 %a = call <8 x i16> @llvm.sadd.sat.v8i16(<8 x i16> %x, <8 x i16> %y)
137 ; CHECK-LABEL: add_sat_u_v8i16:
138 ; SIMD128-NEXT: .functype add_sat_u_v8i16 (v128, v128) -> (v128){{$}}
139 ; SIMD128-NEXT: i16x8.add_saturate_u $push[[R:[0-9]+]]=, $0, $1{{$}}
140 ; SIMD128-NEXT: return $pop[[R]]{{$}}
141 declare <8 x i16> @llvm.uadd.sat.v8i16(<8 x i16>, <8 x i16>)
142 define <8 x i16> @add_sat_u_v8i16(<8 x i16> %x, <8 x i16> %y) {
143 %a = call <8 x i16> @llvm.uadd.sat.v8i16(<8 x i16> %x, <8 x i16> %y)
147 ; CHECK-LABEL: sub_sat_s_v8i16:
148 ; SIMD128-NEXT: .functype sub_sat_s_v8i16 (v128, v128) -> (v128){{$}}
149 ; SIMD128-NEXT: i16x8.sub_saturate_s $push[[R:[0-9]+]]=, $0, $1{{$}}
150 ; SIMD128-NEXT: return $pop[[R]]{{$}}
151 declare <8 x i16> @llvm.wasm.sub.saturate.signed.v8i16(<8 x i16>, <8 x i16>)
152 define <8 x i16> @sub_sat_s_v8i16(<8 x i16> %x, <8 x i16> %y) {
153 %a = call <8 x i16> @llvm.wasm.sub.saturate.signed.v8i16(
154 <8 x i16> %x, <8 x i16> %y
159 ; CHECK-LABEL: sub_sat_u_v8i16:
160 ; SIMD128-NEXT: .functype sub_sat_u_v8i16 (v128, v128) -> (v128){{$}}
161 ; SIMD128-NEXT: i16x8.sub_saturate_u $push[[R:[0-9]+]]=, $0, $1{{$}}
162 ; SIMD128-NEXT: return $pop[[R]]{{$}}
163 declare <8 x i16> @llvm.wasm.sub.saturate.unsigned.v8i16(<8 x i16>, <8 x i16>)
164 define <8 x i16> @sub_sat_u_v8i16(<8 x i16> %x, <8 x i16> %y) {
165 %a = call <8 x i16> @llvm.wasm.sub.saturate.unsigned.v8i16(
166 <8 x i16> %x, <8 x i16> %y
171 ; CHECK-LABEL: any_v8i16:
172 ; SIMD128-NEXT: .functype any_v8i16 (v128) -> (i32){{$}}
173 ; SIMD128-NEXT: i16x8.any_true $push[[R:[0-9]+]]=, $0{{$}}
174 ; SIMD128-NEXT: return $pop[[R]]{{$}}
175 declare i32 @llvm.wasm.anytrue.v8i16(<8 x i16>)
176 define i32 @any_v8i16(<8 x i16> %x) {
177 %a = call i32 @llvm.wasm.anytrue.v8i16(<8 x i16> %x)
181 ; CHECK-LABEL: all_v8i16:
182 ; SIMD128-NEXT: .functype all_v8i16 (v128) -> (i32){{$}}
183 ; SIMD128-NEXT: i16x8.all_true $push[[R:[0-9]+]]=, $0{{$}}
184 ; SIMD128-NEXT: return $pop[[R]]{{$}}
185 declare i32 @llvm.wasm.alltrue.v8i16(<8 x i16>)
186 define i32 @all_v8i16(<8 x i16> %x) {
187 %a = call i32 @llvm.wasm.alltrue.v8i16(<8 x i16> %x)
191 ; CHECK-LABEL: bitselect_v8i16:
192 ; SIMD128-NEXT: .functype bitselect_v8i16 (v128, v128, v128) -> (v128){{$}}
193 ; SIMD128-NEXT: v128.bitselect $push[[R:[0-9]+]]=, $0, $1, $2{{$}}
194 ; SIMD128-NEXT: return $pop[[R]]{{$}}
195 declare <8 x i16> @llvm.wasm.bitselect.v8i16(<8 x i16>, <8 x i16>, <8 x i16>)
196 define <8 x i16> @bitselect_v8i16(<8 x i16> %v1, <8 x i16> %v2, <8 x i16> %c) {
197 %a = call <8 x i16> @llvm.wasm.bitselect.v8i16(
198 <8 x i16> %v1, <8 x i16> %v2, <8 x i16> %c
203 ; CHECK-LABEL: narrow_signed_v8i16:
204 ; SIMD128-NEXT: .functype narrow_signed_v8i16 (v128, v128) -> (v128){{$}}
205 ; SIMD128-NEXT: i16x8.narrow_i32x4_s $push[[R:[0-9]+]]=, $0, $1{{$}}
206 ; SIMD128-NEXT: return $pop[[R]]{{$}}
207 declare <8 x i16> @llvm.wasm.narrow.signed.v8i16.v4i32(<4 x i32>, <4 x i32>)
208 define <8 x i16> @narrow_signed_v8i16(<4 x i32> %low, <4 x i32> %high) {
209 %a = call <8 x i16> @llvm.wasm.narrow.signed.v8i16.v4i32(
210 <4 x i32> %low, <4 x i32> %high
215 ; CHECK-LABEL: narrow_unsigned_v8i16:
216 ; SIMD128-NEXT: .functype narrow_unsigned_v8i16 (v128, v128) -> (v128){{$}}
217 ; SIMD128-NEXT: i16x8.narrow_i32x4_u $push[[R:[0-9]+]]=, $0, $1{{$}}
218 ; SIMD128-NEXT: return $pop[[R]]{{$}}
219 declare <8 x i16> @llvm.wasm.narrow.unsigned.v8i16.v4i32(<4 x i32>, <4 x i32>)
220 define <8 x i16> @narrow_unsigned_v8i16(<4 x i32> %low, <4 x i32> %high) {
221 %a = call <8 x i16> @llvm.wasm.narrow.unsigned.v8i16.v4i32(
222 <4 x i32> %low, <4 x i32> %high
227 ; CHECK-LABEL: widen_low_signed_v8i16:
228 ; SIMD128-NEXT: .functype widen_low_signed_v8i16 (v128) -> (v128){{$}}
229 ; SIMD128-NEXT: i16x8.widen_low_i8x16_s $push[[R:[0-9]+]]=, $0{{$}}
230 ; SIMD128-NEXT: return $pop[[R]]{{$}}
231 declare <8 x i16> @llvm.wasm.widen.low.signed.v8i16.v16i8(<16 x i8>)
232 define <8 x i16> @widen_low_signed_v8i16(<16 x i8> %v) {
233 %a = call <8 x i16> @llvm.wasm.widen.low.signed.v8i16.v16i8(<16 x i8> %v)
237 ; CHECK-LABEL: widen_high_signed_v8i16:
238 ; SIMD128-NEXT: .functype widen_high_signed_v8i16 (v128) -> (v128){{$}}
239 ; SIMD128-NEXT: i16x8.widen_high_i8x16_s $push[[R:[0-9]+]]=, $0{{$}}
240 ; SIMD128-NEXT: return $pop[[R]]{{$}}
241 declare <8 x i16> @llvm.wasm.widen.high.signed.v8i16.v16i8(<16 x i8>)
242 define <8 x i16> @widen_high_signed_v8i16(<16 x i8> %v) {
243 %a = call <8 x i16> @llvm.wasm.widen.high.signed.v8i16.v16i8(<16 x i8> %v)
247 ; CHECK-LABEL: widen_low_unsigned_v8i16:
248 ; SIMD128-NEXT: .functype widen_low_unsigned_v8i16 (v128) -> (v128){{$}}
249 ; SIMD128-NEXT: i16x8.widen_low_i8x16_u $push[[R:[0-9]+]]=, $0{{$}}
250 ; SIMD128-NEXT: return $pop[[R]]{{$}}
251 declare <8 x i16> @llvm.wasm.widen.low.unsigned.v8i16.v16i8(<16 x i8>)
252 define <8 x i16> @widen_low_unsigned_v8i16(<16 x i8> %v) {
253 %a = call <8 x i16> @llvm.wasm.widen.low.unsigned.v8i16.v16i8(<16 x i8> %v)
257 ; CHECK-LABEL: widen_high_unsigned_v8i16:
258 ; SIMD128-NEXT: .functype widen_high_unsigned_v8i16 (v128) -> (v128){{$}}
259 ; SIMD128-NEXT: i16x8.widen_high_i8x16_u $push[[R:[0-9]+]]=, $0{{$}}
260 ; SIMD128-NEXT: return $pop[[R]]{{$}}
261 declare <8 x i16> @llvm.wasm.widen.high.unsigned.v8i16.v16i8(<16 x i8>)
262 define <8 x i16> @widen_high_unsigned_v8i16(<16 x i8> %v) {
263 %a = call <8 x i16> @llvm.wasm.widen.high.unsigned.v8i16.v16i8(<16 x i8> %v)
267 ; ==============================================================================
269 ; ==============================================================================
270 ; CHECK-LABEL: any_v4i32:
271 ; SIMD128-NEXT: .functype any_v4i32 (v128) -> (i32){{$}}
272 ; SIMD128-NEXT: i32x4.any_true $push[[R:[0-9]+]]=, $0{{$}}
273 ; SIMD128-NEXT: return $pop[[R]]{{$}}
274 declare i32 @llvm.wasm.anytrue.v4i32(<4 x i32>)
275 define i32 @any_v4i32(<4 x i32> %x) {
276 %a = call i32 @llvm.wasm.anytrue.v4i32(<4 x i32> %x)
280 ; CHECK-LABEL: all_v4i32:
281 ; SIMD128-NEXT: .functype all_v4i32 (v128) -> (i32){{$}}
282 ; SIMD128-NEXT: i32x4.all_true $push[[R:[0-9]+]]=, $0{{$}}
283 ; SIMD128-NEXT: return $pop[[R]]{{$}}
284 declare i32 @llvm.wasm.alltrue.v4i32(<4 x i32>)
285 define i32 @all_v4i32(<4 x i32> %x) {
286 %a = call i32 @llvm.wasm.alltrue.v4i32(<4 x i32> %x)
290 ; CHECK-LABEL: bitselect_v4i32:
291 ; SIMD128-NEXT: .functype bitselect_v4i32 (v128, v128, v128) -> (v128){{$}}
292 ; SIMD128-NEXT: v128.bitselect $push[[R:[0-9]+]]=, $0, $1, $2{{$}}
293 ; SIMD128-NEXT: return $pop[[R]]{{$}}
294 declare <4 x i32> @llvm.wasm.bitselect.v4i32(<4 x i32>, <4 x i32>, <4 x i32>)
295 define <4 x i32> @bitselect_v4i32(<4 x i32> %v1, <4 x i32> %v2, <4 x i32> %c) {
296 %a = call <4 x i32> @llvm.wasm.bitselect.v4i32(
297 <4 x i32> %v1, <4 x i32> %v2, <4 x i32> %c
302 ; CHECK-LABEL: trunc_sat_s_v4i32:
303 ; NO-SIMD128-NOT: f32x4
304 ; SIMD128-NEXT: .functype trunc_sat_s_v4i32 (v128) -> (v128){{$}}
305 ; SIMD128-NEXT: i32x4.trunc_sat_f32x4_s $push[[R:[0-9]+]]=, $0
306 ; SIMD128-NEXT: return $pop[[R]]
307 declare <4 x i32> @llvm.wasm.trunc.saturate.signed.v4i32.v4f32(<4 x float>)
308 define <4 x i32> @trunc_sat_s_v4i32(<4 x float> %x) {
309 %a = call <4 x i32> @llvm.wasm.trunc.saturate.signed.v4i32.v4f32(<4 x float> %x)
313 ; CHECK-LABEL: trunc_sat_u_v4i32:
314 ; NO-SIMD128-NOT: f32x4
315 ; SIMD128-NEXT: .functype trunc_sat_u_v4i32 (v128) -> (v128){{$}}
316 ; SIMD128-NEXT: i32x4.trunc_sat_f32x4_u $push[[R:[0-9]+]]=, $0
317 ; SIMD128-NEXT: return $pop[[R]]
318 declare <4 x i32> @llvm.wasm.trunc.saturate.unsigned.v4i32.v4f32(<4 x float>)
319 define <4 x i32> @trunc_sat_u_v4i32(<4 x float> %x) {
320 %a = call <4 x i32> @llvm.wasm.trunc.saturate.unsigned.v4i32.v4f32(<4 x float> %x)
324 ; CHECK-LABEL: widen_low_signed_v4i32:
325 ; SIMD128-NEXT: .functype widen_low_signed_v4i32 (v128) -> (v128){{$}}
326 ; SIMD128-NEXT: i32x4.widen_low_i16x8_s $push[[R:[0-9]+]]=, $0{{$}}
327 ; SIMD128-NEXT: return $pop[[R]]{{$}}
328 declare <4 x i32> @llvm.wasm.widen.low.signed.v4i32.v8i16(<8 x i16>)
329 define <4 x i32> @widen_low_signed_v4i32(<8 x i16> %v) {
330 %a = call <4 x i32> @llvm.wasm.widen.low.signed.v4i32.v8i16(<8 x i16> %v)
334 ; CHECK-LABEL: widen_high_signed_v4i32:
335 ; SIMD128-NEXT: .functype widen_high_signed_v4i32 (v128) -> (v128){{$}}
336 ; SIMD128-NEXT: i32x4.widen_high_i16x8_s $push[[R:[0-9]+]]=, $0{{$}}
337 ; SIMD128-NEXT: return $pop[[R]]{{$}}
338 declare <4 x i32> @llvm.wasm.widen.high.signed.v4i32.v8i16(<8 x i16>)
339 define <4 x i32> @widen_high_signed_v4i32(<8 x i16> %v) {
340 %a = call <4 x i32> @llvm.wasm.widen.high.signed.v4i32.v8i16(<8 x i16> %v)
344 ; CHECK-LABEL: widen_low_unsigned_v4i32:
345 ; SIMD128-NEXT: .functype widen_low_unsigned_v4i32 (v128) -> (v128){{$}}
346 ; SIMD128-NEXT: i32x4.widen_low_i16x8_u $push[[R:[0-9]+]]=, $0{{$}}
347 ; SIMD128-NEXT: return $pop[[R]]{{$}}
348 declare <4 x i32> @llvm.wasm.widen.low.unsigned.v4i32.v8i16(<8 x i16>)
349 define <4 x i32> @widen_low_unsigned_v4i32(<8 x i16> %v) {
350 %a = call <4 x i32> @llvm.wasm.widen.low.unsigned.v4i32.v8i16(<8 x i16> %v)
354 ; CHECK-LABEL: widen_high_unsigned_v4i32:
355 ; SIMD128-NEXT: .functype widen_high_unsigned_v4i32 (v128) -> (v128){{$}}
356 ; SIMD128-NEXT: i32x4.widen_high_i16x8_u $push[[R:[0-9]+]]=, $0{{$}}
357 ; SIMD128-NEXT: return $pop[[R]]{{$}}
358 declare <4 x i32> @llvm.wasm.widen.high.unsigned.v4i32.v8i16(<8 x i16>)
359 define <4 x i32> @widen_high_unsigned_v4i32(<8 x i16> %v) {
360 %a = call <4 x i32> @llvm.wasm.widen.high.unsigned.v4i32.v8i16(<8 x i16> %v)
364 ; ==============================================================================
366 ; ==============================================================================
367 ; CHECK-LABEL: any_v2i64:
368 ; SIMD128-NEXT: .functype any_v2i64 (v128) -> (i32){{$}}
369 ; SIMD128-NEXT: i64x2.any_true $push[[R:[0-9]+]]=, $0{{$}}
370 ; SIMD128-NEXT: return $pop[[R]]{{$}}
371 declare i32 @llvm.wasm.anytrue.v2i64(<2 x i64>)
372 define i32 @any_v2i64(<2 x i64> %x) {
373 %a = call i32 @llvm.wasm.anytrue.v2i64(<2 x i64> %x)
377 ; CHECK-LABEL: all_v2i64:
378 ; SIMD128-NEXT: .functype all_v2i64 (v128) -> (i32){{$}}
379 ; SIMD128-NEXT: i64x2.all_true $push[[R:[0-9]+]]=, $0{{$}}
380 ; SIMD128-NEXT: return $pop[[R]]{{$}}
381 declare i32 @llvm.wasm.alltrue.v2i64(<2 x i64>)
382 define i32 @all_v2i64(<2 x i64> %x) {
383 %a = call i32 @llvm.wasm.alltrue.v2i64(<2 x i64> %x)
387 ; CHECK-LABEL: bitselect_v2i64:
388 ; SIMD128-NEXT: .functype bitselect_v2i64 (v128, v128, v128) -> (v128){{$}}
389 ; SIMD128-NEXT: v128.bitselect $push[[R:[0-9]+]]=, $0, $1, $2{{$}}
390 ; SIMD128-NEXT: return $pop[[R]]{{$}}
391 declare <2 x i64> @llvm.wasm.bitselect.v2i64(<2 x i64>, <2 x i64>, <2 x i64>)
392 define <2 x i64> @bitselect_v2i64(<2 x i64> %v1, <2 x i64> %v2, <2 x i64> %c) {
393 %a = call <2 x i64> @llvm.wasm.bitselect.v2i64(
394 <2 x i64> %v1, <2 x i64> %v2, <2 x i64> %c
399 ; CHECK-LABEL: trunc_sat_s_v2i64:
400 ; NO-SIMD128-NOT: f32x4
401 ; SIMD128-NEXT: .functype trunc_sat_s_v2i64 (v128) -> (v128){{$}}
402 ; SIMD128-NEXT: i64x2.trunc_sat_f64x2_s $push[[R:[0-9]+]]=, $0
403 ; SIMD128-NEXT: return $pop[[R]]
404 declare <2 x i64> @llvm.wasm.trunc.saturate.signed.v2i64.v2f64(<2 x double>)
405 define <2 x i64> @trunc_sat_s_v2i64(<2 x double> %x) {
406 %a = call <2 x i64> @llvm.wasm.trunc.saturate.signed.v2i64.v2f64(<2 x double> %x)
410 ; CHECK-LABEL: trunc_sat_u_v2i64:
411 ; NO-SIMD128-NOT: f32x4
412 ; SIMD128-NEXT: .functype trunc_sat_u_v2i64 (v128) -> (v128){{$}}
413 ; SIMD128-NEXT: i64x2.trunc_sat_f64x2_u $push[[R:[0-9]+]]=, $0
414 ; SIMD128-NEXT: return $pop[[R]]
415 declare <2 x i64> @llvm.wasm.trunc.saturate.unsigned.v2i64.v2f64(<2 x double>)
416 define <2 x i64> @trunc_sat_u_v2i64(<2 x double> %x) {
417 %a = call <2 x i64> @llvm.wasm.trunc.saturate.unsigned.v2i64.v2f64(<2 x double> %x)
421 ; ==============================================================================
423 ; ==============================================================================
424 ; CHECK-LABEL: bitselect_v4f32:
425 ; SIMD128-NEXT: .functype bitselect_v4f32 (v128, v128, v128) -> (v128){{$}}
426 ; SIMD128-NEXT: v128.bitselect $push[[R:[0-9]+]]=, $0, $1, $2{{$}}
427 ; SIMD128-NEXT: return $pop[[R]]{{$}}
428 declare <4 x float> @llvm.wasm.bitselect.v4f32(<4 x float>, <4 x float>, <4 x float>)
429 define <4 x float> @bitselect_v4f32(<4 x float> %v1, <4 x float> %v2, <4 x float> %c) {
430 %a = call <4 x float> @llvm.wasm.bitselect.v4f32(
431 <4 x float> %v1, <4 x float> %v2, <4 x float> %c
436 ; CHECK-LABEL: qfma_v4f32:
437 ; SIMD128-NEXT: .functype qfma_v4f32 (v128, v128, v128) -> (v128){{$}}
438 ; SIMD128-NEXT: f32x4.qfma $push[[R:[0-9]+]]=, $0, $1, $2{{$}}
439 ; SIMD128-NEXT: return $pop[[R]]{{$}}
440 declare <4 x float> @llvm.wasm.qfma.v4f32(<4 x float>, <4 x float>, <4 x float>)
441 define <4 x float> @qfma_v4f32(<4 x float> %a, <4 x float> %b, <4 x float> %c) {
442 %v = call <4 x float> @llvm.wasm.qfma.v4f32(
443 <4 x float> %a, <4 x float> %b, <4 x float> %c
448 ; CHECK-LABEL: qfms_v4f32:
449 ; SIMD128-NEXT: .functype qfms_v4f32 (v128, v128, v128) -> (v128){{$}}
450 ; SIMD128-NEXT: f32x4.qfms $push[[R:[0-9]+]]=, $0, $1, $2{{$}}
451 ; SIMD128-NEXT: return $pop[[R]]{{$}}
452 declare <4 x float> @llvm.wasm.qfms.v4f32(<4 x float>, <4 x float>, <4 x float>)
453 define <4 x float> @qfms_v4f32(<4 x float> %a, <4 x float> %b, <4 x float> %c) {
454 %v = call <4 x float> @llvm.wasm.qfms.v4f32(
455 <4 x float> %a, <4 x float> %b, <4 x float> %c
460 ; ==============================================================================
462 ; ==============================================================================
463 ; CHECK-LABEL: bitselect_v2f64:
464 ; SIMD128-NEXT: .functype bitselect_v2f64 (v128, v128, v128) -> (v128){{$}}
465 ; SIMD128-NEXT: v128.bitselect $push[[R:[0-9]+]]=, $0, $1, $2{{$}}
466 ; SIMD128-NEXT: return $pop[[R]]{{$}}
467 declare <2 x double> @llvm.wasm.bitselect.v2f64(<2 x double>, <2 x double>, <2 x double>)
468 define <2 x double> @bitselect_v2f64(<2 x double> %v1, <2 x double> %v2, <2 x double> %c) {
469 %a = call <2 x double> @llvm.wasm.bitselect.v2f64(
470 <2 x double> %v1, <2 x double> %v2, <2 x double> %c
475 ; CHECK-LABEL: qfma_v2f64:
476 ; SIMD128-NEXT: .functype qfma_v2f64 (v128, v128, v128) -> (v128){{$}}
477 ; SIMD128-NEXT: f64x2.qfma $push[[R:[0-9]+]]=, $0, $1, $2{{$}}
478 ; SIMD128-NEXT: return $pop[[R]]{{$}}
479 declare <2 x double> @llvm.wasm.qfma.v2f64(<2 x double>, <2 x double>, <2 x double>)
480 define <2 x double> @qfma_v2f64(<2 x double> %a, <2 x double> %b, <2 x double> %c) {
481 %v = call <2 x double> @llvm.wasm.qfma.v2f64(
482 <2 x double> %a, <2 x double> %b, <2 x double> %c
487 ; CHECK-LABEL: qfms_v2f64:
488 ; SIMD128-NEXT: .functype qfms_v2f64 (v128, v128, v128) -> (v128){{$}}
489 ; SIMD128-NEXT: f64x2.qfms $push[[R:[0-9]+]]=, $0, $1, $2{{$}}
490 ; SIMD128-NEXT: return $pop[[R]]{{$}}
491 declare <2 x double> @llvm.wasm.qfms.v2f64(<2 x double>, <2 x double>, <2 x double>)
492 define <2 x double> @qfms_v2f64(<2 x double> %a, <2 x double> %b, <2 x double> %c) {
493 %v = call <2 x double> @llvm.wasm.qfms.v2f64(
494 <2 x double> %a, <2 x double> %b, <2 x double> %c