Skip to content

Commit 55b9024

Browse files
author
rksimon
committed
[X86][SSE] Add _mm_set_pd1 (PR32827)
Matches _mm_set_ps1 implementation git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@301637 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 2c1ca93 commit 55b9024

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

lib/Headers/emmintrin.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,6 +1750,24 @@ _mm_set1_pd(double __w)
17501750
return (__m128d){ __w, __w };
17511751
}
17521752

1753+
/// \brief Constructs a 128-bit floating-point vector of [2 x double], with each
1754+
/// of the two double-precision floating-point vector elements set to the
1755+
/// specified double-precision floating-point value.
1756+
///
1757+
/// \headerfile <x86intrin.h>
1758+
///
1759+
/// This intrinsic corresponds to the <c> VMOVDDUP / MOVLHPS </c> instruction.
1760+
///
1761+
/// \param __w
1762+
/// A double-precision floating-point value used to initialize each vector
1763+
/// element of the result.
1764+
/// \returns An initialized 128-bit floating-point vector of [2 x double].
1765+
static __inline__ __m128d __DEFAULT_FN_ATTRS
1766+
_mm_set_pd1(double __w)
1767+
{
1768+
return _mm_set1_pd(__w);
1769+
}
1770+
17531771
/// \brief Constructs a 128-bit floating-point vector of [2 x double]
17541772
/// initialized with the specified double-precision floating-point values.
17551773
///

test/CodeGen/sse2-builtins.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,13 @@ __m128d test_mm_set_pd(double A, double B) {
951951
return _mm_set_pd(A, B);
952952
}
953953

954+
__m128d test_mm_set_pd1(double A) {
955+
// CHECK-LABEL: test_mm_set_pd1
956+
// CHECK: insertelement <2 x double> undef, double %{{.*}}, i32 0
957+
// CHECK: insertelement <2 x double> %{{.*}}, double %{{.*}}, i32 1
958+
return _mm_set_pd1(A);
959+
}
960+
954961
__m128d test_mm_set_sd(double A) {
955962
// CHECK-LABEL: test_mm_set_sd
956963
// CHECK: insertelement <2 x double> undef, double %{{.*}}, i32 0

0 commit comments

Comments
 (0)