Skip to content

Commit 5d3a3ec

Browse files
committed
[clang][x86] Add C++ run lines and fix constexpr tests
Some files containing `constexpr` tests did not have a C++ run line.
1 parent f24c50a commit 5d3a3ec

File tree

5 files changed

+269
-267
lines changed

5 files changed

+269
-267
lines changed
Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,171 +1,172 @@
1-
// RUN: %clang_cc1 -ffreestanding %s -O0 -triple=x86_64-apple-darwin -target-cpu skylake-avx512 -emit-llvm -o - -Wall -Werror | FileCheck %s
1+
// RUN: %clang_cc1 -x c -ffreestanding %s -O0 -triple=x86_64-apple-darwin -target-cpu skylake-avx512 -emit-llvm -o - -Wall -Werror | FileCheck %s
2+
// RUN: %clang_cc1 -x c++ -ffreestanding %s -O0 -triple=x86_64-apple-darwin -target-cpu skylake-avx512 -emit-llvm -o - -Wall -Werror | FileCheck %s
23

34
#include <immintrin.h>
45
#include "builtin_test_helpers.h"
56

67
long long test_mm512_reduce_add_epi64(__m512i __W){
7-
// CHECK-LABEL: @test_mm512_reduce_add_epi64(
8-
// CHECK: call i64 @llvm.vector.reduce.add.v8i64(<8 x i64> %{{.*}})
8+
// CHECK-LABEL: test_mm512_reduce_add_epi64
9+
// CHECK: call {{.*}}i64 @llvm.vector.reduce.add.v8i64(<8 x i64> %{{.*}})
910
return _mm512_reduce_add_epi64(__W);
1011
}
1112
TEST_CONSTEXPR(_mm512_reduce_add_epi64((__m512i)(__v8di){-4, -3, -2, -1, 0, 1, 2, 3}) == -4);
1213

1314
long long test_mm512_reduce_mul_epi64(__m512i __W){
14-
// CHECK-LABEL: @test_mm512_reduce_mul_epi64(
15-
// CHECK: call i64 @llvm.vector.reduce.mul.v8i64(<8 x i64> %{{.*}})
15+
// CHECK-LABEL: test_mm512_reduce_mul_epi64
16+
// CHECK: call {{.*}}i64 @llvm.vector.reduce.mul.v8i64(<8 x i64> %{{.*}})
1617
return _mm512_reduce_mul_epi64(__W);
1718
}
1819
TEST_CONSTEXPR(_mm512_reduce_mul_epi64((__m512i)(__v8di){1, 2, 3, 4, 5, 6, 7, 8}) == 40320);
1920

2021
long long test_mm512_reduce_or_epi64(__m512i __W){
21-
// CHECK-LABEL: @test_mm512_reduce_or_epi64(
22-
// CHECK: call i64 @llvm.vector.reduce.or.v8i64(<8 x i64> %{{.*}})
22+
// CHECK-LABEL: test_mm512_reduce_or_epi64
23+
// CHECK: call {{.*}}i64 @llvm.vector.reduce.or.v8i64(<8 x i64> %{{.*}})
2324
return _mm512_reduce_or_epi64(__W);
2425
}
2526
TEST_CONSTEXPR(_mm512_reduce_or_epi64((__m512i)(__v8di){0x100, 0x200, 0x400, 0x800, 0, 0, 0, 0}) == 0xF00);
2627

2728
long long test_mm512_reduce_and_epi64(__m512i __W){
28-
// CHECK-LABEL: @test_mm512_reduce_and_epi64(
29-
// CHECK: call i64 @llvm.vector.reduce.and.v8i64(<8 x i64> %{{.*}})
29+
// CHECK-LABEL: test_mm512_reduce_and_epi64
30+
// CHECK: call {{.*}}i64 @llvm.vector.reduce.and.v8i64(<8 x i64> %{{.*}})
3031
return _mm512_reduce_and_epi64(__W);
3132
}
3233
TEST_CONSTEXPR(_mm512_reduce_and_epi64((__m512i)(__v8di){0xFFFF, 0xFF00, 0x00FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFF00, 0x00FF}) == 0x0000);
3334

3435
long long test_mm512_mask_reduce_add_epi64(__mmask8 __M, __m512i __W){
35-
// CHECK-LABEL: @test_mm512_mask_reduce_add_epi64(
36+
// CHECK-LABEL: test_mm512_mask_reduce_add_epi64
3637
// CHECK: select <8 x i1> %{{.*}}, <8 x i64> %{{.*}}, <8 x i64> %{{.*}}
37-
// CHECK: call i64 @llvm.vector.reduce.add.v8i64(<8 x i64> %{{.*}})
38+
// CHECK: call {{.*}}i64 @llvm.vector.reduce.add.v8i64(<8 x i64> %{{.*}})
3839
return _mm512_mask_reduce_add_epi64(__M, __W);
3940
}
4041

