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: add_sat_s_v16i8:
15 ; SIMD128-NEXT: .functype add_sat_s_v16i8 (v128, v128) -> (v128){{$}}
16 ; SIMD128-NEXT: i8x16.add_saturate_s $push[[R:[0-9]+]]=, $0, $1{{$}}
17 ; SIMD128-NEXT: return $pop[[R]]{{$}}
18 declare <16 x i8> @llvm.sadd.sat.v16i8(<16 x i8>, <16 x i8>)
19 define <16 x i8> @add_sat_s_v16i8(<16 x i8> %x, <16 x i8> %y) {
20 %a = call <16 x i8> @llvm.sadd.sat.v16i8(<16 x i8> %x, <16 x i8> %y)
24 ; CHECK-LABEL: add_sat_u_v16i8:
25 ; SIMD128-NEXT: .functype add_sat_u_v16i8 (v128, v128) -> (v128){{$}}
26 ; SIMD128-NEXT: i8x16.add_saturate_u $push[[R:[0-9]+]]=, $0, $1{{$}}
27 ; SIMD128-NEXT: return $pop[[R]]{{$}}
28 declare <16 x i8> @llvm.uadd.sat.v16i8(<16 x i8>, <16 x i8>)
29 define <16 x i8> @add_sat_u_v16i8(<16 x i8> %x, <16 x i8> %y) {
30 %a = call <16 x i8> @llvm.uadd.sat.v16i8(<16 x i8> %x, <16 x i8> %y)
34 ; CHECK-LABEL: sub_sat_s_v16i8:
35 ; SIMD128-NEXT: .functype sub_sat_s_v16i8 (v128, v128) -> (v128){{$}}
36 ; SIMD128-NEXT: i8x16.sub_saturate_s $push[[R:[0-9]+]]=, $0, $1{{$}}
37 ; SIMD128-NEXT: return $pop[[R]]{{$}}
38 declare <16 x i8> @llvm.wasm.sub.saturate.signed.v16i8(<16 x i8>, <16 x i8>)
39 define <16 x i8> @sub_sat_s_v16i8(<16 x i8> %x, <16 x i8> %y) {
40 %a = call <16 x i8> @llvm.wasm.sub.saturate.signed.v16i8(
41 <16 x i8> %x, <16 x i8> %y
46 ; CHECK-LABEL: sub_sat_u_v16i8:
47 ; SIMD128-NEXT: .functype sub_sat_u_v16i8 (v128, v128) -> (v128){{$}}
48 ; SIMD128-NEXT: i8x16.sub_saturate_u $push[[R:[0-9]+]]=, $0, $1{{$}}
49 ; SIMD128-NEXT: return $pop[[R]]{{$}}
50 declare <16 x i8> @llvm.wasm.sub.saturate.unsigned.v16i8(<16 x i8>, <16 x i8>)
51 define <16 x i8> @sub_sat_u_v16i8(<16 x i8> %x, <16 x i8> %y) {
52 %a = call <16 x i8> @llvm.wasm.sub.saturate.unsigned.v16i8(
53 <16 x i8> %x, <16 x i8> %y
58 ; CHECK-LABEL: any_v16i8:
59 ; SIMD128-NEXT: .functype any_v16i8 (v128) -> (i32){{$}}
60 ; SIMD128-NEXT: i8x16.any_true $push[[R:[0-9]+]]=, $0{{$}}
61 ; SIMD128-NEXT: return $pop[[R]]{{$}}
62 declare i32 @llvm.wasm.anytrue.v16i8(<16 x i8>)
63 define i32 @any_v16i8(<16 x i8> %x) {
64 %a = call i32 @llvm.wasm.anytrue.v16i8(<16 x i8> %x)
68 ; CHECK-LABEL: all_v16i8:
69 ; SIMD128-NEXT: .functype all_v16i8 (v128) -> (i32){{$}}
70 ; SIMD128-NEXT: i8x16.all_true $push[[R:[0-9]+]]=, $0{{$}}
71 ; SIMD128-NEXT: return $pop[[R]]{{$}}
72 declare i32 @llvm.wasm.alltrue.v16i8(<16 x i8>)
73 define i32 @all_v16i8(<16 x i8> %x) {
74 %a = call i32 @llvm.wasm.alltrue.v16i8(<16 x i8> %x)
78 ; CHECK-LABEL: bitselect_v16i8:
79 ; SIMD128-NEXT: .functype bitselect_v16i8 (v128, v128, v128) -> (v128){{$}}
80 ; SIMD128-NEXT: v128.bitselect $push[[R:[0-9]+]]=, $0, $1, $2{{$}}
81 ; SIMD128-NEXT: return $pop[[R]]{{$}}
82 declare <16 x i8> @llvm.wasm.bitselect.v16i8(<16 x i8>, <16 x i8>, <16 x i8>)
83 define <16 x i8> @bitselect_v16i8(<16 x i8> %v1, <16 x i8> %v2, <16 x i8> %c) {
84 %a = call <16 x i8> @llvm.wasm.bitselect.v16i8(
85 <16 x i8> %v1, <16 x i8> %v2, <16 x i8> %c
90 ; CHECK-LABEL: narrow_signed_v16i8:
91 ; SIMD128-NEXT: .functype narrow_signed_v16i8 (v128, v128) -> (v128){{$}}
92 ; SIMD128-NEXT: i8x16.narrow_i16x8_s $push[[R:[0-9]+]]=, $0, $1{{$}}
93 ; SIMD128-NEXT: return $pop[[R]]{{$}}
94 declare <16 x i8> @llvm.wasm.narrow.signed.v16i8.v8i16(<8 x i16>, <8 x i16>)
95 define <16 x i8> @narrow_signed_v16i8(<8 x i16> %low, <8 x i16> %high) {
96 %a = call <16 x i8> @llvm.wasm.narrow.signed.v16i8.v8i16(
97 <8 x i16> %low, <8 x i16> %high
102 ; CHECK-LABEL: narrow_unsigned_v16i8:
103 ; SIMD128-NEXT: .functype narrow_unsigned_v16i8 (v128, v128) -> (v128){{$}}
104 ; SIMD128-NEXT: i8x16.narrow_i16x8_u $push[[R:[0-9]+]]=, $0, $1{{$}}
105 ; SIMD128-NEXT: return $pop[[R]]{{$}}
106 declare <16 x i8> @llvm.wasm.narrow.unsigned.v16i8.v8i16(<8 x i16>, <8 x i16>)
107 define <16 x i8> @narrow_unsigned_v16i8(<8 x i16> %low, <8 x i16> %high) {
108 %a = call <16 x i8> @llvm.wasm.narrow.unsigned.v16i8.v8i16(
109 <8 x i16> %low, <8 x i16> %high
114 ; ==============================================================================
116 ; ==============================================================================
117 ; CHECK-LABEL: add_sat_s_v8i16:
118 ; SIMD128-NEXT: .functype add_sat_s_v8i16 (v128, v128) -> (v128){{$}}
119 ; SIMD128-NEXT: i16x8.add_saturate_s $push[[R:[0-9]+]]=, $0, $1{{$}}
120 ; SIMD128-NEXT: return $pop[[R]]{{$}}
121 declare <8 x i16> @llvm.sadd.sat.v8i16(<8 x i16>, <8 x i16>)
122 define <8 x i16> @add_sat_s_v8i16(<8 x i16> %x, <8 x i16> %y) {
123 %a = call <8 x i16> @llvm.sadd.sat.v8i16(<8 x i16> %x, <8 x i16> %y)
127 ; CHECK-LABEL: add_sat_u_v8i16:
128 ; SIMD128-NEXT: .functype add_sat_u_v8i16 (v128, v128) -> (v128){{$}}
129 ; SIMD128-NEXT: i16x8.add_saturate_u $push[[R:[0-9]+]]=, $0, $1{{$}}
130 ; SIMD128-NEXT: return $pop[[R]]{{$}}
131 declare <8 x i16> @llvm.uadd.sat.v8i16(<8 x i16>, <8 x i16>)
132 define <8 x i16> @add_sat_u_v8i16(<8 x i16> %x, <8 x i16> %y) {
133 %a = call <8 x i16> @llvm.uadd.sat.v8i16(<8 x i16> %x, <8 x i16> %y)
137 ; CHECK-LABEL: sub_sat_s_v8i16:
138 ; SIMD128-NEXT: .functype sub_sat_s_v8i16 (v128, v128) -> (v128){{$}}
139 ; SIMD128-NEXT: i16x8.sub_saturate_s $push[[R:[0-9]+]]=, $0, $1{{$}}
140 ; SIMD128-NEXT: return $pop[[R]]{{$}}
141 declare <8 x i16> @llvm.wasm.sub.saturate.signed.v8i16(<8 x i16>, <8 x i16>)
142 define <8 x i16> @sub_sat_s_v8i16(<8 x i16> %x, <8 x i16> %y) {
143 %a = call <8 x i16> @llvm.wasm.sub.saturate.signed.v8i16(
144 <8 x i16> %x, <8 x i16> %y
149 ; CHECK-LABEL: sub_sat_u_v8i16:
150 ; SIMD128-NEXT: .functype sub_sat_u_v8i16 (v128, v128) -> (v128){{$}}
151 ; SIMD128-NEXT: i16x8.sub_saturate_u $push[[R:[0-9]+]]=, $0, $1{{$}}
152 ; SIMD128-NEXT: return $pop[[R]]{{$}}
153 declare <8 x i16> @llvm.wasm.sub.saturate.unsigned.v8i16(<8 x i16>, <8 x i16>)
154 define <8 x i16> @sub_sat_u_v8i16(<8 x i16> %x, <8 x i16> %y) {
155 %a = call <8 x i16> @llvm.wasm.sub.saturate.unsigned.v8i16(
156 <8 x i16> %x, <8 x i16> %y
161 ; CHECK-LABEL: any_v8i16:
162 ; SIMD128-NEXT: .functype any_v8i16 (v128) -> (i32){{$}}
163 ; SIMD128-NEXT: i16x8.any_true $push[[R:[0-9]+]]=, $0{{$}}
164 ; SIMD128-NEXT: return $pop[[R]]{{$}}
165 declare i32 @llvm.wasm.anytrue.v8i16(<8 x i16>)
166 define i32 @any_v8i16(<8 x i16> %x) {
167 %a = call i32 @llvm.wasm.anytrue.v8i16(<8 x i16> %x)
171 ; CHECK-LABEL: all_v8i16:
172 ; SIMD128-NEXT: .functype all_v8i16 (v128) -> (i32){{$}}
173 ; SIMD128-NEXT: i16x8.all_true $push[[R:[0-9]+]]=, $0{{$}}
174 ; SIMD128-NEXT: return $pop[[R]]{{$}}
175 declare i32 @llvm.wasm.alltrue.v8i16(<8 x i16>)
176 define i32 @all_v8i16(<8 x i16> %x) {
177 %a = call i32 @llvm.wasm.alltrue.v8i16(<8 x i16> %x)
181 ; CHECK-LABEL: bitselect_v8i16:
182 ; SIMD128-NEXT: .functype bitselect_v8i16 (v128, v128, v128) -> (v128){{$}}
183 ; SIMD128-NEXT: v128.bitselect $push[[R:[0-9]+]]=, $0, $1, $2{{$}}
184 ; SIMD128-NEXT: return $pop[[R]]{{$}}
185 declare <8 x i16> @llvm.wasm.bitselect.v8i16(<8 x i16>, <8 x i16>, <8 x i16>)
186 define <8 x i16> @bitselect_v8i16(<8 x i16> %v1, <8 x i16> %v2, <8 x i16> %c) {
187 %a = call <8 x i16> @llvm.wasm.bitselect.v8i16(
188 <8 x i16> %v1, <8 x i16> %v2, <8 x i16> %c
193 ; CHECK-LABEL: narrow_signed_v8i16:
194 ; SIMD128-NEXT: .functype narrow_signed_v8i16 (v128, v128) -> (v128){{$}}
195 ; SIMD128-NEXT: i16x8.narrow_i32x4_s $push[[R:[0-9]+]]=, $0, $1{{$}}
196 ; SIMD128-NEXT: return $pop[[R]]{{$}}
197 declare <8 x i16> @llvm.wasm.narrow.signed.v8i16.v4i32(<4 x i32>, <4 x i32>)
198 define <8 x i16> @narrow_signed_v8i16(<4 x i32> %low, <4 x i32> %high) {
199 %a = call <8 x i16> @llvm.wasm.narrow.signed.v8i16.v4i32(
200 <4 x i32> %low, <4 x i32> %high
205 ; CHECK-LABEL: narrow_unsigned_v8i16:
206 ; SIMD128-NEXT: .functype narrow_unsigned_v8i16 (v128, v128) -> (v128){{$}}
207 ; SIMD128-NEXT: i16x8.narrow_i32x4_u $push[[R:[0-9]+]]=, $0, $1{{$}}
208 ; SIMD128-NEXT: return $pop[[R]]{{$}}
209 declare <8 x i16> @llvm.wasm.narrow.unsigned.v8i16.v4i32(<4 x i32>, <4 x i32>)
210 define <8 x i16> @narrow_unsigned_v8i16(<4 x i32> %low, <4 x i32> %high) {
211 %a = call <8 x i16> @llvm.wasm.narrow.unsigned.v8i16.v4i32(
212 <4 x i32> %low, <4 x i32> %high
217 ; CHECK-LABEL: widen_low_signed_v8i16:
218 ; SIMD128-NEXT: .functype widen_low_signed_v8i16 (v128) -> (v128){{$}}
219 ; SIMD128-NEXT: i16x8.widen_low_i8x16_s $push[[R:[0-9]+]]=, $0{{$}}
220 ; SIMD128-NEXT: return $pop[[R]]{{$}}
221 declare <8 x i16> @llvm.wasm.widen.low.signed.v8i16.v16i8(<16 x i8>)
222 define <8 x i16> @widen_low_signed_v8i16(<16 x i8> %v) {
223 %a = call <8 x i16> @llvm.wasm.widen.low.signed.v8i16.v16i8(<16 x i8> %v)
227 ; CHECK-LABEL: widen_high_signed_v8i16:
228 ; SIMD128-NEXT: .functype widen_high_signed_v8i16 (v128) -> (v128){{$}}
229 ; SIMD128-NEXT: i16x8.widen_high_i8x16_s $push[[R:[0-9]+]]=, $0{{$}}
230 ; SIMD128-NEXT: return $pop[[R]]{{$}}
231 declare <8 x i16> @llvm.wasm.widen.high.signed.v8i16.v16i8(<16 x i8>)
232 define <8 x i16> @widen_high_signed_v8i16(<16 x i8> %v) {
233 %a = call <8 x i16> @llvm.wasm.widen.high.signed.v8i16.v16i8(<16 x i8> %v)
237 ; CHECK-LABEL: widen_low_unsigned_v8i16:
238 ; SIMD128-NEXT: .functype widen_low_unsigned_v8i16 (v128) -> (v128){{$}}
239 ; SIMD128-NEXT: i16x8.widen_low_i8x16_u $push[[R:[0-9]+]]=, $0{{$}}
240 ; SIMD128-NEXT: return $pop[[R]]{{$}}
241 declare <8 x i16> @llvm.wasm.widen.low.unsigned.v8i16.v16i8(<16 x i8>)
242 define <8 x i16> @widen_low_unsigned_v8i16(<16 x i8> %v) {
243 %a = call <8 x i16> @llvm.wasm.widen.low.unsigned.v8i16.v16i8(<16 x i8> %v)
247 ; CHECK-LABEL: widen_high_unsigned_v8i16:
248 ; SIMD128-NEXT: .functype widen_high_unsigned_v8i16 (v128) -> (v128){{$}}
249 ; SIMD128-NEXT: i16x8.widen_high_i8x16_u $push[[R:[0-9]+]]=, $0{{$}}
250 ; SIMD128-NEXT: return $pop[[R]]{{$}}
251 declare <8 x i16> @llvm.wasm.widen.high.unsigned.v8i16.v16i8(<16 x i8>)
252 define <8 x i16> @widen_high_unsigned_v8i16(<16 x i8> %v) {
253 %a = call <8 x i16> @llvm.wasm.widen.high.unsigned.v8i16.v16i8(<16 x i8> %v)
257 ; ==============================================================================
259 ; ==============================================================================
260 ; CHECK-LABEL: any_v4i32:
261 ; SIMD128-NEXT: .functype any_v4i32 (v128) -> (i32){{$}}
262 ; SIMD128-NEXT: i32x4.any_true $push[[R:[0-9]+]]=, $0{{$}}
263 ; SIMD128-NEXT: return $pop[[R]]{{$}}
264 declare i32 @llvm.wasm.anytrue.v4i32(<4 x i32>)
265 define i32 @any_v4i32(<4 x i32> %x) {
266 %a = call i32 @llvm.wasm.anytrue.v4i32(<4 x i32> %x)
270 ; CHECK-LABEL: all_v4i32:
271 ; SIMD128-NEXT: .functype all_v4i32 (v128) -> (i32){{$}}
272 ; SIMD128-NEXT: i32x4.all_true $push[[R:[0-9]+]]=, $0{{$}}
273 ; SIMD128-NEXT: return $pop[[R]]{{$}}
274 declare i32 @llvm.wasm.alltrue.v4i32(<4 x i32>)
275 define i32 @all_v4i32(<4 x i32> %x) {
276 %a = call i32 @llvm.wasm.alltrue.v4i32(<4 x i32> %x)
280 ; CHECK-LABEL: bitselect_v4i32:
281 ; SIMD128-NEXT: .functype bitselect_v4i32 (v128, v128, v128) -> (v128){{$}}
282 ; SIMD128-NEXT: v128.bitselect $push[[R:[0-9]+]]=, $0, $1, $2{{$}}
283 ; SIMD128-NEXT: return $pop[[R]]{{$}}
284 declare <4 x i32> @llvm.wasm.bitselect.v4i32(<4 x i32>, <4 x i32>, <4 x i32>)
285 define <4 x i32> @bitselect_v4i32(<4 x i32> %v1, <4 x i32> %v2, <4 x i32> %c) {
286 %a = call <4 x i32> @llvm.wasm.bitselect.v4i32(
287 <4 x i32> %v1, <4 x i32> %v2, <4 x i32> %c
292 ; CHECK-LABEL: trunc_sat_s_v4i32:
293 ; NO-SIMD128-NOT: f32x4
294 ; SIMD128-NEXT: .functype trunc_sat_s_v4i32 (v128) -> (v128){{$}}
295 ; SIMD128-NEXT: i32x4.trunc_sat_f32x4_s $push[[R:[0-9]+]]=, $0
296 ; SIMD128-NEXT: return $pop[[R]]
297 declare <4 x i32> @llvm.wasm.trunc.saturate.signed.v4i32.v4f32(<4 x float>)
298 define <4 x i32> @trunc_sat_s_v4i32(<4 x float> %x) {
299 %a = call <4 x i32> @llvm.wasm.trunc.saturate.signed.v4i32.v4f32(<4 x float> %x)
303 ; CHECK-LABEL: trunc_sat_u_v4i32:
304 ; NO-SIMD128-NOT: f32x4
305 ; SIMD128-NEXT: .functype trunc_sat_u_v4i32 (v128) -> (v128){{$}}
306 ; SIMD128-NEXT: i32x4.trunc_sat_f32x4_u $push[[R:[0-9]+]]=, $0
307 ; SIMD128-NEXT: return $pop[[R]]
308 declare <4 x i32> @llvm.wasm.trunc.saturate.unsigned.v4i32.v4f32(<4 x float>)
309 define <4 x i32> @trunc_sat_u_v4i32(<4 x float> %x) {
310 %a = call <4 x i32> @llvm.wasm.trunc.saturate.unsigned.v4i32.v4f32(<4 x float> %x)
314 ; CHECK-LABEL: widen_low_signed_v4i32:
315 ; SIMD128-NEXT: .functype widen_low_signed_v4i32 (v128) -> (v128){{$}}
316 ; SIMD128-NEXT: i32x4.widen_low_i16x8_s $push[[R:[0-9]+]]=, $0{{$}}
317 ; SIMD128-NEXT: return $pop[[R]]{{$}}
318 declare <4 x i32> @llvm.wasm.widen.low.signed.v4i32.v8i16(<8 x i16>)
319 define <4 x i32> @widen_low_signed_v4i32(<8 x i16> %v) {
320 %a = call <4 x i32> @llvm.wasm.widen.low.signed.v4i32.v8i16(<8 x i16> %v)
324 ; CHECK-LABEL: widen_high_signed_v4i32:
325 ; SIMD128-NEXT: .functype widen_high_signed_v4i32 (v128) -> (v128){{$}}
326 ; SIMD128-NEXT: i32x4.widen_high_i16x8_s $push[[R:[0-9]+]]=, $0{{$}}
327 ; SIMD128-NEXT: return $pop[[R]]{{$}}
328 declare <4 x i32> @llvm.wasm.widen.high.signed.v4i32.v8i16(<8 x i16>)
329 define <4 x i32> @widen_high_signed_v4i32(<8 x i16> %v) {
330 %a = call <4 x i32> @llvm.wasm.widen.high.signed.v4i32.v8i16(<8 x i16> %v)
334 ; CHECK-LABEL: widen_low_unsigned_v4i32:
335 ; SIMD128-NEXT: .functype widen_low_unsigned_v4i32 (v128) -> (v128){{$}}
336 ; SIMD128-NEXT: i32x4.widen_low_i16x8_u $push[[R:[0-9]+]]=, $0{{$}}
337 ; SIMD128-NEXT: return $pop[[R]]{{$}}
338 declare <4 x i32> @llvm.wasm.widen.low.unsigned.v4i32.v8i16(<8 x i16>)
339 define <4 x i32> @widen_low_unsigned_v4i32(<8 x i16> %v) {
340 %a = call <4 x i32> @llvm.wasm.widen.low.unsigned.v4i32.v8i16(<8 x i16> %v)
344 ; CHECK-LABEL: widen_high_unsigned_v4i32:
345 ; SIMD128-NEXT: .functype widen_high_unsigned_v4i32 (v128) -> (v128){{$}}
346 ; SIMD128-NEXT: i32x4.widen_high_i16x8_u $push[[R:[0-9]+]]=, $0{{$}}
347 ; SIMD128-NEXT: return $pop[[R]]{{$}}
348 declare <4 x i32> @llvm.wasm.widen.high.unsigned.v4i32.v8i16(<8 x i16>)
349 define <4 x i32> @widen_high_unsigned_v4i32(<8 x i16> %v) {
350 %a = call <4 x i32> @llvm.wasm.widen.high.unsigned.v4i32.v8i16(<8 x i16> %v)
354 ; ==============================================================================
356 ; ==============================================================================
357 ; CHECK-LABEL: any_v2i64:
358 ; SIMD128-NEXT: .functype any_v2i64 (v128) -> (i32){{$}}
359 ; SIMD128-NEXT: i64x2.any_true $push[[R:[0-9]+]]=, $0{{$}}
360 ; SIMD128-NEXT: return $pop[[R]]{{$}}
361 declare i32 @llvm.wasm.anytrue.v2i64(<2 x i64>)
362 define i32 @any_v2i64(<2 x i64> %x) {
363 %a = call i32 @llvm.wasm.anytrue.v2i64(<2 x i64> %x)
367 ; CHECK-LABEL: all_v2i64:
368 ; SIMD128-NEXT: .functype all_v2i64 (v128) -> (i32){{$}}
369 ; SIMD128-NEXT: i64x2.all_true $push[[R:[0-9]+]]=, $0{{$}}
370 ; SIMD128-NEXT: return $pop[[R]]{{$}}
371 declare i32 @llvm.wasm.alltrue.v2i64(<2 x i64>)
372 define i32 @all_v2i64(<2 x i64> %x) {
373 %a = call i32 @llvm.wasm.alltrue.v2i64(<2 x i64> %x)
377 ; CHECK-LABEL: bitselect_v2i64:
378 ; SIMD128-NEXT: .functype bitselect_v2i64 (v128, v128, v128) -> (v128){{$}}
379 ; SIMD128-NEXT: v128.bitselect $push[[R:[0-9]+]]=, $0, $1, $2{{$}}
380 ; SIMD128-NEXT: return $pop[[R]]{{$}}
381 declare <2 x i64> @llvm.wasm.bitselect.v2i64(<2 x i64>, <2 x i64>, <2 x i64>)
382 define <2 x i64> @bitselect_v2i64(<2 x i64> %v1, <2 x i64> %v2, <2 x i64> %c) {
383 %a = call <2 x i64> @llvm.wasm.bitselect.v2i64(
384 <2 x i64> %v1, <2 x i64> %v2, <2 x i64> %c
389 ; CHECK-LABEL: trunc_sat_s_v2i64:
390 ; NO-SIMD128-NOT: f32x4
391 ; SIMD128-NEXT: .functype trunc_sat_s_v2i64 (v128) -> (v128){{$}}
392 ; SIMD128-NEXT: i64x2.trunc_sat_f64x2_s $push[[R:[0-9]+]]=, $0
393 ; SIMD128-NEXT: return $pop[[R]]
394 declare <2 x i64> @llvm.wasm.trunc.saturate.signed.v2i64.v2f64(<2 x double>)
395 define <2 x i64> @trunc_sat_s_v2i64(<2 x double> %x) {
396 %a = call <2 x i64> @llvm.wasm.trunc.saturate.signed.v2i64.v2f64(<2 x double> %x)
400 ; CHECK-LABEL: trunc_sat_u_v2i64:
401 ; NO-SIMD128-NOT: f32x4
402 ; SIMD128-NEXT: .functype trunc_sat_u_v2i64 (v128) -> (v128){{$}}
403 ; SIMD128-NEXT: i64x2.trunc_sat_f64x2_u $push[[R:[0-9]+]]=, $0
404 ; SIMD128-NEXT: return $pop[[R]]
405 declare <2 x i64> @llvm.wasm.trunc.saturate.unsigned.v2i64.v2f64(<2 x double>)
406 define <2 x i64> @trunc_sat_u_v2i64(<2 x double> %x) {
407 %a = call <2 x i64> @llvm.wasm.trunc.saturate.unsigned.v2i64.v2f64(<2 x double> %x)
411 ; ==============================================================================
413 ; ==============================================================================
414 ; CHECK-LABEL: bitselect_v4f32:
415 ; SIMD128-NEXT: .functype bitselect_v4f32 (v128, v128, v128) -> (v128){{$}}
416 ; SIMD128-NEXT: v128.bitselect $push[[R:[0-9]+]]=, $0, $1, $2{{$}}
417 ; SIMD128-NEXT: return $pop[[R]]{{$}}
418 declare <4 x float> @llvm.wasm.bitselect.v4f32(<4 x float>, <4 x float>, <4 x float>)
419 define <4 x float> @bitselect_v4f32(<4 x float> %v1, <4 x float> %v2, <4 x float> %c) {
420 %a = call <4 x float> @llvm.wasm.bitselect.v4f32(
421 <4 x float> %v1, <4 x float> %v2, <4 x float> %c
426 ; CHECK-LABEL: qfma_v4f32:
427 ; SIMD128-NEXT: .functype qfma_v4f32 (v128, v128, v128) -> (v128){{$}}
428 ; SIMD128-NEXT: f32x4.qfma $push[[R:[0-9]+]]=, $0, $1, $2{{$}}
429 ; SIMD128-NEXT: return $pop[[R]]{{$}}
430 declare <4 x float> @llvm.wasm.qfma.v4f32(<4 x float>, <4 x float>, <4 x float>)
431 define <4 x float> @qfma_v4f32(<4 x float> %a, <4 x float> %b, <4 x float> %c) {
432 %v = call <4 x float> @llvm.wasm.qfma.v4f32(
433 <4 x float> %a, <4 x float> %b, <4 x float> %c
438 ; CHECK-LABEL: qfms_v4f32:
439 ; SIMD128-NEXT: .functype qfms_v4f32 (v128, v128, v128) -> (v128){{$}}
440 ; SIMD128-NEXT: f32x4.qfms $push[[R:[0-9]+]]=, $0, $1, $2{{$}}
441 ; SIMD128-NEXT: return $pop[[R]]{{$}}
442 declare <4 x float> @llvm.wasm.qfms.v4f32(<4 x float>, <4 x float>, <4 x float>)
443 define <4 x float> @qfms_v4f32(<4 x float> %a, <4 x float> %b, <4 x float> %c) {
444 %v = call <4 x float> @llvm.wasm.qfms.v4f32(
445 <4 x float> %a, <4 x float> %b, <4 x float> %c
450 ; ==============================================================================
452 ; ==============================================================================
453 ; CHECK-LABEL: bitselect_v2f64:
454 ; SIMD128-NEXT: .functype bitselect_v2f64 (v128, v128, v128) -> (v128){{$}}
455 ; SIMD128-NEXT: v128.bitselect $push[[R:[0-9]+]]=, $0, $1, $2{{$}}
456 ; SIMD128-NEXT: return $pop[[R]]{{$}}
457 declare <2 x double> @llvm.wasm.bitselect.v2f64(<2 x double>, <2 x double>, <2 x double>)
458 define <2 x double> @bitselect_v2f64(<2 x double> %v1, <2 x double> %v2, <2 x double> %c) {
459 %a = call <2 x double> @llvm.wasm.bitselect.v2f64(
460 <2 x double> %v1, <2 x double> %v2, <2 x double> %c
465 ; CHECK-LABEL: qfma_v2f64:
466 ; SIMD128-NEXT: .functype qfma_v2f64 (v128, v128, v128) -> (v128){{$}}
467 ; SIMD128-NEXT: f64x2.qfma $push[[R:[0-9]+]]=, $0, $1, $2{{$}}
468 ; SIMD128-NEXT: return $pop[[R]]{{$}}
469 declare <2 x double> @llvm.wasm.qfma.v2f64(<2 x double>, <2 x double>, <2 x double>)
470 define <2 x double> @qfma_v2f64(<2 x double> %a, <2 x double> %b, <2 x double> %c) {
471 %v = call <2 x double> @llvm.wasm.qfma.v2f64(
472 <2 x double> %a, <2 x double> %b, <2 x double> %c
477 ; CHECK-LABEL: qfms_v2f64:
478 ; SIMD128-NEXT: .functype qfms_v2f64 (v128, v128, v128) -> (v128){{$}}
479 ; SIMD128-NEXT: f64x2.qfms $push[[R:[0-9]+]]=, $0, $1, $2{{$}}
480 ; SIMD128-NEXT: return $pop[[R]]{{$}}
481 declare <2 x double> @llvm.wasm.qfms.v2f64(<2 x double>, <2 x double>, <2 x double>)
482 define <2 x double> @qfms_v2f64(<2 x double> %a, <2 x double> %b, <2 x double> %c) {
483 %v = call <2 x double> @llvm.wasm.qfms.v2f64(
484 <2 x double> %a, <2 x double> %b, <2 x double> %c