Skip to content

Commit 712c90e

Browse files
committed
[clang][x86] Add constexpr support for _mm_cvtsi64_sd
1 parent cb90d5b commit 712c90e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

clang/lib/Headers/emmintrin.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3272,8 +3272,8 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmplt_epi32(__m128i __a,
32723272
/// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the
32733273
/// converted value of the second operand. The upper 64 bits are copied from
32743274
/// the upper 64 bits of the first operand.
3275-
static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cvtsi64_sd(__m128d __a,
3276-
long long __b) {
3275+
static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
3276+
_mm_cvtsi64_sd(__m128d __a, long long __b) {
32773277
__a[0] = __b;
32783278
return __a;
32793279
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,7 @@ __m128d test_mm_cvtsi64_sd(__m128d A, long long B) {
610610
// X64: insertelement <2 x double> %{{.*}}, double %{{.*}}, i32 0
611611
return _mm_cvtsi64_sd(A, B);
612612
}
613+
TEST_CONSTEXPR(match_m128d(_mm_cvtsi64_sd((__m128d){-42.0, +99.0}, 55), +55.0, +99.0));
613614
#endif
614615

615616
__m128i test_mm_cvtsi64_si128(long long A) {

0 commit comments

Comments
 (0)