18
18
// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx2 -fno-signed-char -fclangir -emit-llvm -o %t.ll -Wall -Werror
19
19
// RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s
20
20
21
+ // RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx2 -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=OGCG
22
+ // RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx2 -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=OGCG
23
+ // RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx2 -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=OGCG
24
+ // RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx2 -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=OGCG
25
+
21
26
// This test mimics clang/test/CodeGen/X86/avx2-builtins.c, which eventually
22
27
// CIR shall be able to support fully.
23
28
@@ -33,6 +38,10 @@ __m256i test_mm256_blend_epi16(__m256i a, __m256i b) {
33
38
// LLVM-LABEL: test_mm256_blend_epi16
34
39
// LLVM-NOT: @llvm.x86.avx2.pblendw
35
40
// LLVM: shufflevector <16 x i16> %{{.*}}, <16 x i16> %{{.*}}, <16 x i32> <i32 0, i32 17, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 25, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
41
+
42
+ // OGCG-LABEL: test_mm256_blend_epi16
43
+ // OGCG-NOT: @llvm.x86.avx2.pblendw
44
+ // OGCG: shufflevector <16 x i16> %{{.*}}, <16 x i16> %{{.*}}, <16 x i32> <i32 0, i32 17, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 25, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
36
45
return _mm256_blend_epi16 (a , b , 2 );
37
46
}
38
47
@@ -43,6 +52,10 @@ __m128i test_mm_blend_epi32(__m128i a, __m128i b) {
43
52
// LLVM-LABEL: test_mm_blend_epi32
44
53
// LLVM-NOT: @llvm.x86.avx2.pblendd.128
45
54
// LLVM: shufflevector <4 x i32> %{{.*}}, <4 x i32> %{{.*}}, <4 x i32> <i32 4, i32 1, i32 6, i32 3>
55
+
56
+ // OGCG-LABEL: test_mm_blend_epi32
57
+ // OGCG-NOT: @llvm.x86.avx2.pblendd.128
58
+ // OGCG: shufflevector <4 x i32> %{{.*}}, <4 x i32> %{{.*}}, <4 x i32> <i32 4, i32 1, i32 6, i32 3>
46
59
return _mm_blend_epi32 (a , b , 0x05 );
47
60
}
48
61
@@ -53,5 +66,9 @@ __m256i test_mm256_blend_epi32(__m256i a, __m256i b) {
53
66
// LLVM-LABEL: test_mm256_blend_epi32
54
67
// LLVM-NOT: @llvm.x86.avx2.pblendd.256
55
68
// LLVM: shufflevector <8 x i32> %{{.*}}, <8 x i32> %{{.*}}, <8 x i32> <i32 8, i32 1, i32 10, i32 3, i32 12, i32 13, i32 6, i32 7>
69
+
70
+ // OGCG-LABEL: test_mm256_blend_epi32
71
+ // OGCG-NOT: @llvm.x86.avx2.pblendd.256
72
+ // OGCG: shufflevector <8 x i32> %{{.*}}, <8 x i32> %{{.*}}, <8 x i32> <i32 8, i32 1, i32 10, i32 3, i32 12, i32 13, i32 6, i32 7>
56
73
return _mm256_blend_epi32 (a , b , 0x35 );
57
74
}
0 commit comments