Skip to content

Commit 6581a28

Browse files
committed
Add OGCG checks
1 parent 5257781 commit 6581a28

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx -fno-signed-char -fclangir -emit-llvm -o %t.ll -Wall -Werror
1919
// RUN: FileCheck --check-prefixes=LLVM-CHECK,LLVM-X64 --input-file=%t.ll %s
2020

21+
// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx -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 +avx -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 +avx -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 +avx -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=OGCG
25+
2126
// This test mimics clang/test/CodeGen/X86/avx-builtins.c, which eventually
2227
// CIR shall be able to support fully.
2328

@@ -150,6 +155,9 @@ __m256d test_mm256_blend_pd(__m256d A, __m256d B) {
150155

151156
// LLVM-LABEL: test_mm256_blend_pd
152157
// LLVM: shufflevector <4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x i32> <i32 4, i32 1, i32 6, i32 3>
158+
159+
// OGCG-LABEL: test_mm256_blend_pd
160+
// OGCG: shufflevector <4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x i32> <i32 4, i32 1, i32 6, i32 3>
153161
return _mm256_blend_pd(A, B, 0x05);
154162
}
155163

@@ -159,5 +167,8 @@ __m256 test_mm256_blend_ps(__m256 A, __m256 B) {
159167

160168
// LLVM-LABEL: test_mm256_blend_ps
161169
// LLVM: shufflevector <8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x i32> <i32 8, i32 1, i32 10, i32 3, i32 12, i32 13, i32 6, i32 7>
170+
171+
// OGCG-LABEL: test_mm256_blend_ps
172+
// OGCG: shufflevector <8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x i32> <i32 8, i32 1, i32 10, i32 3, i32 12, i32 13, i32 6, i32 7>
162173
return _mm256_blend_ps(A, B, 0x35);
163174
}

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
// 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
1919
// RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s
2020

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+
2126
// This test mimics clang/test/CodeGen/X86/avx2-builtins.c, which eventually
2227
// CIR shall be able to support fully.
2328

@@ -33,6 +38,10 @@ __m256i test_mm256_blend_epi16(__m256i a, __m256i b) {
3338
// LLVM-LABEL: test_mm256_blend_epi16
3439
// LLVM-NOT: @llvm.x86.avx2.pblendw
3540
// 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>
3645
return _mm256_blend_epi16(a, b, 2);
3746
}
3847

@@ -43,6 +52,10 @@ __m128i test_mm_blend_epi32(__m128i a, __m128i b) {
4352
// LLVM-LABEL: test_mm_blend_epi32
4453
// LLVM-NOT: @llvm.x86.avx2.pblendd.128
4554
// 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>
4659
return _mm_blend_epi32(a, b, 0x05);
4760
}
4861

@@ -53,5 +66,9 @@ __m256i test_mm256_blend_epi32(__m256i a, __m256i b) {
5366
// LLVM-LABEL: test_mm256_blend_epi32
5467
// LLVM-NOT: @llvm.x86.avx2.pblendd.256
5568
// 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>
5673
return _mm256_blend_epi32(a, b, 0x35);
5774
}

0 commit comments

Comments
 (0)