4142
long long test_mm512_mask_reduce_mul_epi64(__mmask8 __M, __m512i __W){
42-
// CHECK-LABEL: @test_mm512_mask_reduce_mul_epi64(
43+
// CHECK-LABEL: test_mm512_mask_reduce_mul_epi64
4344
// CHECK: select <8 x i1> %{{.*}}, <8 x i64> %{{.*}}, <8 x i64> %{{.*}}
44-
// CHECK: call i64 @llvm.vector.reduce.mul.v8i64(<8 x i64> %{{.*}})
45+
// CHECK: call {{.*}}i64 @llvm.vector.reduce.mul.v8i64(<8 x i64> %{{.*}})
4546
return _mm512_mask_reduce_mul_epi64(__M, __W);
4647
}
4748

4849
long long test_mm512_mask_reduce_and_epi64(__mmask8 __M, __m512i __W){
49-
// CHECK-LABEL: @test_mm512_mask_reduce_and_epi64(
50+
// CHECK-LABEL: test_mm512_mask_reduce_and_epi64
5051
// CHECK: select <8 x i1> %{{.*}}, <8 x i64> %{{.*}}, <8 x i64> %{{.*}}
51-
// CHECK: call i64 @llvm.vector.reduce.and.v8i64(<8 x i64> %{{.*}})
52+
// CHECK: call {{.*}}i64 @llvm.vector.reduce.and.v8i64(<8 x i64> %{{.*}})
5253
return _mm512_mask_reduce_and_epi64(__M, __W);
5354
}
5455

5556
long long test_mm512_mask_reduce_or_epi64(__mmask8 __M, __m512i __W){
56-
// CHECK-LABEL: @test_mm512_mask_reduce_or_epi64(
57+
// CHECK-LABEL: test_mm512_mask_reduce_or_epi64
5758
// CHECK: select <8 x i1> %{{.*}}, <8 x i64> %{{.*}}, <8 x i64> %{{.*}}
58-
// CHECK: call i64 @llvm.vector.reduce.or.v8i64(<8 x i64> %{{.*}})
59+
// CHECK: call {{.*}}i64 @llvm.vector.reduce.or.v8i64(<8 x i64> %{{.*}})
5960
return _mm512_mask_reduce_or_epi64(__M, __W);
6061
}
6162

6263
int test_mm512_reduce_add_epi32(__m512i __W){
63-
// CHECK-LABEL: @test_mm512_reduce_add_epi32(
64-
// CHECK: call i32 @llvm.vector.reduce.add.v16i32(<16 x i32> %{{.*}})
64+
// CHECK-LABEL: test_mm512_reduce_add_epi32
65+
// CHECK: call {{.*}}i32 @llvm.vector.reduce.add.v16i32(<16 x i32> %{{.*}})
6566
return _mm512_reduce_add_epi32(__W);
6667
}
6768
TEST_CONSTEXPR(_mm512_reduce_add_epi32((__m512i)(__v16si){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7}) == -8);
6869

6970
int test_mm512_reduce_mul_epi32(__m512i __W){
70-
// CHECK-LABEL: @test_mm512_reduce_mul_epi32(
71-
// CHECK: call i32 @llvm.vector.reduce.mul.v16i32(<16 x i32> %{{.*}})
71+
// CHECK-LABEL: test_mm512_reduce_mul_epi32
72+
// CHECK: call {{.*}}i32 @llvm.vector.reduce.mul.v16i32(<16 x i32> %{{.*}})
7273
return _mm512_reduce_mul_epi32(__W);
7374
}
7475
TEST_CONSTEXPR(_mm512_reduce_mul_epi32((__m512i)(__v16si){1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 1, 1, -3, 1, 1}) == -36);
7576

7677
int test_mm512_reduce_or_epi32(__m512i __W){
77-
// CHECK: call i32 @llvm.vector.reduce.or.v16i32(<16 x i32> %{{.*}})
78+
// CHECK: call {{.*}}i32 @llvm.vector.reduce.or.v16i32(<16 x i32> %{{.*}})
7879
return _mm512_reduce_or_epi32(__W);
7980
}
8081
TEST_CONSTEXPR(_mm512_reduce_or_epi32((__m512i)(__v16si){0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0, 0, 0, 0, 0, 0, 0, 0}) == 0xFF);
8182

