Skip to content

Commit 8ccb29a

Browse files
Upstream CIR codegen for insert x86 builtins
1 parent 27c4520 commit 8ccb29a

File tree

8 files changed

+345
-3
lines changed

8 files changed

+345
-3
lines changed

clang/lib/CIR/CodeGen/CIRGenBuiltinX86.cpp

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,10 @@ mlir::Value CIRGenFunction::emitX86BuiltinExpr(unsigned builtinID,
989989
case X86::BI__builtin_ia32_extracti64x2_256_mask:
990990
case X86::BI__builtin_ia32_extractf64x2_512_mask:
991991
case X86::BI__builtin_ia32_extracti64x2_512_mask:
992+
cgm.errorNYI(expr->getSourceRange(),
993+
std::string("unimplemented X86 builtin call: ") +
994+
getContext().BuiltinInfo.getName(builtinID));
995+
return {};
992996
case X86::BI__builtin_ia32_vinsertf128_pd256:
993997
case X86::BI__builtin_ia32_vinsertf128_ps256:
994998
case X86::BI__builtin_ia32_vinsertf128_si256:
@@ -1004,7 +1008,33 @@ mlir::Value CIRGenFunction::emitX86BuiltinExpr(unsigned builtinID,
10041008
case X86::BI__builtin_ia32_insertf64x2_256:
10051009
case X86::BI__builtin_ia32_inserti64x2_256:
10061010
case X86::BI__builtin_ia32_insertf64x2_512:
1007-
case X86::BI__builtin_ia32_inserti64x2_512:
1011+
case X86::BI__builtin_ia32_inserti64x2_512: {
1012+
unsigned dstNumElts = cast<cir::VectorType>(ops[0].getType()).getSize();
1013+
unsigned srcNumElts = cast<cir::VectorType>(ops[1].getType()).getSize();
1014+
unsigned subVectors = dstNumElts / srcNumElts;
1015+
assert(llvm::isPowerOf2_32(subVectors) && "Expected power of 2 subvectors");
1016+
1017+
uint64_t index = getZExtIntValueFromConstOp(ops[2]);
1018+
index &= subVectors - 1; // Remove any extra bits.
1019+
index *= srcNumElts;
1020+
1021+
int64_t indices[16];
1022+
for (unsigned i = 0; i != dstNumElts; ++i)
1023+
indices[i] = (i >= srcNumElts) ? srcNumElts + (i % srcNumElts) : i;
1024+
1025+
mlir::Value op1 = builder.createVecShuffle(
1026+
getLoc(expr->getExprLoc()), ops[1], ArrayRef(indices, dstNumElts));
1027+
1028+
for (unsigned i = 0; i != dstNumElts; ++i) {
1029+
if (i >= index && i < (index + srcNumElts))
1030+
indices[i] = (i - index) + dstNumElts;
1031+
else
1032+
indices[i] = i;
1033+
}
1034+
1035+
return builder.createVecShuffle(getLoc(expr->getExprLoc()), ops[0], op1,
1036+
ArrayRef(indices, dstNumElts));
1037+
}
10081038
case X86::BI__builtin_ia32_pmovqd512_mask:
10091039
case X86::BI__builtin_ia32_pmovwb512_mask:
10101040
case X86::BI__builtin_ia32_pblendw128:

clang/test/CIR/CodeGenBuiltins/X86/avx-builtins.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,51 @@ __m256i test_mm256_undefined_si256(void) {
7575
return _mm256_undefined_si256();
7676
}
7777

78+
__m256d test_mm256_insertf128_pd(__m256d A, __m128d B) {
79+
// CIR-LABEL: test_mm256_insertf128_pd
80+
// %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<2 x !cir.double>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i] : !cir.vector<4 x !cir.double>
81+
// %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<4 x !cir.double>) [#cir.int<4> : !s32i, #cir.int<5> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i] : !cir.vector<4 x !cir.double>
82+
83+
// LLVM-LABEL: test_mm256_insertf128_pd
84+
// LLVM: shufflevector <2 x double> %{{.*}}, <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
85+
// LLVM: shufflevector <4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x i32> <i32 4, i32 5, i32 2, i32 3>
86+
87+
// OGCG-LABEL: test_mm256_insertf128_pd
88+
// OGCG: shufflevector <2 x double> %{{.*}}, <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
89+
// OGCG: shufflevector <4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x i32> <i32 4, i32 5, i32 2, i32 3>
90+
return _mm256_insertf128_pd(A, B, 0);
91+
}
92+
93+
__m256 test_mm256_insertf128_ps(__m256 A, __m128 B) {
94+
// CIR-LABEL: test_mm256_insertf128_ps
95+
// %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<4 x !cir.float>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i] : !cir.vector<8 x !cir.float>
96+
// %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<8 x !cir.float>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i, #cir.int<8> : !s32i, #cir.int<9> : !s32i, #cir.int<10> : !s32i, #cir.int<11> : !s32i] : !cir.vector<8 x !cir.float>
97+
98+
// LLVM-LABEL: test_mm256_insertf128_ps
99+
// LLVM: shufflevector <4 x float> %{{.*}}, <4 x float> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
100+
// LLVM: shufflevector <8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>
101+
102+
// OGCG-LABEL: test_mm256_insertf128_ps
103+
// OGCG: shufflevector <4 x float> %{{.*}}, <4 x float> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
104+
// OGCG: shufflevector <8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>
105+
return _mm256_insertf128_ps(A, B, 1);
106+
}
107+
108+
__m256i test_mm256_insertf128_si256(__m256i A, __m128i B) {
109+
// CIR-LABEL: test_mm256_insertf128_si256
110+
// %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<4 x !s32i>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i] : !cir.vector<8 x !s32i>
111+
// %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<8 x !s32i>) [#cir.int<8> : !s32i, #cir.int<9> : !s32i, #cir.int<10> : !s32i, #cir.int<11> : !s32i, #cir.int<4> : !s32i, #cir.int<5> : !s32i, #cir.int<6> : !s32i, #cir.int<7> : !s32i]
112+
113+
// LLVM-LABEL: test_mm256_insertf128_si256
114+
// LLVM: shufflevector <4 x i32> %{{.*}}, <4 x i32> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
115+
// LLVM: shufflevector <8 x i32> %{{.*}}, <8 x i32> %{{.*}}, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 4, i32 5, i32 6, i32 7>
116+
117+
// OGCG-LABEL: test_mm256_insertf128_si256
118+
// OGCG: shufflevector <4 x i32> %{{.*}}, <4 x i32> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
119+
// OGCG: shufflevector <8 x i32> %{{.*}}, <8 x i32> %{{.*}}, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 4, i32 5, i32 6, i32 7>
120+
return _mm256_insertf128_si256(A, B, 0);
121+
}
122+
78123
__m256d test_mm256_shuffle_pd(__m256d A, __m256d B) {
79124
// CIR-LABEL: test_mm256_shuffle_pd
80125
// CIR: %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<4 x !cir.double>) [#cir.int<0> : !s32i, #cir.int<4> : !s32i, #cir.int<2> : !s32i, #cir.int<6> : !s32i] : !cir.vector<4 x !cir.double>
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5
2+
// REQUIRES: x86-registered-target
3+
// RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx -disable-O0-optnone -fclangir -emit-cir -o %t.cir | opt -S -passes=mem2reg
4+
// RUN: FileCheck --check-prefixes=CIR --input-file=%t.cir %s
5+
6+
// RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx -disable-O0-optnone -fclangir -emit-llvm -o %t.ll | opt -S -passes=mem2reg
7+
// RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s
8+
9+
#include <immintrin.h>
10+
11+
__m256d test0_mm256_insertf128_pd(__m256d a, __m128d b) {
12+
// CIR-LABEL: @test0_mm256_insertf128_pd(
13+
// CIR: [[A:%.*]] = cir.load align(32) %0 : !cir.ptr<!cir.vector<4 x !cir.double>>, !cir.vector<4 x !cir.double>
14+
// CIR: [[B:%.*]] = cir.load align(16) %1 : !cir.ptr<!cir.vector<2 x !cir.double>>, !cir.vector<2 x !cir.double>
15+
// CIR: %{{.*}} = cir.vec.shuffle([[B]], %{{.*}} : !cir.vector<2 x !cir.double>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i] : !cir.vector<4 x !cir.double>
16+
// CIR-NEXT: %{{.*}} = cir.vec.shuffle([[A]], %{{.*}} : !s32i, #cir.int<5> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i] : !cir.vector<4 x !cir.double>
17+
// CIR: cir.return %{{.*}} : !cir.vector<4 x !cir.double>
18+
19+
// LLVM-LABEL: @test0_mm256_insertf128_pd
20+
// LLVM: [[A:%.*]] = load <4 x double>, ptr %{{.*}}, align 32
21+
// LLVM: [[B:%.*]] = load <2 x double>, ptr %{{.*}}, align 16
22+
// LLVM-NEXT: [[WIDEN:%.*]] = shufflevector <2 x double> [[B]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
23+
// LLVM-NEXT: [[INSERT:%.*]] = shufflevector <4 x double> [[A]], <4 x double> [[WIDEN]], <4 x i32> <i32 4, i32 5, i32 2, i32 3>
24+
// LLVM: ret <4 x double>
25+
return _mm256_insertf128_pd(a, b, 0);
26+
}
27+
28+
__m256 test0_mm256_insertf128_ps(__m256 a, __m128 b) {
29+
// CIR-LABEL: @test0_mm256_insertf128_ps(
30+
// CIR: %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<4 x !cir.float>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i, #cir.int<4> : !s32i, #cir.int<5> : !s32i, #cir.int<6> : !s32i, #cir.int<7> : !s32i] : !cir.vector<8 x !cir.float>
31+
// CIR-NEXT: %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<8 x !cir.float>) [#cir.int<8> : !s32i, #cir.int<9> : !s32i, #cir.int<10> : !s32i, #cir.int<11> : !s32i, #cir.int<4> : !s32i, #cir.int<5> : !s32i, #cir.int<6> : !s32i, #cir.int<7> : !s32i] : !cir.vector<8 x !cir.float>
32+
// CIR: cir.return %{{.*}} : !cir.vector<8 x !cir.float>
33+
34+
// LLVM-LABEL: @test0_mm256_insertf128_ps(
35+
// LLVM: %{{.*}} = shufflevector <4 x float> %{{.*}}, <4 x float> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
36+
// LLVM-NEXT: %{{.*}} = shufflevector <8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 4, i32 5, i32 6, i32 7>
37+
// LLVM: ret <8 x float> %{{.*}}
38+
return _mm256_insertf128_ps(a, b, 0);
39+
}
40+
41+
__m256 test1_mm256_insertf128_ps(__m256 a, __m128 b) {
42+
// CIR-LABEL: @test1_mm256_insertf128_ps(
43+
// CIR: %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<4 x !cir.float>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i, #cir.int<4> : !s32i, #cir.int<5> : !s32i, #cir.int<6> : !s32i, #cir.int<7> : !s32i] : !cir.vector<8 x !cir.float>
44+
// CIR-NEXT: %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<8 x !cir.float>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i, #cir.int<8> : !s32i, #cir.int<9> : !s32i, #cir.int<10> : !s32i, #cir.int<11> : !s32i] : !cir.vector<8 x !cir.float>
45+
// CIR: cir.return %{{.*}} : !cir.vector<8 x !cir.float>
46+
47+
// LLVM-LABEL: define dso_local <8 x float> @test1_mm256_insertf128_ps(
48+
// LLVM: %{{.*}} = shufflevector <4 x float> %{{.*}}, <4 x float> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
49+
// LLVM-NEXT: %{{.*}} = shufflevector <8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>
50+
// LLVM: ret <8 x float> %{{.*}}
51+
return _mm256_insertf128_ps(a, b, 1);
52+
}
53+
54+
__m256i test0_mm256_insertf128_si256(__m256i a, __m128i b) {
55+
// CIR-LABEL: @test0_mm256_insertf128_si256(
56+
// CIR: [[TMP0:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<4 x !s64i> -> !cir.vector<8 x !s32i>
57+
// CIR: [[TMP1:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<2 x !s64i> -> !cir.vector<4 x !s32i>
58+
// CIR: %{{.*}} = cir.vec.shuffle([[TMP1]], %{{.*}} : !cir.vector<4 x !s32i>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i, #cir.int<4> : !s32i, #cir.int<5> : !s32i, #cir.int<6> : !s32i, #cir.int<7> : !s32i] : !cir.vector<8 x !s32i>
59+
// CIR-NEXT: %{{.*}} = cir.vec.shuffle([[TMP0]], %{{.*}} : !cir.vector<8 x !s32i>) [#cir.int<8> : !s32i, #cir.int<9> : !s32i, #cir.int<10> : !s32i, #cir.int<11> : !s32i, #cir.int<4> : !s32i, #cir.int<5> : !s32i, #cir.int<6> : !s32i, #cir.int<7> : !s32i] : !cir.vector<8 x !s32i>
60+
// CIR: %{{.*}} = cir.cast bitcast %{{.*}} : !cir.vector<8 x !s32i> -> !cir.vector<4 x !s64i>
61+
// CIR: cir.return %{{.*}} : !cir.vector<4 x !s64i>
62+
63+
// LLVM-LABEL: @test0_mm256_insertf128_si256
64+
// LLVM: [[TMP0:%.*]] = bitcast <4 x i64> %{{.*}} to <8 x i32>
65+
// LLVM: [[TMP1:%.*]] = bitcast <2 x i64> %{{.*}} to <4 x i32>
66+
// LLVM: [[WIDEN:%.*]] = shufflevector <4 x i32> [[TMP1]], <4 x i32> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
67+
// LLVM-NEXT: [[INSERT:%.*]] = shufflevector <8 x i32> [[TMP0]], <8 x i32> [[WIDEN]], <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 4, i32 5, i32 6, i32 7>
68+
// LLVM: [[TMP2:%.*]] = bitcast <8 x i32> [[INSERT]] to <4 x i64>
69+
// LLVM: ret <4 x i64> %{{.*}}
70+
return _mm256_insertf128_si256(a, b, 0);
71+
}
72+
73+
__m256i test1_mm256_insertf128_si256(__m256i a, __m128i b) {
74+
// CIR-LABEL: @test1_mm256_insertf128_si256(
75+
// CIR: [[TMP0:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<4 x !s64i> -> !cir.vector<8 x !s32i>
76+
// CIR: [[TMP1:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<2 x !s64i> -> !cir.vector<4 x !s32i>
77+
// CIR: %{{.*}} = cir.vec.shuffle([[TMP1]], %{{.*}} : !cir.vector<4 x !s32i>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i, #cir.int<4> : !s32i, #cir.int<5> : !s32i, #cir.int<6> : !s32i, #cir.int<7> : !s32i] : !cir.vector<8 x !s32i>
78+
// CIR-NEXT: %{{.*}} = cir.vec.shuffle([[TMP0]], %{{.*}} : !cir.vector<8 x !s32i>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i, #cir.int<8> : !s32i, #cir.int<9> : !s32i, #cir.int<10> : !s32i, #cir.int<11> : !s32i] : !cir.vector<8 x !s32i>
79+
// CIR: %{{.*}} = cir.cast bitcast %{{.*}} : !cir.vector<8 x !s32i> -> !cir.vector<4 x !s64i>
80+
// CIR: cir.return %{{.*}} : !cir.vector<4 x !s64i>
81+
82+
// LLVM-LABEL: @test1_mm256_insertf128_si256
83+
// LLVM: [[TMP0:%.*]] = bitcast <4 x i64> %{{.*}} to <8 x i32>
84+
// LLVM: [[TMP1:%.*]] = bitcast <2 x i64> %{{.*}} to <4 x i32>
85+
// LLVM: [[WIDEN:%.*]] = shufflevector <4 x i32> [[TMP1]], <4 x i32> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
86+
// LLVM-NEXT: [[INSERT:%.*]] = shufflevector <8 x i32> [[TMP0]], <8 x i32> [[WIDEN]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>
87+
// LLVM: [[TMP2:%.*]] = bitcast <8 x i32> [[INSERT]] to <4 x i64>
88+
// LLVM: ret <4 x i64> %{{.*}}
89+
return _mm256_insertf128_si256(a, b, 1);
90+
}

clang/test/CIR/CodeGenBuiltins/X86/avx2-builtins.c

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,36 @@
2828

2929
#include <immintrin.h>
3030

31+
__m256i test0_mm256_inserti128_si256(__m256i a, __m128i b) {
32+
// CIR-LABEL: test0_mm256_inserti128_si256
33+
// CIR: %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<2 x !s64i>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i] : !cir.vector<4 x !s64i>
34+
// CIR: %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<4 x !s64i>) [#cir.int<4> : !s32i, #cir.int<5> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i] : !cir.vector<4 x !s64i>
35+
36+
// LLVM-LABEL: test0_mm256_inserti128_si256
37+
// LLVM: shufflevector <2 x i64> %{{.*}}, <2 x i64> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
38+
// LLVM: shufflevector <4 x i64> %{{.*}}, <4 x i64> %{{.*}}, <4 x i32> <i32 4, i32 5, i32 2, i32 3>
39+
40+
// OGCG-LABEL: test0_mm256_inserti128_si256
41+
// OGCG: shufflevector <2 x i64> %{{.*}}, <2 x i64> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
42+
// OGCG: shufflevector <4 x i64> %{{.*}}, <4 x i64> %{{.*}}, <4 x i32> <i32 4, i32 5, i32 2, i32 3>
43+
return _mm256_inserti128_si256(a, b, 0);
44+
}
45+
46+
__m256i test1_mm256_inserti128_si256(__m256i a, __m128i b) {
47+
// CIR-LABEL: test1_mm256_inserti128_si256
48+
// CIR: %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<2 x !s64i>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i] : !cir.vector<4 x !s64i>
49+
// CIR: %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<4 x !s64i>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<4> : !s32i, #cir.int<5> : !s32i] : !cir.vector<4 x !s64i>
50+
51+
// LLVM-LABEL: test1_mm256_inserti128_si256
52+
// LLVM: shufflevector <2 x i64> %{{.*}}, <2 x i64> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
53+
// LLVM: shufflevector <4 x i64> %{{.*}}, <4 x i64> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
54+
55+
// OGCG-LABEL: test1_mm256_inserti128_si256
56+
// OGCG: shufflevector <2 x i64> %{{.*}}, <2 x i64> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
57+
// OGCG: shufflevector <4 x i64> %{{.*}}, <4 x i64> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
58+
return _mm256_inserti128_si256(a, b, 1);
59+
}
60+
3161
__m256i test_mm256_shufflelo_epi16(__m256i a) {
3262
// CIR-LABEL: _mm256_shufflelo_epi16
3363
// CIR: %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<16 x !s16i>) [#cir.int<3> : !s32i, #cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<1> : !s32i, #cir.int<4> : !s32i, #cir.int<5> : !s32i, #cir.int<6> : !s32i, #cir.int<7> : !s32i, #cir.int<11> : !s32i, #cir.int<8> : !s32i, #cir.int<9> : !s32i, #cir.int<9> : !s32i, #cir.int<12> : !s32i, #cir.int<13> : !s32i, #cir.int<14> : !s32i, #cir.int<15> : !s32i] : !cir.vector<16 x !s16i>
@@ -72,7 +102,7 @@ __m256i test_mm256_mul_epu32(__m256i a, __m256i b) {
72102
// OGCG: and <4 x i64> %{{.*}}, splat (i64 4294967295)
73103
// OGCG: mul <4 x i64> %{{.*}}, %{{.*}}
74104

75-
return _mm256_mul_epu32(a, b);
105+
return _mm256_mul_epu32(a, b);
76106
}
77107

78108
__m256i test_mm256_mul_epi32(__m256i a, __m256i b) {

0 commit comments

Comments
 (0)