Debian Codegraph @

clang/test/CodeGen/builtins-wasm.c

raw
1 // RUN: %clang_cc1 -triple wasm32-unknown-unknown -target-feature +reference-types -target-feature +simd128 -target-feature +relaxed-simd -target-feature +nontrapping-fptoint -target-feature +exception-handling -target-feature +bulk-memory -target-feature +atomics -target-feature +half-precision -flax-vector-conversions=none -O3 -emit-llvm -o - %s | FileCheck %s -check-prefixes WEBASSEMBLY,WEBASSEMBLY32
2 // RUN: %clang_cc1 -triple wasm64-unknown-unknown -target-feature +reference-types -target-feature +simd128 -target-feature +relaxed-simd -target-feature +nontrapping-fptoint -target-feature +exception-handling -target-feature +bulk-memory -target-feature +atomics -target-feature +half-precision -flax-vector-conversions=none -O3 -emit-llvm -o - %s | FileCheck %s -check-prefixes WEBASSEMBLY,WEBASSEMBLY64
3 // RUN: not %clang_cc1 -triple wasm64-unknown-unknown -target-feature +reference-types -target-feature +nontrapping-fptoint -target-feature +exception-handling -target-feature +bulk-memory -target-feature +atomics -flax-vector-conversions=none -O3 -emit-llvm -o - %s 2>&1 | FileCheck %s -check-prefixes MISSING-SIMD
4
5 // SIMD convenience types
6 typedef signed char i8x16 __attribute((vector_size(16)));
7 typedef short i16x8 __attribute((vector_size(16)));
8 typedef int i32x4 __attribute((vector_size(16)));
9 typedef long long i64x2 __attribute((vector_size(16)));
10 typedef unsigned char u8x16 __attribute((vector_size(16)));
11 typedef unsigned short u16x8 __attribute((vector_size(16)));
12 typedef unsigned int u32x4 __attribute((vector_size(16)));
13 typedef unsigned long long u64x2 __attribute((vector_size(16)));
14 typedef __fp16 f16x8 __attribute((vector_size(16)));
15 typedef float f32x4 __attribute((vector_size(16)));
16 typedef double f64x2 __attribute((vector_size(16)));
17
18 __SIZE_TYPE__ memory_size(void) {
19 return __builtin_wasm_memory_size(0);
20 // WEBASSEMBLY32: call {{i.*}} @llvm.wasm.memory.size.i32(i32 0)
21 // WEBASSEMBLY64: call {{i.*}} @llvm.wasm.memory.size.i64(i32 0)
22 }
23
24 __SIZE_TYPE__ memory_grow(__SIZE_TYPE__ delta) {
25 return __builtin_wasm_memory_grow(0, delta);
26 // WEBASSEMBLY32: call i32 @llvm.wasm.memory.grow.i32(i32 0, i32 %{{.*}})
27 // WEBASSEMBLY64: call i64 @llvm.wasm.memory.grow.i64(i32 0, i64 %{{.*}})
28 }
29
30 __SIZE_TYPE__ tls_size(void) {
31 return __builtin_wasm_tls_size();
32 // WEBASSEMBLY32: call i32 @llvm.wasm.tls.size.i32()
33 // WEBASSEMBLY64: call i64 @llvm.wasm.tls.size.i64()
34 }
35
36 __SIZE_TYPE__ tls_align(void) {
37 return __builtin_wasm_tls_align();
38 // WEBASSEMBLY32: call i32 @llvm.wasm.tls.align.i32()
39 // WEBASSEMBLY64: call i64 @llvm.wasm.tls.align.i64()
40 }
41
42 void *tls_base(void) {
43 return __builtin_wasm_tls_base();
44 // WEBASSEMBLY: call ptr @llvm.wasm.tls.base()
45 }
46
47 void throw(void *obj) {
48 return __builtin_wasm_throw(0, obj);
49 // WEBASSEMBLY: call void @llvm.wasm.throw(i32 0, ptr %{{.*}})
50 }
51
52 void rethrow(void) {
53 return __builtin_wasm_rethrow();
54 // WEBASSEMBLY32: call void @llvm.wasm.rethrow()
55 // WEBASSEMBLY64: call void @llvm.wasm.rethrow()
56 }
57
58 int memory_atomic_wait32(int *addr, int expected, long long timeout) {
59 return __builtin_wasm_memory_atomic_wait32(addr, expected, timeout);
60 // WEBASSEMBLY: call i32 @llvm.wasm.memory.atomic.wait32(ptr %{{.*}}, i32 %{{.*}}, i64 %{{.*}})
61 }
62
63 int memory_atomic_wait64(long long *addr, long long expected, long long timeout) {
64 return __builtin_wasm_memory_atomic_wait64(addr, expected, timeout);
65 // WEBASSEMBLY: call i32 @llvm.wasm.memory.atomic.wait64(ptr %{{.*}}, i64 %{{.*}}, i64 %{{.*}})
66 }
67
68 unsigned int memory_atomic_notify(int *addr, unsigned int count) {
69 return __builtin_wasm_memory_atomic_notify(addr, count);
70 // WEBASSEMBLY: call i32 @llvm.wasm.memory.atomic.notify(ptr %{{.*}}, i32 %{{.*}})
71 }
72
73 int trunc_s_i32_f32(float f) {
74 return __builtin_wasm_trunc_s_i32_f32(f);
75 // WEBASSEMBLY: call i32 @llvm.wasm.trunc.signed.i32.f32(float %f)
76 // WEBASSEMBLY-NEXT: ret
77 }
78
79 int trunc_u_i32_f32(float f) {
80 return __builtin_wasm_trunc_u_i32_f32(f);
81 // WEBASSEMBLY: call i32 @llvm.wasm.trunc.unsigned.i32.f32(float %f)
82 // WEBASSEMBLY-NEXT: ret
83 }
84
85 int trunc_s_i32_f64(double f) {
86 return __builtin_wasm_trunc_s_i32_f64(f);
87 // WEBASSEMBLY: call i32 @llvm.wasm.trunc.signed.i32.f64(double %f)
88 // WEBASSEMBLY-NEXT: ret
89 }
90
91 int trunc_u_i32_f64(double f) {
92 return __builtin_wasm_trunc_u_i32_f64(f);
93 // WEBASSEMBLY: call i32 @llvm.wasm.trunc.unsigned.i32.f64(double %f)
94 // WEBASSEMBLY-NEXT: ret
95 }
96
97 long long trunc_s_i64_f32(float f) {
98 return __builtin_wasm_trunc_s_i64_f32(f);
99 // WEBASSEMBLY: call i64 @llvm.wasm.trunc.signed.i64.f32(float %f)
100 // WEBASSEMBLY-NEXT: ret
101 }
102
103 long long trunc_u_i64_f32(float f) {
104 return __builtin_wasm_trunc_u_i64_f32(f);
105 // WEBASSEMBLY: call i64 @llvm.wasm.trunc.unsigned.i64.f32(float %f)
106 // WEBASSEMBLY-NEXT: ret
107 }
108
109 long long trunc_s_i64_f64(double f) {
110 return __builtin_wasm_trunc_s_i64_f64(f);
111 // WEBASSEMBLY: call i64 @llvm.wasm.trunc.signed.i64.f64(double %f)
112 // WEBASSEMBLY-NEXT: ret
113 }
114
115 long long trunc_u_i64_f64(double f) {
116 return __builtin_wasm_trunc_u_i64_f64(f);
117 // WEBASSEMBLY: call i64 @llvm.wasm.trunc.unsigned.i64.f64(double %f)
118 // WEBASSEMBLY-NEXT: ret
119 }
120
121 int trunc_saturate_s_i32_f32(float f) {
122 return __builtin_wasm_trunc_saturate_s_i32_f32(f);
123 // WEBASSEMBLY: call i32 @llvm.fptosi.sat.i32.f32(float %f)
124 // WEBASSEMBLY-NEXT: ret
125 }
126
127 int trunc_saturate_u_i32_f32(float f) {
128 return __builtin_wasm_trunc_saturate_u_i32_f32(f);
129 // WEBASSEMBLY: call i32 @llvm.fptoui.sat.i32.f32(float %f)
130 // WEBASSEMBLY-NEXT: ret
131 }
132
133 int trunc_saturate_s_i32_f64(double f) {
134 return __builtin_wasm_trunc_saturate_s_i32_f64(f);
135 // WEBASSEMBLY: call i32 @llvm.fptosi.sat.i32.f64(double %f)
136 // WEBASSEMBLY-NEXT: ret
137 }
138
139 int trunc_saturate_u_i32_f64(double f) {
140 return __builtin_wasm_trunc_saturate_u_i32_f64(f);
141 // WEBASSEMBLY: call i32 @llvm.fptoui.sat.i32.f64(double %f)
142 // WEBASSEMBLY-NEXT: ret
143 }
144
145 long long trunc_saturate_s_i64_f32(float f) {
146 return __builtin_wasm_trunc_saturate_s_i64_f32(f);
147 // WEBASSEMBLY: call i64 @llvm.fptosi.sat.i64.f32(float %f)
148 // WEBASSEMBLY-NEXT: ret
149 }
150
151 long long trunc_saturate_u_i64_f32(float f) {
152 return __builtin_wasm_trunc_saturate_u_i64_f32(f);
153 // WEBASSEMBLY: call i64 @llvm.fptoui.sat.i64.f32(float %f)
154 // WEBASSEMBLY-NEXT: ret
155 }
156
157 long long trunc_saturate_s_i64_f64(double f) {
158 return __builtin_wasm_trunc_saturate_s_i64_f64(f);
159 // WEBASSEMBLY: call i64 @llvm.fptosi.sat.i64.f64(double %f)
160 // WEBASSEMBLY-NEXT: ret
161 }
162
163 long long trunc_saturate_u_i64_f64(double f) {
164 return __builtin_wasm_trunc_saturate_u_i64_f64(f);
165 // WEBASSEMBLY: call i64 @llvm.fptoui.sat.i64.f64(double %f)
166 // WEBASSEMBLY-NEXT: ret
167 }
168
169 float min_f32(float x, float y) {
170 return __builtin_wasm_min_f32(x, y);
171 // WEBASSEMBLY: call float @llvm.minimum.f32(float %x, float %y)
172 // WEBASSEMBLY-NEXT: ret
173 }
174
175 float max_f32(float x, float y) {
176 return __builtin_wasm_max_f32(x, y);
177 // WEBASSEMBLY: call float @llvm.maximum.f32(float %x, float %y)
178 // WEBASSEMBLY-NEXT: ret
179 }
180
181 double min_f64(double x, double y) {
182 return __builtin_wasm_min_f64(x, y);
183 // WEBASSEMBLY: call double @llvm.minimum.f64(double %x, double %y)
184 // WEBASSEMBLY-NEXT: ret
185 }
186
187 double max_f64(double x, double y) {
188 return __builtin_wasm_max_f64(x, y);
189 // WEBASSEMBLY: call double @llvm.maximum.f64(double %x, double %y)
190 // WEBASSEMBLY-NEXT: ret
191 }
192
193 i8x16 add_sat_s_i8x16(i8x16 x, i8x16 y) {
194 return __builtin_wasm_add_sat_s_i8x16(x, y);
195 // MISSING-SIMD: error: '__builtin_wasm_add_sat_s_i8x16' needs target feature simd128
196 // WEBASSEMBLY: call <16 x i8> @llvm.sadd.sat.v16i8(
197 // WEBASSEMBLY-SAME: <16 x i8> %x, <16 x i8> %y)
198 // WEBASSEMBLY-NEXT: ret
199 }
200
201 u8x16 add_sat_u_i8x16(u8x16 x, u8x16 y) {
202 return __builtin_wasm_add_sat_u_i8x16(x, y);
203 // WEBASSEMBLY: call <16 x i8> @llvm.uadd.sat.v16i8(
204 // WEBASSEMBLY-SAME: <16 x i8> %x, <16 x i8> %y)
205 // WEBASSEMBLY-NEXT: ret
206 }
207
208 i16x8 add_sat_s_i16x8(i16x8 x, i16x8 y) {
209 return __builtin_wasm_add_sat_s_i16x8(x, y);
210 // WEBASSEMBLY: call <8 x i16> @llvm.sadd.sat.v8i16(
211 // WEBASSEMBLY-SAME: <8 x i16> %x, <8 x i16> %y)
212 // WEBASSEMBLY-NEXT: ret
213 }
214
215 u16x8 add_sat_u_i16x8(u16x8 x, u16x8 y) {
216 return __builtin_wasm_add_sat_u_i16x8(x, y);
217 // WEBASSEMBLY: call <8 x i16> @llvm.uadd.sat.v8i16(
218 // WEBASSEMBLY-SAME: <8 x i16> %x, <8 x i16> %y)
219 // WEBASSEMBLY-NEXT: ret
220 }
221
222 i8x16 sub_sat_s_i8x16(i8x16 x, i8x16 y) {
223 return __builtin_wasm_sub_sat_s_i8x16(x, y);
224 // WEBASSEMBLY: call <16 x i8> @llvm.wasm.sub.sat.signed.v16i8(
225 // WEBASSEMBLY-SAME: <16 x i8> %x, <16 x i8> %y)
226 // WEBASSEMBLY-NEXT: ret
227 }
228
229 u8x16 sub_sat_u_i8x16(u8x16 x, u8x16 y) {
230 return __builtin_wasm_sub_sat_u_i8x16(x, y);
231 // WEBASSEMBLY: call <16 x i8> @llvm.wasm.sub.sat.unsigned.v16i8(
232 // WEBASSEMBLY-SAME: <16 x i8> %x, <16 x i8> %y)
233 // WEBASSEMBLY-NEXT: ret
234 }
235
236 i8x16 abs_i8x16(i8x16 v) {
237 return __builtin_wasm_abs_i8x16(v);
238 // WEBASSEMBLY: call <16 x i8> @llvm.abs.v16i8(<16 x i8> %v, i1 false)
239 // WEBASSEMBLY-NEXT: ret
240 }
241
242 i16x8 abs_i16x8(i16x8 v) {
243 return __builtin_wasm_abs_i16x8(v);
244 // WEBASSEMBLY: call <8 x i16> @llvm.abs.v8i16(<8 x i16> %v, i1 false)
245 // WEBASSEMBLY-NEXT: ret
246 }
247
248 i32x4 abs_i32x4(i32x4 v) {
249 return __builtin_wasm_abs_i32x4(v);
250 // WEBASSEMBLY: call <4 x i32> @llvm.abs.v4i32(<4 x i32> %v, i1 false)
251 // WEBASSEMBLY-NEXT: ret
252 }
253
254 i64x2 abs_i64x2(i64x2 v) {
255 return __builtin_wasm_abs_i64x2(v);
256 // WEBASSEMBLY: call <2 x i64> @llvm.abs.v2i64(<2 x i64> %v, i1 false)
257 // WEBASSEMBLY-NEXT: ret
258 }
259
260 i8x16 min_s_i8x16(i8x16 x, i8x16 y) {
261 return __builtin_wasm_min_s_i8x16(x, y);
262 // WEBASSEMBLY: call <16 x i8> @llvm.smin.v16i8(<16 x i8> %x, <16 x i8> %y)
263 // WEBASSEMBLY-NEXT: ret
264 }
265
266 u8x16 min_u_i8x16(u8x16 x, u8x16 y) {
267 return __builtin_wasm_min_u_i8x16(x, y);
268 // WEBASSEMBLY: call <16 x i8> @llvm.umin.v16i8(<16 x i8> %x, <16 x i8> %y)
269 // WEBASSEMBLY-NEXT: ret
270 }
271
272 i8x16 max_s_i8x16(i8x16 x, i8x16 y) {
273 return __builtin_wasm_max_s_i8x16(x, y);
274 // WEBASSEMBLY: call <16 x i8> @llvm.smax.v16i8(<16 x i8> %x, <16 x i8> %y)
275 // WEBASSEMBLY-NEXT: ret
276 }
277
278 u8x16 max_u_i8x16(u8x16 x, u8x16 y) {
279 return __builtin_wasm_max_u_i8x16(x, y);
280 // WEBASSEMBLY: call <16 x i8> @llvm.umax.v16i8(<16 x i8> %x, <16 x i8> %y)
281 // WEBASSEMBLY-NEXT: ret
282 }
283
284 i16x8 min_s_i16x8(i16x8 x, i16x8 y) {
285 return __builtin_wasm_min_s_i16x8(x, y);
286 // WEBASSEMBLY: call <8 x i16> @llvm.smin.v8i16(<8 x i16> %x, <8 x i16> %y)
287 // WEBASSEMBLY-NEXT: ret
288 }
289
290 u16x8 min_u_i16x8(u16x8 x, u16x8 y) {
291 return __builtin_wasm_min_u_i16x8(x, y);
292 // WEBASSEMBLY: call <8 x i16> @llvm.umin.v8i16(<8 x i16> %x, <8 x i16> %y)
293 // WEBASSEMBLY-NEXT: ret
294 }
295
296 i16x8 max_s_i16x8(i16x8 x, i16x8 y) {
297 return __builtin_wasm_max_s_i16x8(x, y);
298 // WEBASSEMBLY: call <8 x i16> @llvm.smax.v8i16(<8 x i16> %x, <8 x i16> %y)
299 // WEBASSEMBLY-NEXT: ret
300 }
301
302 u16x8 max_u_i16x8(u16x8 x, u16x8 y) {
303 return __builtin_wasm_max_u_i16x8(x, y);
304 // WEBASSEMBLY: call <8 x i16> @llvm.umax.v8i16(<8 x i16> %x, <8 x i16> %y)
305 // WEBASSEMBLY-NEXT: ret
306 }
307
308 i32x4 min_s_i32x4(i32x4 x, i32x4 y) {
309 return __builtin_wasm_min_s_i32x4(x, y);
310 // WEBASSEMBLY: call <4 x i32> @llvm.smin.v4i32(<4 x i32> %x, <4 x i32> %y)
311 // WEBASSEMBLY-NEXT: ret
312 }
313
314 u32x4 min_u_i32x4(u32x4 x, u32x4 y) {
315 return __builtin_wasm_min_u_i32x4(x, y);
316 // WEBASSEMBLY: call <4 x i32> @llvm.umin.v4i32(<4 x i32> %x, <4 x i32> %y)
317 // WEBASSEMBLY-NEXT: ret
318 }
319
320 i32x4 max_s_i32x4(i32x4 x, i32x4 y) {
321 return __builtin_wasm_max_s_i32x4(x, y);
322 // WEBASSEMBLY: call <4 x i32> @llvm.smax.v4i32(<4 x i32> %x, <4 x i32> %y)
323 // WEBASSEMBLY-NEXT: ret
324 }
325
326 u32x4 max_u_i32x4(u32x4 x, u32x4 y) {
327 return __builtin_wasm_max_u_i32x4(x, y);
328 // WEBASSEMBLY: call <4 x i32> @llvm.umax.v4i32(<4 x i32> %x, <4 x i32> %y)
329 // WEBASSEMBLY-NEXT: ret
330 }
331
332 i16x8 sub_sat_s_i16x8(i16x8 x, i16x8 y) {
333 return __builtin_wasm_sub_sat_s_i16x8(x, y);
334 // WEBASSEMBLY: call <8 x i16> @llvm.wasm.sub.sat.signed.v8i16(
335 // WEBASSEMBLY-SAME: <8 x i16> %x, <8 x i16> %y)
336 // WEBASSEMBLY-NEXT: ret
337 }
338
339 u16x8 sub_sat_u_i16x8(u16x8 x, u16x8 y) {
340 return __builtin_wasm_sub_sat_u_i16x8(x, y);
341 // WEBASSEMBLY: call <8 x i16> @llvm.wasm.sub.sat.unsigned.v8i16(
342 // WEBASSEMBLY-SAME: <8 x i16> %x, <8 x i16> %y)
343 // WEBASSEMBLY-NEXT: ret
344 }
345
346 u8x16 avgr_u_i8x16(u8x16 x, u8x16 y) {
347 return __builtin_wasm_avgr_u_i8x16(x, y);
348 // WEBASSEMBLY: call <16 x i8> @llvm.wasm.avgr.unsigned.v16i8(
349 // WEBASSEMBLY-SAME: <16 x i8> %x, <16 x i8> %y)
350 // WEBASSEMBLY-NEXT: ret
351 }
352
353 u16x8 avgr_u_i16x8(u16x8 x, u16x8 y) {
354 return __builtin_wasm_avgr_u_i16x8(x, y);
355 // WEBASSEMBLY: call <8 x i16> @llvm.wasm.avgr.unsigned.v8i16(
356 // WEBASSEMBLY-SAME: <8 x i16> %x, <8 x i16> %y)
357 // WEBASSEMBLY-NEXT: ret
358 }
359
360 i16x8 q15mulr_sat_s_i16x8(i16x8 x, i16x8 y) {
361 return __builtin_wasm_q15mulr_sat_s_i16x8(x, y);
362 // WEBASSEMBLY: call <8 x i16> @llvm.wasm.q15mulr.sat.signed(
363 // WEBASSEMBLY-SAME: <8 x i16> %x, <8 x i16> %y)
364 // WEBASSEMBLY-NEXT: ret
365 }
366
367 i16x8 extadd_pairwise_i8x16_s_i16x8(i8x16 v) {
368 return __builtin_wasm_extadd_pairwise_i8x16_s_i16x8(v);
369 // WEBASSEMBLY: call <8 x i16> @llvm.wasm.extadd.pairwise.signed.v8i16(
370 // WEBASSEMBLY-SAME: <16 x i8> %v)
371 // WEBASSEMBLY-NEXT: ret
372 }
373
374 u16x8 extadd_pairwise_i8x16_u_i16x8(u8x16 v) {
375 return __builtin_wasm_extadd_pairwise_i8x16_u_i16x8(v);
376 // WEBASSEMBLY: call <8 x i16> @llvm.wasm.extadd.pairwise.unsigned.v8i16(
377 // WEBASSEMBLY-SAME: <16 x i8> %v)
378 // WEBASSEMBLY-NEXT: ret
379 }
380
381 i32x4 extadd_pairwise_i16x8_s_i32x4(i16x8 v) {
382 return __builtin_wasm_extadd_pairwise_i16x8_s_i32x4(v);
383 // WEBASSEMBLY: call <4 x i32> @llvm.wasm.extadd.pairwise.signed.v4i32(
384 // WEBASSEMBLY-SAME: <8 x i16> %v)
385 // WEBASSEMBLY-NEXT: ret
386 }
387
388 u32x4 extadd_pairwise_i16x8_u_i32x4(u16x8 v) {
389 return __builtin_wasm_extadd_pairwise_i16x8_u_i32x4(v);
390 // WEBASSEMBLY: call <4 x i32> @llvm.wasm.extadd.pairwise.unsigned.v4i32(
391 // WEBASSEMBLY-SAME: <8 x i16> %v)
392 // WEBASSEMBLY-NEXT: ret
393 }
394
395 i32x4 dot_i16x8_s(i16x8 x, i16x8 y) {
396 return __builtin_wasm_dot_s_i32x4_i16x8(x, y);
397 // WEBASSEMBLY: call <4 x i32> @llvm.wasm.dot(<8 x i16> %x, <8 x i16> %y)
398 // WEBASSEMBLY-NEXT: ret
399 }
400
401 i32x4 bitselect(i32x4 x, i32x4 y, i32x4 c) {
402 return __builtin_wasm_bitselect(x, y, c);
403 // WEBASSEMBLY: call <4 x i32> @llvm.wasm.bitselect.v4i32(
404 // WEBASSEMBLY-SAME: <4 x i32> %x, <4 x i32> %y, <4 x i32> %c)
405 // WEBASSEMBLY-NEXT: ret
406 }
407
408 i8x16 popcnt(i8x16 x) {
409 return __builtin_wasm_popcnt_i8x16(x);
410 // WEBASSEMBLY: call range(i8 0, 9) <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %x)
411 // WEBASSEMBLY-NEXT: ret
412 }
413
414 int any_true_v128(i8x16 x) {
415 return __builtin_wasm_any_true_v128(x);
416 // WEBASSEMBLY: call i32 @llvm.wasm.anytrue.v16i8(<16 x i8> %x)
417 // WEBASSEMBLY: ret
418 }
419
420 int all_true_i8x16(i8x16 x) {
421 return __builtin_wasm_all_true_i8x16(x);
422 // WEBASSEMBLY: call i32 @llvm.wasm.alltrue.v16i8(<16 x i8> %x)
423 // WEBASSEMBLY: ret
424 }
425
426 int all_true_i16x8(i16x8 x) {
427 return __builtin_wasm_all_true_i16x8(x);
428 // WEBASSEMBLY: call i32 @llvm.wasm.alltrue.v8i16(<8 x i16> %x)
429 // WEBASSEMBLY: ret
430 }
431
432 int all_true_i32x4(i32x4 x) {
433 return __builtin_wasm_all_true_i32x4(x);
434 // WEBASSEMBLY: call i32 @llvm.wasm.alltrue.v4i32(<4 x i32> %x)
435 // WEBASSEMBLY: ret
436 }
437
438 int all_true_i64x2(i64x2 x) {
439 return __builtin_wasm_all_true_i64x2(x);
440 // WEBASSEMBLY: call i32 @llvm.wasm.alltrue.v2i64(<2 x i64> %x)
441 // WEBASSEMBLY: ret
442 }
443
444 int bitmask_i8x16(i8x16 x) {
445 return __builtin_wasm_bitmask_i8x16(x);
446 // WEBASSEMBLY: call i32 @llvm.wasm.bitmask.v16i8(<16 x i8> %x)
447 // WEBASSEMBLY: ret
448 }
449
450 int bitmask_i16x8(i16x8 x) {
451 return __builtin_wasm_bitmask_i16x8(x);
452 // WEBASSEMBLY: call i32 @llvm.wasm.bitmask.v8i16(<8 x i16> %x)
453 // WEBASSEMBLY: ret
454 }
455
456 int bitmask_i32x4(i32x4 x) {
457 return __builtin_wasm_bitmask_i32x4(x);
458 // WEBASSEMBLY: call i32 @llvm.wasm.bitmask.v4i32(<4 x i32> %x)
459 // WEBASSEMBLY: ret
460 }
461
462 int bitmask_i64x2(i64x2 x) {
463 return __builtin_wasm_bitmask_i64x2(x);
464 // WEBASSEMBLY: call i32 @llvm.wasm.bitmask.v2i64(<2 x i64> %x)
465 // WEBASSEMBLY: ret
466 }
467
468 f32x4 abs_f32x4(f32x4 x) {
469 return __builtin_wasm_abs_f32x4(x);
470 // WEBASSEMBLY: call <4 x float> @llvm.fabs.v4f32(<4 x float> %x)
471 // WEBASSEMBLY: ret
472 }
473
474 f64x2 abs_f64x2(f64x2 x) {
475 return __builtin_wasm_abs_f64x2(x);
476 // WEBASSEMBLY: call <2 x double> @llvm.fabs.v2f64(<2 x double> %x)
477 // WEBASSEMBLY: ret
478 }
479
480 f32x4 min_f32x4(f32x4 x, f32x4 y) {
481 return __builtin_wasm_min_f32x4(x, y);
482 // WEBASSEMBLY: call <4 x float> @llvm.minimum.v4f32(
483 // WEBASSEMBLY-SAME: <4 x float> %x, <4 x float> %y)
484 // WEBASSEMBLY-NEXT: ret
485 }
486
487 f32x4 max_f32x4(f32x4 x, f32x4 y) {
488 return __builtin_wasm_max_f32x4(x, y);
489 // WEBASSEMBLY: call <4 x float> @llvm.maximum.v4f32(
490 // WEBASSEMBLY-SAME: <4 x float> %x, <4 x float> %y)
491 // WEBASSEMBLY-NEXT: ret
492 }
493
494 f32x4 pmin_f32x4(f32x4 x, f32x4 y) {
495 return __builtin_wasm_pmin_f32x4(x, y);
496 // WEBASSEMBLY: call <4 x float> @llvm.wasm.pmin.v4f32(
497 // WEBASSEMBLY-SAME: <4 x float> %x, <4 x float> %y)
498 // WEBASSEMBLY-NEXT: ret
499 }
500
501 f32x4 pmax_f32x4(f32x4 x, f32x4 y) {
502 return __builtin_wasm_pmax_f32x4(x, y);
503 // WEBASSEMBLY: call <4 x float> @llvm.wasm.pmax.v4f32(
504 // WEBASSEMBLY-SAME: <4 x float> %x, <4 x float> %y)
505 // WEBASSEMBLY-NEXT: ret
506 }
507
508 f64x2 min_f64x2(f64x2 x, f64x2 y) {
509 return __builtin_wasm_min_f64x2(x, y);
510 // WEBASSEMBLY: call <2 x double> @llvm.minimum.v2f64(
511 // WEBASSEMBLY-SAME: <2 x double> %x, <2 x double> %y)
512 // WEBASSEMBLY-NEXT: ret
513 }
514
515 f64x2 max_f64x2(f64x2 x, f64x2 y) {
516 return __builtin_wasm_max_f64x2(x, y);
517 // WEBASSEMBLY: call <2 x double> @llvm.maximum.v2f64(
518 // WEBASSEMBLY-SAME: <2 x double> %x, <2 x double> %y)
519 // WEBASSEMBLY-NEXT: ret
520 }
521
522 f64x2 pmin_f64x2(f64x2 x, f64x2 y) {
523 return __builtin_wasm_pmin_f64x2(x, y);
524 // WEBASSEMBLY: call <2 x double> @llvm.wasm.pmin.v2f64(
525 // WEBASSEMBLY-SAME: <2 x double> %x, <2 x double> %y)
526 // WEBASSEMBLY-NEXT: ret
527 }
528
529 f64x2 pmax_f64x2(f64x2 x, f64x2 y) {
530 return __builtin_wasm_pmax_f64x2(x, y);
531 // WEBASSEMBLY: call <2 x double> @llvm.wasm.pmax.v2f64(
532 // WEBASSEMBLY-SAME: <2 x double> %x, <2 x double> %y)
533 // WEBASSEMBLY-NEXT: ret
534 }
535
536 f32x4 ceil_f32x4(f32x4 x) {
537 return __builtin_wasm_ceil_f32x4(x);
538 // WEBASSEMBLY: call <4 x float> @llvm.ceil.v4f32(<4 x float> %x)
539 // WEBASSEMBLY: ret
540 }
541
542 f32x4 floor_f32x4(f32x4 x) {
543 return __builtin_wasm_floor_f32x4(x);
544 // WEBASSEMBLY: call <4 x float> @llvm.floor.v4f32(<4 x float> %x)
545 // WEBASSEMBLY: ret
546 }
547
548 f32x4 trunc_f32x4(f32x4 x) {
549 return __builtin_wasm_trunc_f32x4(x);
550 // WEBASSEMBLY: call <4 x float> @llvm.trunc.v4f32(<4 x float> %x)
551 // WEBASSEMBLY: ret
552 }
553
554 f32x4 nearest_f32x4(f32x4 x) {
555 return __builtin_wasm_nearest_f32x4(x);
556 // WEBASSEMBLY: call <4 x float> @llvm.nearbyint.v4f32(<4 x float> %x)
557 // WEBASSEMBLY: ret
558 }
559
560 f64x2 ceil_f64x2(f64x2 x) {
561 return __builtin_wasm_ceil_f64x2(x);
562 // WEBASSEMBLY: call <2 x double> @llvm.ceil.v2f64(<2 x double> %x)
563 // WEBASSEMBLY: ret
564 }
565
566 f64x2 floor_f64x2(f64x2 x) {
567 return __builtin_wasm_floor_f64x2(x);
568 // WEBASSEMBLY: call <2 x double> @llvm.floor.v2f64(<2 x double> %x)
569 // WEBASSEMBLY: ret
570 }
571
572 f64x2 trunc_f64x2(f64x2 x) {
573 return __builtin_wasm_trunc_f64x2(x);
574 // WEBASSEMBLY: call <2 x double> @llvm.trunc.v2f64(<2 x double> %x)
575 // WEBASSEMBLY: ret
576 }
577
578 f64x2 nearest_f64x2(f64x2 x) {
579 return __builtin_wasm_nearest_f64x2(x);
580 // WEBASSEMBLY: call <2 x double> @llvm.nearbyint.v2f64(<2 x double> %x)
581 // WEBASSEMBLY: ret
582 }
583
584 f32x4 sqrt_f32x4(f32x4 x) {
585 return __builtin_wasm_sqrt_f32x4(x);
586 // WEBASSEMBLY: call <4 x float> @llvm.sqrt.v4f32(<4 x float> %x)
587 // WEBASSEMBLY: ret
588 }
589
590 f64x2 sqrt_f64x2(f64x2 x) {
591 return __builtin_wasm_sqrt_f64x2(x);
592 // WEBASSEMBLY: call <2 x double> @llvm.sqrt.v2f64(<2 x double> %x)
593 // WEBASSEMBLY: ret
594 }
595
596 i32x4 trunc_saturate_s_i32x4_f32x4(f32x4 f) {
597 return __builtin_wasm_trunc_saturate_s_i32x4_f32x4(f);
598 // WEBASSEMBLY: call <4 x i32> @llvm.fptosi.sat.v4i32.v4f32(<4 x float> %f)
599 // WEBASSEMBLY-NEXT: ret
600 }
601
602 i32x4 trunc_saturate_u_i32x4_f32x4(f32x4 f) {
603 return __builtin_wasm_trunc_saturate_u_i32x4_f32x4(f);
604 // WEBASSEMBLY: call <4 x i32> @llvm.fptoui.sat.v4i32.v4f32(<4 x float> %f)
605 // WEBASSEMBLY-NEXT: ret
606 }
607
608 i8x16 narrow_s_i8x16_i16x8(i16x8 low, i16x8 high) {
609 return __builtin_wasm_narrow_s_i8x16_i16x8(low, high);
610 // WEBASSEMBLY: call <16 x i8> @llvm.wasm.narrow.signed.v16i8.v8i16(
611 // WEBASSEMBLY-SAME: <8 x i16> %low, <8 x i16> %high)
612 // WEBASSEMBLY: ret
613 }
614
615 u8x16 narrow_u_i8x16_i16x8(i16x8 low, i16x8 high) {
616 return __builtin_wasm_narrow_u_i8x16_i16x8(low, high);
617 // WEBASSEMBLY: call <16 x i8> @llvm.wasm.narrow.unsigned.v16i8.v8i16(
618 // WEBASSEMBLY-SAME: <8 x i16> %low, <8 x i16> %high)
619 // WEBASSEMBLY: ret
620 }
621
622 i16x8 narrow_s_i16x8_i32x4(i32x4 low, i32x4 high) {
623 return __builtin_wasm_narrow_s_i16x8_i32x4(low, high);
624 // WEBASSEMBLY: call <8 x i16> @llvm.wasm.narrow.signed.v8i16.v4i32(
625 // WEBASSEMBLY-SAME: <4 x i32> %low, <4 x i32> %high)
626 // WEBASSEMBLY: ret
627 }
628
629 u16x8 narrow_u_i16x8_i32x4(i32x4 low, i32x4 high) {
630 return __builtin_wasm_narrow_u_i16x8_i32x4(low, high);
631 // WEBASSEMBLY: call <8 x i16> @llvm.wasm.narrow.unsigned.v8i16.v4i32(
632 // WEBASSEMBLY-SAME: <4 x i32> %low, <4 x i32> %high)
633 // WEBASSEMBLY: ret
634 }
635
636 i32x4 trunc_sat_s_zero_f64x2_i32x4(f64x2 x) {
637 return __builtin_wasm_trunc_sat_s_zero_f64x2_i32x4(x);
638 // WEBASSEMBLY: %0 = tail call <2 x i32> @llvm.fptosi.sat.v2i32.v2f64(<2 x double> %x)
639 // WEBASSEMBLY: %1 = shufflevector <2 x i32> %0, <2 x i32> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
640 // WEBASSEMBLY: ret <4 x i32> %1
641 }
642
643 u32x4 trunc_sat_u_zero_f64x2_i32x4(f64x2 x) {
644 return __builtin_wasm_trunc_sat_u_zero_f64x2_i32x4(x);
645 // WEBASSEMBLY: %0 = tail call <2 x i32> @llvm.fptoui.sat.v2i32.v2f64(<2 x double> %x)
646 // WEBASSEMBLY: %1 = shufflevector <2 x i32> %0, <2 x i32> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
647 // WEBASSEMBLY: ret <4 x i32> %1
648 }
649
650 i8x16 swizzle_i8x16(i8x16 x, i8x16 y) {
651 return __builtin_wasm_swizzle_i8x16(x, y);
652 // WEBASSEMBLY: call <16 x i8> @llvm.wasm.swizzle(<16 x i8> %x, <16 x i8> %y)
653 }
654
655 i8x16 shuffle(i8x16 x, i8x16 y) {
656 return __builtin_wasm_shuffle_i8x16(x, y, 0, 1, 2, 3, 4, 5, 6, 7,
657 8, 9, 10, 11, 12, 13, 14, 15);
658 // WEBASSEMBLY: call <16 x i8> @llvm.wasm.shuffle(<16 x i8> %x, <16 x i8> %y,
659 // WEBASSEMBLY-SAME: i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7,
660 // WEBASSEMBLY-SAME: i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14,
661 // WEBASSEMBLY-SAME: i32 15
662 // WEBASSEMBLY-NEXT: ret
663 }
664
665 f32x4 madd_f32x4(f32x4 a, f32x4 b, f32x4 c) {
666 return __builtin_wasm_relaxed_madd_f32x4(a, b, c);
667 // WEBASSEMBLY: call <4 x float> @llvm.wasm.relaxed.madd.v4f32(
668 // WEBASSEMBLY-SAME: <4 x float> %a, <4 x float> %b, <4 x float> %c)
669 // WEBASSEMBLY-NEXT: ret
670 }
671
672 f32x4 nmadd_f32x4(f32x4 a, f32x4 b, f32x4 c) {
673 return __builtin_wasm_relaxed_nmadd_f32x4(a, b, c);
674 // WEBASSEMBLY: call <4 x float> @llvm.wasm.relaxed.nmadd.v4f32(
675 // WEBASSEMBLY-SAME: <4 x float> %a, <4 x float> %b, <4 x float> %c)
676 // WEBASSEMBLY-NEXT: ret
677 }
678
679 f64x2 madd_f64x2(f64x2 a, f64x2 b, f64x2 c) {
680 return __builtin_wasm_relaxed_madd_f64x2(a, b, c);
681 // WEBASSEMBLY: call <2 x double> @llvm.wasm.relaxed.madd.v2f64(
682 // WEBASSEMBLY-SAME: <2 x double> %a, <2 x double> %b, <2 x double> %c)
683 // WEBASSEMBLY-NEXT: ret
684 }
685
686 f64x2 nmadd_f64x2(f64x2 a, f64x2 b, f64x2 c) {
687 return __builtin_wasm_relaxed_nmadd_f64x2(a, b, c);
688 // WEBASSEMBLY: call <2 x double> @llvm.wasm.relaxed.nmadd.v2f64(
689 // WEBASSEMBLY-SAME: <2 x double> %a, <2 x double> %b, <2 x double> %c)
690 // WEBASSEMBLY-NEXT: ret
691 }
692
693 f16x8 madd_f16x8(f16x8 a, f16x8 b, f16x8 c) {
694 return __builtin_wasm_relaxed_madd_f16x8(a, b, c);
695 // WEBASSEMBLY: call <8 x half> @llvm.wasm.relaxed.madd.v8f16(
696 // WEBASSEMBLY-SAME: <8 x half> %a, <8 x half> %b, <8 x half> %c)
697 // WEBASSEMBLY-NEXT: ret
698 }
699
700 f16x8 nmadd_f16x8(f16x8 a, f16x8 b, f16x8 c) {
701 return __builtin_wasm_relaxed_nmadd_f16x8(a, b, c);
702 // WEBASSEMBLY: call <8 x half> @llvm.wasm.relaxed.nmadd.v8f16(
703 // WEBASSEMBLY-SAME: <8 x half> %a, <8 x half> %b, <8 x half> %c)
704 // WEBASSEMBLY-NEXT: ret
705 }
706
707 i8x16 laneselect_i8x16(i8x16 a, i8x16 b, i8x16 c) {
708 return __builtin_wasm_relaxed_laneselect_i8x16(a, b, c);
709 // WEBASSEMBLY: call <16 x i8> @llvm.wasm.relaxed.laneselect.v16i8(
710 // WEBASSEMBLY-SAME: <16 x i8> %a, <16 x i8> %b, <16 x i8> %c)
711 // WEBASSEMBLY-NEXT: ret
712 }
713
714 i16x8 laneselect_i16x8(i16x8 a, i16x8 b, i16x8 c) {
715 return __builtin_wasm_relaxed_laneselect_i16x8(a, b, c);
716 // WEBASSEMBLY: call <8 x i16> @llvm.wasm.relaxed.laneselect.v8i16(
717 // WEBASSEMBLY-SAME: <8 x i16> %a, <8 x i16> %b, <8 x i16> %c)
718 // WEBASSEMBLY-NEXT: ret
719 }
720
721 i32x4 laneselect_i32x4(i32x4 a, i32x4 b, i32x4 c) {
722 return __builtin_wasm_relaxed_laneselect_i32x4(a, b, c);
723 // WEBASSEMBLY: call <4 x i32> @llvm.wasm.relaxed.laneselect.v4i32(
724 // WEBASSEMBLY-SAME: <4 x i32> %a, <4 x i32> %b, <4 x i32> %c)
725 // WEBASSEMBLY-NEXT: ret
726 }
727
728 i64x2 laneselect_i64x2(i64x2 a, i64x2 b, i64x2 c) {
729 return __builtin_wasm_relaxed_laneselect_i64x2(a, b, c);
730 // WEBASSEMBLY: call <2 x i64> @llvm.wasm.relaxed.laneselect.v2i64(
731 // WEBASSEMBLY-SAME: <2 x i64> %a, <2 x i64> %b, <2 x i64> %c)
732 // WEBASSEMBLY-NEXT: ret
733 }
734
735 i8x16 relaxed_swizzle_i8x16(i8x16 x, i8x16 y) {
736 return __builtin_wasm_relaxed_swizzle_i8x16(x, y);
737 // WEBASSEMBLY: call <16 x i8> @llvm.wasm.relaxed.swizzle(<16 x i8> %x, <16 x i8> %y)
738 }
739
740 f32x4 relaxed_min_f32x4(f32x4 a, f32x4 b) {
741 return __builtin_wasm_relaxed_min_f32x4(a, b);
742 // WEBASSEMBLY: call <4 x float> @llvm.wasm.relaxed.min.v4f32(
743 // WEBASSEMBLY-SAME: <4 x float> %a, <4 x float> %b)
744 // WEBASSEMBLY-NEXT: ret
745 }
746
747 f32x4 relaxed_max_f32x4(f32x4 a, f32x4 b) {
748 return __builtin_wasm_relaxed_max_f32x4(a, b);
749 // WEBASSEMBLY: call <4 x float> @llvm.wasm.relaxed.max.v4f32(
750 // WEBASSEMBLY-SAME: <4 x float> %a, <4 x float> %b)
751 // WEBASSEMBLY-NEXT: ret
752 }
753
754 f64x2 relaxed_min_f64x2(f64x2 a, f64x2 b) {
755 return __builtin_wasm_relaxed_min_f64x2(a, b);
756 // WEBASSEMBLY: call <2 x double> @llvm.wasm.relaxed.min.v2f64(
757 // WEBASSEMBLY-SAME: <2 x double> %a, <2 x double> %b)
758 // WEBASSEMBLY-NEXT: ret
759 }
760
761 f64x2 relaxed_max_f64x2(f64x2 a, f64x2 b) {
762 return __builtin_wasm_relaxed_max_f64x2(a, b);
763 // WEBASSEMBLY: call <2 x double> @llvm.wasm.relaxed.max.v2f64(
764 // WEBASSEMBLY-SAME: <2 x double> %a, <2 x double> %b)
765 // WEBASSEMBLY-NEXT: ret
766 }
767
768 i32x4 relaxed_trunc_s_i32x4_f32x4(f32x4 f) {
769 return __builtin_wasm_relaxed_trunc_s_i32x4_f32x4(f);
770 // WEBASSEMBLY: call <4 x i32> @llvm.wasm.relaxed.trunc.signed(<4 x float> %f)
771 // WEBASSEMBLY-NEXT: ret
772 }
773
774 u32x4 relaxed_trunc_u_i32x4_f32x4(f32x4 f) {
775 return __builtin_wasm_relaxed_trunc_u_i32x4_f32x4(f);
776 // WEBASSEMBLY: call <4 x i32> @llvm.wasm.relaxed.trunc.unsigned(<4 x float> %f)
777 // WEBASSEMBLY-NEXT: ret
778 }
779
780 i32x4 relaxed_trunc_s_zero_i32x4_f64x2(f64x2 x) {
781 return __builtin_wasm_relaxed_trunc_s_zero_i32x4_f64x2(x);
782 // WEBASSEMBLY: call <4 x i32> @llvm.wasm.relaxed.trunc.signed.zero(<2 x double> %x)
783 // WEBASSEMBLY-NEXT: ret
784 }
785
786 u32x4 relaxed_trunc_u_zero_i32x4_f64x2(f64x2 x) {
787 return __builtin_wasm_relaxed_trunc_u_zero_i32x4_f64x2(x);
788 // WEBASSEMBLY: call <4 x i32> @llvm.wasm.relaxed.trunc.unsigned.zero(<2 x double> %x)
789 // WEBASSEMBLY-NEXT: ret
790 }
791
792 i16x8 relaxed_q15mulr_s_i16x8(i16x8 a, i16x8 b) {
793 return __builtin_wasm_relaxed_q15mulr_s_i16x8(a, b);
794 // WEBASSEMBLY: call <8 x i16> @llvm.wasm.relaxed.q15mulr.signed(
795 // WEBASSEMBLY-SAME: <8 x i16> %a, <8 x i16> %b)
796 // WEBASSEMBLY-NEXT: ret
797 }
798
799 i16x8 dot_i8x16_i7x16_s_i16x8(i8x16 a, i8x16 b) {
800 return __builtin_wasm_relaxed_dot_i8x16_i7x16_s_i16x8(a, b);
801 // WEBASSEMBLY: call <8 x i16> @llvm.wasm.relaxed.dot.i8x16.i7x16.signed(
802 // WEBASSEMBLY-SAME: <16 x i8> %a, <16 x i8> %b)
803 // WEBASSEMBLY-NEXT: ret
804 }
805
806 i32x4 dot_i8x16_i7x16_add_s_i32x4(i8x16 a, i8x16 b, i32x4 c) {
807 return __builtin_wasm_relaxed_dot_i8x16_i7x16_add_s_i32x4(a, b, c);
808 // WEBASSEMBLY: call <4 x i32> @llvm.wasm.relaxed.dot.i8x16.i7x16.add.signed(
809 // WEBASSEMBLY-SAME: <16 x i8> %a, <16 x i8> %b, <4 x i32> %c)
810 // WEBASSEMBLY-NEXT: ret
811 }
812
813 f32x4 relaxed_dot_bf16x8_add_f32_f32x4(u16x8 a, u16x8 b, f32x4 c) {
814 return __builtin_wasm_relaxed_dot_bf16x8_add_f32_f32x4(a, b, c);
815 // WEBASSEMBLY: call <4 x float> @llvm.wasm.relaxed.dot.bf16x8.add.f32
816 // WEBASSEMBLY-SAME: <8 x i16> %a, <8 x i16> %b, <4 x float> %c)
817 // WEBASSEMBLY-NEXT: ret
818 }
819
820 float load_f16_f32(__fp16 *addr) {
821 return __builtin_wasm_loadf16_f32(addr);
822 // WEBASSEMBLY: call float @llvm.wasm.loadf16.f32(ptr %{{.*}})
823 }
824
825 void store_f16_f32(float val, __fp16 *addr) {
826 return __builtin_wasm_storef16_f32(val, addr);
827 // WEBASSEMBLY: tail call void @llvm.wasm.storef16.f32(float %val, ptr %{{.*}})
828 // WEBASSEMBLY-NEXT: ret
829 }
830
831 f16x8 splat_f16x8(float a) {
832 // WEBASSEMBLY: %0 = tail call <8 x half> @llvm.wasm.splat.f16x8(float %a)
833 // WEBASSEMBLY-NEXT: ret <8 x half> %0
834 return __builtin_wasm_splat_f16x8(a);
835 }
836
837 float extract_lane_f16x8(f16x8 a, int i) {
838 // WEBASSEMBLY: %0 = tail call float @llvm.wasm.extract.lane.f16x8(<8 x half> %a, i32 %i)
839 // WEBASSEMBLY-NEXT: ret float %0
840 return __builtin_wasm_extract_lane_f16x8(a, i);
841 }
842
843 f16x8 min_f16x8(f16x8 a, f16x8 b) {
844 // WEBASSEMBLY: %0 = tail call <8 x half> @llvm.minimum.v8f16(<8 x half> %a, <8 x half> %b)
845 // WEBASSEMBLY-NEXT: ret <8 x half> %0
846 return __builtin_wasm_min_f16x8(a, b);
847 }
848
849 f16x8 max_f16x8(f16x8 a, f16x8 b) {
850 // WEBASSEMBLY: %0 = tail call <8 x half> @llvm.maximum.v8f16(<8 x half> %a, <8 x half> %b)
851 // WEBASSEMBLY-NEXT: ret <8 x half> %0
852 return __builtin_wasm_max_f16x8(a, b);
853 }
854
855 f16x8 pmin_f16x8(f16x8 a, f16x8 b) {
856 // WEBASSEMBLY: %0 = tail call <8 x half> @llvm.wasm.pmin.v8f16(<8 x half> %a, <8 x half> %b)
857 // WEBASSEMBLY-NEXT: ret <8 x half> %0
858 return __builtin_wasm_pmin_f16x8(a, b);
859 }
860
861 f16x8 pmax_f16x8(f16x8 a, f16x8 b) {
862 // WEBASSEMBLY: %0 = tail call <8 x half> @llvm.wasm.pmax.v8f16(<8 x half> %a, <8 x half> %b)
863 // WEBASSEMBLY-NEXT: ret <8 x half> %0
864 return __builtin_wasm_pmax_f16x8(a, b);
865 }
866 __externref_t externref_null() {
867 return __builtin_wasm_ref_null_extern();
868 // WEBASSEMBLY: tail call ptr addrspace(10) @llvm.wasm.ref.null.extern()
869 // WEBASSEMBLY-NEXT: ret
870 }