8283
int test_mm512_reduce_and_epi32(__m512i __W){
83-
// CHECK-LABEL: @test_mm512_reduce_and_epi32(
84-
// CHECK: call i32 @llvm.vector.reduce.and.v16i32(<16 x i32> %{{.*}})
84+
// CHECK-LABEL: test_mm512_reduce_and_epi32
85+
// CHECK: call {{.*}}i32 @llvm.vector.reduce.and.v16i32(<16 x i32> %{{.*}})
8586
return _mm512_reduce_and_epi32(__W);
8687
}
8788
TEST_CONSTEXPR(_mm512_reduce_and_epi32((__m512i)(__v16si){0xFF, 0xF0, 0x0F, 0xFF, 0xFF, 0xFF, 0xF0, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0x0F, 0x0F}) == 0x00);
8889

8990
int test_mm512_mask_reduce_add_epi32(__mmask16 __M, __m512i __W){
90-
// CHECK-LABEL: @test_mm512_mask_reduce_add_epi32(
91+
// CHECK-LABEL: test_mm512_mask_reduce_add_epi32
9192
// CHECK: select <16 x i1> %{{.*}}, <16 x i32> %{{.*}}, <16 x i32> %{{.*}}
92-
// CHECK: call i32 @llvm.vector.reduce.add.v16i32(<16 x i32> %{{.*}})
93+
// CHECK: call {{.*}}i32 @llvm.vector.reduce.add.v16i32(<16 x i32> %{{.*}})
9394
return _mm512_mask_reduce_add_epi32(__M, __W);
9495
}
9596

9697
int test_mm512_mask_reduce_mul_epi32(__mmask16 __M, __m512i __W){
97-
// CHECK-LABEL: @test_mm512_mask_reduce_mul_epi32(
98+
// CHECK-LABEL: test_mm512_mask_reduce_mul_epi32
9899
// CHECK: select <16 x i1> %{{.*}}, <16 x i32> %{{.*}}, <16 x i32> %{{.*}}
99-
// CHECK: call i32 @llvm.vector.reduce.mul.v16i32(<16 x i32> %{{.*}})
100+
// CHECK: call {{.*}}i32 @llvm.vector.reduce.mul.v16i32(<16 x i32> %{{.*}})
100101
return _mm512_mask_reduce_mul_epi32(__M, __W);
101102
}
102103

103104
int test_mm512_mask_reduce_and_epi32(__mmask16 __M, __m512i __W){
104-
// CHECK-LABEL: @test_mm512_mask_reduce_and_epi32(
105+
// CHECK-LABEL: test_mm512_mask_reduce_and_epi32
105106
// CHECK: select <16 x i1> %{{.*}}, <16 x i32> %{{.*}}, <16 x i32> %{{.*}}
106-
// CHECK: call i32 @llvm.vector.reduce.and.v16i32(<16 x i32> %{{.*}})
107+
// CHECK: call {{.*}}i32 @llvm.vector.reduce.and.v16i32(<16 x i32> %{{.*}})
107108
return _mm512_mask_reduce_and_epi32(__M, __W);
108109
}
109110

110111
int test_mm512_mask_reduce_or_epi32(__mmask16 __M, __m512i __W){
111-
// CHECK-LABEL: @test_mm512_mask_reduce_or_epi32(
112+
// CHECK-LABEL: test_mm512_mask_reduce_or_epi32
112113
// CHECK: select <16 x i1> %{{.*}}, <16 x i32> %{{.*}}, <16 x i32> %{{.*}}
113-
// CHECK: call i32 @llvm.vector.reduce.or.v16i32(<16 x i32> %{{.*}})
114+
// CHECK: call {{.*}}i32 @llvm.vector.reduce.or.v16i32(<16 x i32> %{{.*}})
114115
return _mm512_mask_reduce_or_epi32(__M, __W);
115116
}
116117

117118
double test_mm512_reduce_add_pd(__m512d __W, double ExtraAddOp){
118-
// CHECK-LABEL: @test_mm512_reduce_add_pd(
119+
// CHECK-LABEL: test_mm512_reduce_add_pd
119120
// CHECK-NOT: reassoc
120-
// CHECK: call reassoc double @llvm.vector.reduce.fadd.v8f64(double -0.000000e+00, <8 x double> %{{.*}})
121+
// CHECK: call reassoc {{.*}}double @llvm.vector.reduce.fadd.v8f64(double -0.000000e+00, <8 x double> %{{.*}})
121122
// CHECK-NOT: reassoc
122123
return _mm512_reduce_add_pd(__W) + ExtraAddOp;
123124
}
124125

