Skip to content

Commit f6a6971

Browse files
author
git apple-llvm automerger
committed
Merge commit 'b1788211d375' from llvm.org/main into next
2 parents e92c03c + b178821 commit f6a6971

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

clang/lib/Headers/avx512fp16intrin.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,17 +193,17 @@ _mm512_castsi512_ph(__m512i __a) {
193193
return (__m512h)__a;
194194
}
195195

196-
static __inline__ __m128h __DEFAULT_FN_ATTRS256
196+
static __inline__ __m128h __DEFAULT_FN_ATTRS256_CONSTEXPR
197197
_mm256_castph256_ph128(__m256h __a) {
198198
return __builtin_shufflevector(__a, __a, 0, 1, 2, 3, 4, 5, 6, 7);
199199
}
200200

201-
static __inline__ __m128h __DEFAULT_FN_ATTRS512
201+
static __inline__ __m128h __DEFAULT_FN_ATTRS512_CONSTEXPR
202202
_mm512_castph512_ph128(__m512h __a) {
203203
return __builtin_shufflevector(__a, __a, 0, 1, 2, 3, 4, 5, 6, 7);
204204
}
205205

206-
static __inline__ __m256h __DEFAULT_FN_ATTRS512
206+
static __inline__ __m256h __DEFAULT_FN_ATTRS512_CONSTEXPR
207207
_mm512_castph512_ph256(__m512h __a) {
208208
return __builtin_shufflevector(__a, __a, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
209209
12, 13, 14, 15);

clang/test/CodeGen/X86/avx512fp16-builtins.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,18 +341,21 @@ __m128h test_mm256_castph256_ph128(__m256h __a) {
341341
// CHECK: shufflevector <16 x half> %{{.*}}, <16 x half> %{{.*}}, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
342342
return _mm256_castph256_ph128(__a);
343343
}
344+
TEST_CONSTEXPR(match_m128h(_mm256_castph256_ph128((__m256h){-1.0, 2.0, -3.0, 4.0, -5.0, 6.0, -7.0, 8.0, -9.0, 10.0, -11.0, 12.0, -13.0, 14.0, -15.0, -16.0}), -1.0, 2.0, -3.0, 4.0, -5.0, 6.0, -7.0, 8.0));
344345

345346
__m128h test_mm512_castph512_ph128(__m512h __a) {
346347
// CHECK-LABEL: test_mm512_castph512_ph128
347348
// CHECK: shufflevector <32 x half> %{{.*}}, <32 x half> %{{.*}}, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
348349
return _mm512_castph512_ph128(__a);
349350
}
351+
TEST_CONSTEXPR(match_m128h(_mm512_castph512_ph128((__m512h){0.0, -1.0, 2.0, -3.0, 4.0, -5.0, 6.0, -7.0, 8.0, -9.0, 10.0, -11.0, 12.0, -13.0, 14.0, -15.0, -16.0, -17.0, 18.0, -19.0, 20.0, -21.0, 22.0, -23.0, 24.0, -25.0, 26.0, -27.0, 28.0, -29.0, 30.0, -31.0}), 0.0, -1.0, 2.0, -3.0, 4.0, -5.0, 6.0, -7.0));
350352

351353
__m256h test_mm512_castph512_ph256(__m512h __a) {
352354
// CHECK-LABEL: test_mm512_castph512_ph256
353355
// CHECK: shufflevector <32 x half> %{{.*}}, <32 x half> %{{.*}}, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
354356
return _mm512_castph512_ph256(__a);
355357
}
358+
TEST_CONSTEXPR(match_m256h(_mm512_castph512_ph256((__m512h){-1.0, 2.0, -3.0, 4.0, -5.0, 6.0, -7.0, 8.0, -9.0, 10.0, -11.0, 12.0, -13.0, 14.0, -15.0, -16.0, -17.0, 18.0, -19.0, 20.0, -21.0, 22.0, -23.0, 24.0, -25.0, 26.0, -27.0, 28.0, -29.0, 30.0, -31.0, 32.0}), -1.0, 2.0, -3.0, 4.0, -5.0, 6.0, -7.0, 8.0, -9.0, 10.0, -11.0, 12.0, -13.0, 14.0, -15.0, -16.0));
356359

357360
__m256h test_mm256_castph128_ph256(__m128h __a) {
358361
// CHECK-LABEL: test_mm256_castph128_ph256

0 commit comments

Comments
 (0)