Skip to content

Commit ccb0498

Browse files
authored
[CIR][CIRGen][Builtin][X86] Lower masked expandload intrinsics (#1766)
1 parent b647f4b commit ccb0498

File tree

5 files changed

+299
-1
lines changed

5 files changed

+299
-1
lines changed

clang/lib/CIR/CodeGen/CIRGenBuiltinX86.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,22 @@ static mlir::Value emitX86MaskedLoad(CIRGenFunction &cgf,
118118
ops[1]);
119119
}
120120

121+
static mlir::Value emitX86ExpandLoad(CIRGenFunction &cgf,
122+
ArrayRef<mlir::Value> ops,
123+
mlir::Location loc) {
124+
auto resultTy = cast<cir::VectorType>(ops[1].getType());
125+
mlir::Value ptr = ops[0];
126+
127+
mlir::Value maskVec = getMaskVecValue(
128+
cgf, ops[2], cast<cir::VectorType>(resultTy).getSize(), loc);
129+
130+
return cgf.getBuilder()
131+
.create<cir::LLVMIntrinsicCallOp>(
132+
loc, cgf.getBuilder().getStringAttr("masked.expandload"), resultTy,
133+
mlir::ValueRange{ptr, maskVec, ops[1]})
134+
.getResult();
135+
}
136+
121137
static mlir::Value emitX86SExtMask(CIRGenFunction &cgf, mlir::Value op,
122138
mlir::Type dstTy, mlir::Location loc) {
123139
unsigned numberOfElements = cast<cir::VectorType>(dstTy).getSize();
@@ -644,7 +660,7 @@ mlir::Value CIRGenFunction::emitX86BuiltinExpr(unsigned BuiltinID,
644660
case X86::BI__builtin_ia32_expandloadqi128_mask:
645661
case X86::BI__builtin_ia32_expandloadqi256_mask:
646662
case X86::BI__builtin_ia32_expandloadqi512_mask:
647-
llvm_unreachable("vfmaddsubph256_round_mask3 NYI");
663+
return emitX86ExpandLoad(*this, Ops, getLoc(E->getExprLoc()));
648664

649665
case X86::BI__builtin_ia32_compressstoredf128_mask:
650666
case X86::BI__builtin_ia32_compressstoredf256_mask:

clang/test/CIR/CodeGen/X86/avx512f-builtins.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,39 @@ __m512i test_mm512_maskz_load_epi64(__mmask8 __U, void const *__P) {
250250
// LLVM: @llvm.masked.load.v8i64.p0(ptr %{{.*}}, i32 64, <8 x i1> %{{.*}}, <8 x i64> %{{.*}})
251251
return _mm512_maskz_load_epi64(__U, __P);
252252
}
253+
254+
__m512i test_mm512_mask_expandloadu_epi64(__m512i __W, __mmask8 __U, void const *__P) {
255+
// CIR-LABEL: _mm512_mask_expandloadu_epi64
256+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s64i x 8>>, !cir.vector<!cir.int<s, 1> x 8>, !cir.vector<!s64i x 8>) -> !cir.vector<!s64i x 8>
257+
258+
// LLVM-LABEL: test_mm512_mask_expandloadu_epi64
259+
// LLVM: @llvm.masked.expandload.v8i64(ptr %{{.*}}, <8 x i1> %{{.*}}, <8 x i64> %{{.*}})
260+
return _mm512_mask_expandloadu_epi64(__W, __U, __P);
261+
}
262+
263+
__m512i test_mm512_maskz_expandloadu_epi64(__mmask8 __U, void const *__P) {
264+
// CIR-LABEL: _mm512_maskz_expandloadu_epi64
265+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s64i x 8>>, !cir.vector<!cir.int<s, 1> x 8>, !cir.vector<!s64i x 8>) -> !cir.vector<!s64i x 8>
266+
267+
// LLVM-LABEL: test_mm512_maskz_expandloadu_epi64
268+
// LLVM: @llvm.masked.expandload.v8i64(ptr %{{.*}}, <8 x i1> %{{.*}}, <8 x i64> %{{.*}})
269+
return _mm512_maskz_expandloadu_epi64(__U, __P);
270+
}
271+
272+
__m512i test_mm512_mask_expandloadu_epi32(__m512i __W, __mmask16 __U, void const *__P) {
273+
// CIR-LABEL: _mm512_mask_expandloadu_epi32
274+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s32i x 16>>, !cir.vector<!cir.int<s, 1> x 16>, !cir.vector<!s32i x 16>) -> !cir.vector<!s32i x 16>
275+
276+
// LLVM-LABEL: test_mm512_mask_expandloadu_epi32
277+
// LLVM: @llvm.masked.expandload.v16i32(ptr %{{.*}}, <16 x i1> %{{.*}}, <16 x i32> %{{.*}})
278+
return _mm512_mask_expandloadu_epi32(__W, __U, __P);
279+
}
280+
281+
__m512i test_mm512_maskz_expandloadu_epi32(__mmask16 __U, void const *__P) {
282+
// CIR-LABEL: _mm512_maskz_expandloadu_epi32
283+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s32i x 16>>, !cir.vector<!cir.int<s, 1> x 16>, !cir.vector<!s32i x 16>) -> !cir.vector<!s32i x 16>
284+
285+
// LLVM-LABEL: test_mm512_maskz_expandloadu_epi32
286+
// LLVM: @llvm.masked.expandload.v16i32(ptr %{{.*}}, <16 x i1> %{{.*}}, <16 x i32> %{{.*}})
287+
return _mm512_maskz_expandloadu_epi32(__U, __P);
288+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx512vbmi2 -fclangir -emit-cir -o %t.cir -Wall -Werror -Wsign-conversion
2+
// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
3+
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx512vbmi2 -fclangir -emit-llvm -o %t.ll -Wall -Werror -Wsign-conversion
4+
// RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s
5+
6+
#include <immintrin.h>
7+
8+
__m512i test_mm512_mask_expandloadu_epi16(__m512i __S, __mmask32 __U, void const* __P) {
9+
// CIR-LABEL: _mm512_mask_expandloadu_epi16
10+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s16i x 32>>, !cir.vector<!cir.int<s, 1> x 32>, !cir.vector<!s16i x 32>) -> !cir.vector<!s16i x 32>
11+
12+
// LLVM-LABEL: @test_mm512_mask_expandloadu_epi16
13+
// LLVM: @llvm.masked.expandload.v32i16(ptr %{{.*}}, <32 x i1> %{{.*}}, <32 x i16> %{{.*}})
14+
return _mm512_mask_expandloadu_epi16(__S, __U, __P);
15+
}
16+
17+
__m512i test_mm512_maskz_expandloadu_epi16(__mmask32 __U, void const* __P) {
18+
// CIR-LABEL: _mm512_maskz_expandloadu_epi16
19+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s16i x 32>>, !cir.vector<!cir.int<s, 1> x 32>, !cir.vector<!s16i x 32>) -> !cir.vector<!s16i x 32>
20+
21+
// LLVM-LABEL: @test_mm512_maskz_expandloadu_epi16
22+
// LLVM: @llvm.masked.expandload.v32i16(ptr %{{.*}}, <32 x i1> %{{.*}}, <32 x i16> %{{.*}})
23+
return _mm512_maskz_expandloadu_epi16(__U, __P);
24+
}
25+
26+
__m512i test_mm512_mask_expandloadu_epi8(__m512i __S, __mmask64 __U, void const* __P) {
27+
// CIR-LABEL: _mm512_mask_expandloadu_epi8
28+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s8i x 64>>, !cir.vector<!cir.int<s, 1> x 64>, !cir.vector<!s8i x 64>) -> !cir.vector<!s8i x 64>
29+
30+
// LLVM-LABEL: @test_mm512_mask_expandloadu_epi8
31+
// LLVM: @llvm.masked.expandload.v64i8(ptr %{{.*}}, <64 x i1> %{{.*}}, <64 x i8> %{{.*}})
32+
return _mm512_mask_expandloadu_epi8(__S, __U, __P);
33+
}
34+
35+
__m512i test_mm512_maskz_expandloadu_epi8(__mmask64 __U, void const* __P) {
36+
// CIR-LABEL: _mm512_maskz_expandloadu_epi8
37+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s8i x 64>>, !cir.vector<!cir.int<s, 1> x 64>, !cir.vector<!s8i x 64>) -> !cir.vector<!s8i x 64>
38+
39+
// LLVM-LABEL: @test_mm512_maskz_expandloadu_epi8
40+
// LLVM: @llvm.masked.expandload.v64i8(ptr %{{.*}}, <64 x i1> %{{.*}}, <64 x i8> %{{.*}})
41+
return _mm512_maskz_expandloadu_epi8(__U, __P);
42+
}

