Skip to content

Commit 89b9b2e

Browse files
Move builtin-x86-pshufd.cpp tests to adapted test files
1 parent c8ed141 commit 89b9b2e

File tree

5 files changed

+92
-121
lines changed

5 files changed

+92
-121
lines changed

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

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ __m256d test_mm256_shuffle_pd(__m256d A, __m256d B) {
7979
// CIR-LABEL: test_mm256_shuffle_pd
8080
// 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>
8181

82-
// CHECK-LABEL: test_mm256_shuffle_pd
83-
// CHECK: shufflevector <4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x i32> <i32 0, i32 4, i32 2, i32 6>
82+
// LLVM-LABEL: test_mm256_shuffle_pd
83+
// LLVM: shufflevector <4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x i32> <i32 0, i32 4, i32 2, i32 6>
8484

8585
// OGCG-LABEL: test_mm256_shuffle_pd
8686
// OGCG: shufflevector <4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x i32> <i32 0, i32 4, i32 2, i32 6>
@@ -91,10 +91,58 @@ __m256 test_mm256_shuffle_ps(__m256 A, __m256 B) {
9191
// CIR-LABEL: test_mm256_shuffle_ps
9292
// CIR: %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<8 x !cir.float>) [#cir.int<0> : !s32i, #cir.int<0> : !s32i, #cir.int<8> : !s32i, #cir.int<8> : !s32i, #cir.int<4> : !s32i, #cir.int<4> : !s32i, #cir.int<12> : !s32i, #cir.int<12> : !s32i] : !cir.vector<8 x !cir.float>
9393

94-
// CHECK-LABEL: test_mm256_shuffle_ps
95-
// CHECK: shufflevector <8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x i32> <i32 0, i32 0, i32 8, i32 8, i32 4, i32 4, i32 12, i32 12>
94+
// LLVM-LABEL: test_mm256_shuffle_ps
95+
// LLVM: shufflevector <8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x i32> <i32 0, i32 0, i32 8, i32 8, i32 4, i32 4, i32 12, i32 12>
9696

9797
// OGCG-LABEL: test_mm256_shuffle_ps
9898
// OGCG: shufflevector <8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x i32> <i32 0, i32 0, i32 8, i32 8, i32 4, i32 4, i32 12, i32 12>
9999
return _mm256_shuffle_ps(A, B, 0);
100100
}
101+
102+
__m128 test_mm_permute_ps(__m128 A) {
103+
// CIR-LABEL: test_mm_permute_ps
104+
// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<4 x !cir.float>) [#cir.int<2> : !s32i, #cir.int<3> : !s32i, #cir.int<0> : !s32i, #cir.int<1> : !s32i] : !cir.vector<4 x !cir.float>
105+
106+
// LLVM-LABEL: test_mm_permute_ps
107+
// LLVM: shufflevector <4 x float> %{{.*}}, <4 x float> poison, <4 x i32> <i32 2, i32 3, i32 0, i32 1>
108+
109+
// OGCG-LABEL: test_mm_permute_ps
110+
// OGCG: shufflevector <4 x float> %{{.*}}, <4 x float> poison, <4 x i32> <i32 2, i32 3, i32 0, i32 1>
111+
return _mm_permute_ps(A, 0x4E);
112+
}
113+
114+
__m256 test_mm256_permute_ps(__m256 A) {
115+
// CIR-LABEL: test_mm256_permute_ps
116+
// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<8 x !cir.float>) [#cir.int<2> : !s32i, #cir.int<3> : !s32i, #cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<6> : !s32i, #cir.int<7> : !s32i, #cir.int<4> : !s32i, #cir.int<5> : !s32i] : !cir.vector<8 x !cir.float>
117+
118+
// LLVM-LABEL: test_mm256_permute_ps
119+
// LLVM: shufflevector <8 x float> %{{.*}}, <8 x float> poison, <8 x i32> <i32 2, i32 3, i32 0, i32 1, i32 6, i32 7, i32 4, i32 5>
120+
121+
// OGCG-LABEL: test_mm256_permute_ps
122+
// OGCG: shufflevector <8 x float> %{{.*}}, <8 x float> poison, <8 x i32> <i32 2, i32 3, i32 0, i32 1, i32 6, i32 7, i32 4, i32 5>
123+
return _mm256_permute_ps(A, 0x4E);
124+
}
125+
126+
__m128d test_mm_permute_pd(__m128d A) {
127+
// CIR-LABEL: test_mm_permute_pd
128+
// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<2 x !cir.double>) [#cir.int<1> : !s32i, #cir.int<0> : !s32i] : !cir.vector<2 x !cir.double>
129+
130+
// LLVM-LABEL: test_mm_permute_pd
131+
// LLVM: shufflevector <2 x double> %{{.*}}, <2 x double> poison, <2 x i32> <i32 1, i32 0>
132+
133+
// OGCG-LABEL: test_mm_permute_pd
134+
// OGCG: shufflevector <2 x double> %{{.*}}, <2 x double> poison, <2 x i32> <i32 1, i32 0>
135+
return _mm_permute_pd(A, 0x1);
136+
}
137+
138+
__m256d test_mm256_permute_pd(__m256d A) {
139+
// CIR-LABEL: test_mm256_permute_pd
140+
// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<4 x !cir.double>) [#cir.int<1> : !s32i, #cir.int<0> : !s32i, #cir.int<3> : !s32i, #cir.int<2> : !s32i] : !cir.vector<4 x !cir.double>
141+
142+
// LLVM-LABEL: test_mm256_permute_pd
143+
// LLVM: shufflevector <4 x double> %{{.*}}, <4 x double> poison, <4 x i32> <i32 1, i32 0, i32 3, i32 2>
144+
145+
// OGCG-LABEL: test_mm256_permute_pd
146+
// OGCG: shufflevector <4 x double> %{{.*}}, <4 x double> poison, <4 x i32> <i32 1, i32 0, i32 3, i32 2>
147+
return _mm256_permute_pd(A, 0x5);
148+
}

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,27 @@ __m512 test_mm512_shuffle_ps(__m512 __M, __m512 __V) {
101101
// OGCG: shufflevector <16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x i32> <i32 0, i32 1, i32 16, i32 16, i32 4, i32 5, i32 20, i32 20, i32 8, i32 9, i32 24, i32 24, i32 12, i32 13, i32 28, i32 28>
102102
return _mm512_shuffle_ps(__M, __V, 4);
103103
}
104+
105+
__m512 test_mm512_permute_ps(__m512 A) {
106+
// CIR-LABEL: test_mm512_permute_ps
107+
// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<16 x !cir.float>) [#cir.int<2> : !s32i, #cir.int<3> : !s32i, #cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<6> : !s32i, #cir.int<7> : !s32i, #cir.int<4> : !s32i, #cir.int<5> : !s32i, #cir.int<10> : !s32i, #cir.int<11> : !s32i, #cir.int<8> : !s32i, #cir.int<9> : !s32i, #cir.int<14> : !s32i, #cir.int<15> : !s32i, #cir.int<12> : !s32i, #cir.int<13> : !s32i] : !cir.vector<16 x !cir.float>
108+
109+
// LLVM-LABEL: test_mm512_permute_ps
110+
// LLVM: shufflevector <16 x float> %{{.*}}, <16 x float> poison, <16 x i32> <i32 2, i32 3, i32 0, i32 1, i32 6, i32 7, i32 4, i32 5, i32 10, i32 11, i32 8, i32 9, i32 14, i32 15, i32 12, i32 13>
111+
112+
// OGCG-LABEL: test_mm512_permute_ps
113+
// OGCG: shufflevector <16 x float> %{{.*}}, <16 x float> poison, <16 x i32> <i32 2, i32 3, i32 0, i32 1, i32 6, i32 7, i32 4, i32 5, i32 10, i32 11, i32 8, i32 9, i32 14, i32 15, i32 12, i32 13>
114+
return _mm512_permute_ps(A, 0x4E);
115+
}
116+
117+
__m512d test_mm512_permute_pd(__m512d A) {
118+
// CIR-LABEL: test_mm512_permute_pd
119+
// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<8 x !cir.double>) [#cir.int<1> : !s32i, #cir.int<0> : !s32i, #cir.int<3> : !s32i, #cir.int<2> : !s32i, #cir.int<5> : !s32i, #cir.int<4> : !s32i, #cir.int<7> : !s32i, #cir.int<6> : !s32i] : !cir.vector<8 x !cir.double>
120+
121+
// LLVM-LABEL: test_mm512_permute_pd
122+
// LLVM: shufflevector <8 x double> %{{.*}}, <8 x double> poison, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6>
123+
124+
// OGCG-LABEL: test_mm512_permute_pd
125+
// OGCG: shufflevector <8 x double> %{{.*}}, <8 x double> poison, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6>
126+
return _mm512_permute_pd(A, 0x55);
127+
}

clang/test/CIR/CodeGenBuiltins/X86/builtin-x86-pshufd.cpp

Lines changed: 0 additions & 113 deletions
This file was deleted.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ __m128 test_mm_shuffle_ps(__m128 A, __m128 B) {
7676
// CIR-LABEL: _mm_shuffle_ps
7777
// CIR: %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<4 x !cir.float>) [#cir.int<0> : !s32i, #cir.int<0> : !s32i, #cir.int<4> : !s32i, #cir.int<4> : !s32i] : !cir.vector<4 x !cir.float>
7878

79-
// CHECK-LABEL: test_mm_shuffle_ps
80-
// CHECK: shufflevector <4 x float> {{.*}}, <4 x float> {{.*}}, <4 x i32> <i32 0, i32 0, i32 4, i32 4>
79+
// LLVM-LABEL: test_mm_shuffle_ps
80+
// LLVM: shufflevector <4 x float> {{.*}}, <4 x float> {{.*}}, <4 x i32> <i32 0, i32 0, i32 4, i32 4>
8181

8282
// OGCG-LABEL: test_mm_shuffle_ps
8383
// OGCG: shufflevector <4 x float> {{.*}}, <4 x float> {{.*}}, <4 x i32> <i32 0, i32 0, i32 4, i32 4>

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,22 @@ __m128d test_mm_shuffle_pd(__m128d A, __m128d B) {
140140
// CIR-LABEL: test_mm_shuffle_pd
141141
// CIR: %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<2 x !cir.double>) [#cir.int<1> : !s32i, #cir.int<2> : !s32i] : !cir.vector<2 x !cir.double>
142142

143-
// CHECK-LABEL: test_mm_shuffle_pd
144-
// CHECK: shufflevector <2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x i32> <i32 1, i32 2>
143+
// LLVM-LABEL: test_mm_shuffle_pd
144+
// LLVM: shufflevector <2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x i32> <i32 1, i32 2>
145145

146146
// OGCG-LABEL: test_mm_shuffle_pd
147147
// OGCG: shufflevector <2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x i32> <i32 1, i32 2>
148148
return _mm_shuffle_pd(A, B, 1);
149149
}
150+
151+
__m128i test_mm_shuffle_epi32(__m128i A) {
152+
// CIR-LABEL: test_mm_shuffle_epi32
153+
// CIR: %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}}: !cir.vector<4 x !s32i>) [#cir.int<2> : !s32i, #cir.int<3> : !s32i, #cir.int<0> : !s32i, #cir.int<1> : !s32i] : !cir.vector<4 x !s32i>
154+
155+
// LLVM-LABEL: test_mm_shuffle_epi32
156+
// LLVM: shufflevector <4 x i32> %{{.*}}, <4 x i32> poison, <4 x i32> <i32 2, i32 3, i32 0, i32 1>
157+
158+
// OGCG-LABEL: test_mm_shuffle_epi32
159+
// OGCG: shufflevector <4 x i32> %{{.*}}, <4 x i32> poison, <4 x i32> <i32 2, i32 3, i32 0, i32 1>
160+
return _mm_shuffle_epi32(A, 0x4E);
161+
}

0 commit comments

Comments
 (0)