125126
double test_mm512_reduce_mul_pd(__m512d __W, double ExtraMulOp){
126-
// CHECK-LABEL: @test_mm512_reduce_mul_pd(
127+
// CHECK-LABEL: test_mm512_reduce_mul_pd
127128
// CHECK-NOT: reassoc
128-
// CHECK: call reassoc double @llvm.vector.reduce.fmul.v8f64(double 1.000000e+00, <8 x double> %{{.*}})
129+
// CHECK: call reassoc {{.*}}double @llvm.vector.reduce.fmul.v8f64(double 1.000000e+00, <8 x double> %{{.*}})
129130
// CHECK-NOT: reassoc
130131
return _mm512_reduce_mul_pd(__W) * ExtraMulOp;
131132
}
132133

133134
float test_mm512_reduce_add_ps(__m512 __W){
134-
// CHECK-LABEL: @test_mm512_reduce_add_ps(
135-
// CHECK: call reassoc float @llvm.vector.reduce.fadd.v16f32(float -0.000000e+00, <16 x float> %{{.*}})
135+
// CHECK-LABEL: test_mm512_reduce_add_ps
136+
// CHECK: call reassoc {{.*}}float @llvm.vector.reduce.fadd.v16f32(float -0.000000e+00, <16 x float> %{{.*}})
136137
return _mm512_reduce_add_ps(__W);
137138
}
138139

139140
float test_mm512_reduce_mul_ps(__m512 __W){
140-
// CHECK-LABEL: @test_mm512_reduce_mul_ps(
141-
// CHECK: call reassoc float @llvm.vector.reduce.fmul.v16f32(float 1.000000e+00, <16 x float> %{{.*}})
141+
// CHECK-LABEL: test_mm512_reduce_mul_ps
142+
// CHECK: call reassoc {{.*}}float @llvm.vector.reduce.fmul.v16f32(float 1.000000e+00, <16 x float> %{{.*}})
142143
return _mm512_reduce_mul_ps(__W);
143144
}
144145

145146
double test_mm512_mask_reduce_add_pd(__mmask8 __M, __m512d __W){
146-
// CHECK-LABEL: @test_mm512_mask_reduce_add_pd(
147+
// CHECK-LABEL: test_mm512_mask_reduce_add_pd
147148
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
148-
// CHECK: call reassoc double @llvm.vector.reduce.fadd.v8f64(double -0.000000e+00, <8 x double> %{{.*}})
149+
// CHECK: call reassoc {{.*}}double @llvm.vector.reduce.fadd.v8f64(double -0.000000e+00, <8 x double> %{{.*}})
149150
return _mm512_mask_reduce_add_pd(__M, __W);
150151
}
151152

152153
double test_mm512_mask_reduce_mul_pd(__mmask8 __M, __m512d __W){
153-
// CHECK-LABEL: @test_mm512_mask_reduce_mul_pd(
154+
// CHECK-LABEL: test_mm512_mask_reduce_mul_pd
154155
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
155-
// CHECK: call reassoc double @llvm.vector.reduce.fmul.v8f64(double 1.000000e+00, <8 x double> %{{.*}})
156+
// CHECK: call reassoc {{.*}}double @llvm.vector.reduce.fmul.v8f64(double 1.000000e+00, <8 x double> %{{.*}})
156157
return _mm512_mask_reduce_mul_pd(__M, __W);
157158
}
158159

159160
float test_mm512_mask_reduce_add_ps(__mmask16 __M, __m512 __W){
160-
// CHECK-LABEL: @test_mm512_mask_reduce_add_ps(
161+
// CHECK-LABEL: test_mm512_mask_reduce_add_ps
161162
// CHECK: select <16 x i1> %{{.*}}, <16 x float> {{.*}}, <16 x float> {{.*}}
162-
// CHECK: call reassoc float @llvm.vector.reduce.fadd.v16f32(float -0.000000e+00, <16 x float> %{{.*}})
163+
// CHECK: call reassoc {{.*}}float @llvm.vector.reduce.fadd.v16f32(float -0.000000e+00, <16 x float> %{{.*}})
163164
return _mm512_mask_reduce_add_ps(__M, __W);
164165
}
165166

166167
float test_mm512_mask_reduce_mul_ps(__mmask16 __M, __m512 __W){
167-
// CHECK-LABEL: @test_mm512_mask_reduce_mul_ps(
168+
// CHECK-LABEL: test_mm512_mask_reduce_mul_ps
168169
// CHECK: select <16 x i1> %{{.*}}, <16 x float> {{.*}}, <16 x float> %{{.*}}
169-
// CHECK: call reassoc float @llvm.vector.reduce.fmul.v16f32(float 1.000000e+00, <16 x float> %{{.*}})
170+
// CHECK: call reassoc {{.*}}float @llvm.vector.reduce.fmul.v16f32(float 1.000000e+00, <16 x float> %{{.*}})
170171
return _mm512_mask_reduce_mul_ps(__M, __W);
171172
}

0 commit comments

Comments
 (0)