clang/test/CIR/CodeGen/X86/avx512vl-builtins.c

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,3 +401,129 @@ __m256i test_mm256_maskz_load_epi64(__mmask8 __U, void const *__P) {
401401
// LLVM: @llvm.masked.load.v4i64.p0(ptr %{{.*}}, i32 32, <4 x i1> %{{.*}}, <4 x i64> %{{.*}})
402402
return _mm256_maskz_load_epi64(__U, __P);
403403
}
404+
405+
__m128d test_mm_mask_expandloadu_pd(__m128d __W, __mmask8 __U, void const *__P) {
406+
// CIR-LABEL: _mm_mask_expandloadu_pd
407+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!cir.double x 2>>, !cir.vector<!cir.int<s, 1> x 2>, !cir.vector<!cir.double x 2>) -> !cir.vector<!cir.double x 2>
408+
409+
// LLVM-LABEL: @test_mm_mask_expandloadu_pd
410+
// LLVM: @llvm.masked.expandload.v2f64(ptr %{{.*}}, <2 x i1> %{{.*}}, <2 x double> %{{.*}})
411+
return _mm_mask_expandloadu_pd(__W,__U,__P);
412+
}
413+
414+
__m128d test_mm_maskz_expandloadu_pd(__mmask8 __U, void const *__P) {
415+
// CIR-LABEL: _mm_maskz_expandloadu_pd
416+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %4, %8, %5 : (!cir.ptr<!cir.vector<!cir.double x 2>>, !cir.vector<!cir.int<s, 1> x 2>, !cir.vector<!cir.double x 2>) -> !cir.vector<!cir.double x 2>
417+
418+
// LLVM-LABEL: @test_mm_maskz_expandloadu_pd
419+
// LLVM: @llvm.masked.expandload.v2f64(ptr %{{.*}}, <2 x i1> %{{.*}}, <2 x double> %{{.*}})
420+
return _mm_maskz_expandloadu_pd(__U,__P);
421+
}
422+
423+
__m256d test_mm256_mask_expandloadu_pd(__m256d __W, __mmask8 __U, void const *__P) {
424+
// CIR-LABEL: _mm256_mask_expandloadu_pd
425+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!cir.double x 4>>, !cir.vector<!cir.int<s, 1> x 4>, !cir.vector<!cir.double x 4>) -> !cir.vector<!cir.double x 4>
426+
427+
// LLVM-LABEL: @test_mm256_mask_expandloadu_pd
428+
// LLVM: @llvm.masked.expandload.v4f64(ptr %{{.*}}, <4 x i1> %{{.*}}, <4 x double> %{{.*}})
429+
return _mm256_mask_expandloadu_pd(__W,__U,__P);
430+
}
431+
432+
__m256d test_mm256_maskz_expandloadu_pd(__mmask8 __U, void const *__P) {
433+
// CIR-LABEL: _mm256_maskz_expandloadu_pd
434+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!cir.double x 4>>, !cir.vector<!cir.int<s, 1> x 4>, !cir.vector<!cir.double x 4>) -> !cir.vector<!cir.double x 4>
435+
436+
// LLVM-LABEL: @test_mm256_maskz_expandloadu_pd
437+
// LLVM: @llvm.masked.expandload.v4f64(ptr %{{.*}}, <4 x i1> %{{.*}}, <4 x double> %{{.*}})
438+
return _mm256_maskz_expandloadu_pd(__U,__P);
439+
}
440+
441+
__m128 test_mm_mask_expandloadu_ps(__m128 __W, __mmask8 __U, void const *__P) {
442+
// CIR-LABEL: _mm_mask_expandloadu_ps
443+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!cir.float x 4>>, !cir.vector<!cir.int<s, 1> x 4>, !cir.vector<!cir.float x 4>) -> !cir.vector<!cir.float x 4>
444+
445+
// LLVM-LABEL: @test_mm_mask_expandloadu_ps
446+
// LLVM: @llvm.masked.expandload.v4f32(ptr %{{.*}}, <4 x i1> %{{.*}}, <4 x float> %{{.*}})
447+
return _mm_mask_expandloadu_ps(__W,__U,__P);
448+
}
449+
450+
__m128 test_mm_maskz_expandloadu_ps(__mmask8 __U, void const *__P) {
451+
// CIR-LABEL: _mm_maskz_expandloadu_ps
452+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!cir.float x 4>>, !cir.vector<!cir.int<s, 1> x 4>, !cir.vector<!cir.float x 4>) -> !cir.vector<!cir.float x 4>
453+
454+
// LLVM-LABEL: @test_mm_maskz_expandloadu_ps
455+
// LLVM: @llvm.masked.expandload.v4f32(ptr %{{.*}}, <4 x i1> %{{.*}}, <4 x float> %{{.*}})
456+
return _mm_maskz_expandloadu_ps(__U,__P);
457+
}
458+
459+
__m256 test_mm256_mask_expandloadu_ps(__m256 __W, __mmask8 __U, void const *__P) {
460+
// CIR-LABEL: _mm256_mask_expandloadu_ps
461+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!cir.float x 8>>, !cir.vector<!cir.int<s, 1> x 8>, !cir.vector<!cir.float x 8>) -> !cir.vector<!cir.float x 8>
462+
463+
// LLVM-LABEL: @test_mm256_mask_expandloadu_ps
464+
// LLVM: @llvm.masked.expandload.v8f32(ptr %{{.*}}, <8 x i1> %{{.*}}, <8 x float> %{{.*}})
465+
return _mm256_mask_expandloadu_ps(__W,__U,__P);
466+
}
467+
468+
__m256 test_mm256_maskz_expandloadu_ps(__mmask8 __U, void const *__P) {
469+
// CIR-LABEL: _mm256_maskz_expandloadu_ps
470+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!cir.float x 8>>, !cir.vector<!cir.int<s, 1> x 8>, !cir.vector<!cir.float x 8>) -> !cir.vector<!cir.float x 8>
471+
472+
// LLVM-LABEL: @test_mm256_maskz_expandloadu_ps
473+
// LLVM: @llvm.masked.expandload.v8f32(ptr %{{.*}}, <8 x i1> %{{.*}}, <8 x float> %{{.*}})
474+
return _mm256_maskz_expandloadu_ps(__U,__P);
475+
}
476+
477+
__m128i test_mm_mask_expandloadu_epi64(__m128i __W, __mmask8 __U, void const *__P) {
478+
// CIR-LABEL: _mm_mask_expandloadu_epi64
479+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s64i x 2>>, !cir.vector<!cir.int<s, 1> x 2>, !cir.vector<!s64i x 2>) -> !cir.vector<!s64i x 2>
480+
481+
// LLVM-LABEL: @test_mm_mask_expandloadu_epi64
482+
// LLVM: @llvm.masked.expandload.v2i64(ptr %{{.*}}, <2 x i1> %{{.*}}, <2 x i64> %{{.*}})
483+
return _mm_mask_expandloadu_epi64(__W,__U,__P);
484+
}
485+
486+
__m128i test_mm_maskz_expandloadu_epi64(__mmask8 __U, void const *__P) {
487+
// CIR-LABEL: _mm_maskz_expandloadu_epi64
488+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s64i x 2>>, !cir.vector<!cir.int<s, 1> x 2>, !cir.vector<!s64i x 2>) -> !cir.vector<!s64i x 2>
489+
490+
// LLVM-LABEL: @test_mm_maskz_expandloadu_epi64
491+
// LLVM: @llvm.masked.expandload.v2i64(ptr %{{.*}}, <2 x i1> %{{.*}}, <2 x i64> %{{.*}})
492+
return _mm_maskz_expandloadu_epi64(__U,__P);
493+
}
494+
495+
__m128i test_mm_mask_expandloadu_epi32(__m128i __W, __mmask8 __U, void const *__P) {
496+
// CIR-LABEL: _mm_mask_expandloadu_epi32
497+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s32i x 4>>, !cir.vector<!cir.int<s, 1> x 4>, !cir.vector<!s32i x 4>) -> !cir.vector<!s32i x 4>
498+
499+
// LLVM-LABEL: @test_mm_mask_expandloadu_epi32
500+
// LLVM: @llvm.masked.expandload.v4i32(ptr %{{.*}}, <4 x i1> %{{.*}}, <4 x i32> %{{.*}})
501+
return _mm_mask_expandloadu_epi32(__W,__U,__P);
502+
}
503+
504+
__m128i test_mm_maskz_expandloadu_epi32(__mmask8 __U, void const *__P) {
505+
// CIR-LABEL: _mm_maskz_expandloadu_epi32
506+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s32i x 4>>, !cir.vector<!cir.int<s, 1> x 4>, !cir.vector<!s32i x 4>) -> !cir.vector<!s32i x 4>
507+
508+
// LLVM-LABEL: @test_mm_maskz_expandloadu_epi32
509+
// LLVM: @llvm.masked.expandload.v4i32(ptr %{{.*}}, <4 x i1> %{{.*}}, <4 x i32> %{{.*}})
510+
return _mm_maskz_expandloadu_epi32(__U,__P);
511+
}
512+
513+
__m256i test_mm256_mask_expandloadu_epi32(__m256i __W, __mmask8 __U, void const *__P) {
514+
// CIR-LABEL: _mm256_mask_expandloadu_epi32
515+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s32i x 8>>, !cir.vector<!cir.int<s, 1> x 8>, !cir.vector<!s32i x 8>) -> !cir.vector<!s32i x 8>
516+
517+
// LLVM-LABEL: @test_mm256_mask_expandloadu_epi32
518+
// LLVM: @llvm.masked.expandload.v8i32(ptr %{{.*}}, <8 x i1> %{{.*}}, <8 x i32> %{{.*}})
519+
return _mm256_mask_expandloadu_epi32(__W,__U,__P);
520+
}
521+
522+
__m256i test_mm256_maskz_expandloadu_epi32(__mmask8 __U, void const *__P) {
523+
// CIR-LABEL: _mm256_maskz_expandloadu_epi32
524+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s32i x 8>>, !cir.vector<!cir.int<s, 1> x 8>, !cir.vector<!s32i x 8>) -> !cir.vector<!s32i x 8>
525+
526+
// LLVM-LABEL: @test_mm256_maskz_expandloadu_epi32
527+
// LLVM: @llvm.masked.expandload.v8i32(ptr %{{.*}}, <8 x i1> %{{.*}}, <8 x i32> %{{.*}})
528+
return _mm256_maskz_expandloadu_epi32(__U,__P);
529+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx512vl -target-feature +avx512vbmi2 -fclangir -emit-cir -o %t.cir -Wall -Werror -Wsign-conversion
2+
// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
3+
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx512vl -target-feature +avx512vbmi2 -fclangir -emit-llvm -o %t.ll -Wall -Werror -Wsign-conversion
4+
// RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s
5+
6+
#include <immintrin.h>
7+
8+
__m128i test_mm_mask_expandloadu_epi16(__m128i __S, __mmask8 __U, void const* __P) {
9+
// CIR-LABEL: _mm_mask_expandloadu_epi16
10+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s16i x 8>>, !cir.vector<!cir.int<s, 1> x 8>, !cir.vector<!s16i x 8>) -> !cir.vector<!s16i x 8>
11+
12+
// LLVM-LABEL: @test_mm_mask_expandloadu_epi16
13+
// LLVM: @llvm.masked.expandload.v8i16(ptr %{{.*}}, <8 x i1> %{{.*}}, <8 x i16> %{{.*}})
14+
return _mm_mask_expandloadu_epi16(__S, __U, __P);
15+
}
16+
17+
__m128i test_mm_maskz_expandloadu_epi16(__mmask8 __U, void const* __P) {
18+
// CIR-LABEL: _mm_maskz_expandloadu_epi16
19+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s16i x 8>>, !cir.vector<!cir.int<s, 1> x 8>, !cir.vector<!s16i x 8>) -> !cir.vector<!s16i x 8>
20+
21+
// LLVM-LABEL: @test_mm_maskz_expandloadu_epi16
22+
// LLVM: @llvm.masked.expandload.v8i16(ptr %{{.*}}, <8 x i1> %{{.*}}, <8 x i16> %{{.*}})
23+
return _mm_maskz_expandloadu_epi16(__U, __P);
24+
}
25+
26+
__m256i test_mm256_mask_expandloadu_epi16(__m256i __S, __mmask16 __U, void const* __P) {
27+
// CIR-LABEL: _mm256_mask_expandloadu_epi16
28+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s16i x 16>>, !cir.vector<!cir.int<s, 1> x 16>, !cir.vector<!s16i x 16>) -> !cir.vector<!s16i x 16>
29+
30+
// LLVM-LABEL: @test_mm256_mask_expandloadu_epi16
31+
// LLVM: @llvm.masked.expandload.v16i16(ptr %{{.*}}, <16 x i1> %{{.*}}, <16 x i16> %{{.*}})
32+
return _mm256_mask_expandloadu_epi16(__S, __U, __P);
33+
}
34+
35+
__m256i test_mm256_maskz_expandloadu_epi16(__mmask16 __U, void const* __P) {
36+
// CIR-LABEL: _mm256_maskz_expandloadu_epi16
37+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s16i x 16>>, !cir.vector<!cir.int<s, 1> x 16>, !cir.vector<!s16i x 16>) -> !cir.vector<!s16i x 16>
38+
39+
// LLVM-LABEL: @test_mm256_maskz_expandloadu_epi16
40+
// LLVM: @llvm.masked.expandload.v16i16(ptr %{{.*}}, <16 x i1> %{{.*}}, <16 x i16> %{{.*}})
41+
return _mm256_maskz_expandloadu_epi16(__U, __P);
42+
}
43+
44+
__m128i test_mm_mask_expandloadu_epi8(__m128i __S, __mmask16 __U, void const* __P) {
45+
// CIR-LABEL: _mm_mask_expandloadu_epi8
46+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s8i x 16>>, !cir.vector<!cir.int<s, 1> x 16>, !cir.vector<!s8i x 16>) -> !cir.vector<!s8i x 16>
47+
48+
// LLVM-LABEL: @test_mm_mask_expandloadu_epi8
49+
// LLVM: @llvm.masked.expandload.v16i8(ptr %{{.*}}, <16 x i1> %{{.*}}, <16 x i8> %{{.*}})
50+
return _mm_mask_expandloadu_epi8(__S, __U, __P);
51+
}
52+
53+
__m128i test_mm_maskz_expandloadu_epi8(__mmask16 __U, void const* __P) {
54+
// CIR-LABEL: _mm_maskz_expandloadu_epi8
55+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s8i x 16>>, !cir.vector<!cir.int<s, 1> x 16>, !cir.vector<!s8i x 16>) -> !cir.vector<!s8i x 16>
56+
57+
// LLVM-LABEL: @test_mm_maskz_expandloadu_epi8
58+
// LLVM: @llvm.masked.expandload.v16i8(ptr %{{.*}}, <16 x i1> %{{.*}}, <16 x i8> %{{.*}})
59+
return _mm_maskz_expandloadu_epi8(__U, __P);
60+
}
61+
62+
__m256i test_mm256_mask_expandloadu_epi8(__m256i __S, __mmask32 __U, void const* __P) {
63+
// CIR-LABEL: _mm256_mask_expandloadu_epi8
64+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s8i x 32>>, !cir.vector<!cir.int<s, 1> x 32>, !cir.vector<!s8i x 32>) -> !cir.vector<!s8i x 32>
65+
66+
// LLVM-LABEL: @test_mm256_mask_expandloadu_epi8
67+
// LLVM: @llvm.masked.expandload.v32i8(ptr %{{.*}}, <32 x i1> %{{.*}}, <32 x i8> %{{.*}})
68+
return _mm256_mask_expandloadu_epi8(__S, __U, __P);
69+
}
70+
71+
__m256i test_mm256_maskz_expandloadu_epi8(__mmask32 __U, void const* __P) {
72+
// CIR-LABEL: _mm256_maskz_expandloadu_epi8
73+
// CIR: %{{.*}} = cir.llvm.intrinsic "masked.expandload" %{{.*}}, %{{.*}}, %{{.*}} : (!cir.ptr<!cir.vector<!s8i x 32>>, !cir.vector<!cir.int<s, 1> x 32>, !cir.vector<!s8i x 32>) -> !cir.vector<!s8i x 32>
74+
75+
// LLVM-LABEL: @test_mm256_maskz_expandloadu_epi8
76+
// LLVM: @llvm.masked.expandload.v32i8(ptr %{{.*}}, <32 x i1> %{{.*}}, <32 x i8> %{{.*}})
77+
return _mm256_maskz_expandloadu_epi8(__U, __P);
78+
}

0 commit comments

Comments
 (0)