]> granicus.if.org Git - clang/commitdiff
[X86][SSE] Add _mm_set_pd1 (PR32827)
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 28 Apr 2017 10:28:32 +0000 (10:28 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 28 Apr 2017 10:28:32 +0000 (10:28 +0000)
Matches _mm_set_ps1 implementation

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301637 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Headers/emmintrin.h
test/CodeGen/sse2-builtins.c

index 0dfa6a9fbc1f6eca3c0c874bdc018d5122bb23fb..13b0db22ec4424d80d3de60cab5a59fb48ce90b2 100644 (file)
@@ -1750,6 +1750,24 @@ _mm_set1_pd(double __w)
   return (__m128d){ __w, __w };
 }
 
+/// \brief Constructs a 128-bit floating-point vector of [2 x double], with each
+///    of the two double-precision floating-point vector elements set to the
+///    specified double-precision floating-point value.
+///
+/// \headerfile <x86intrin.h>
+///
+/// This intrinsic corresponds to the <c> VMOVDDUP / MOVLHPS </c> instruction.
+///
+/// \param __w
+///    A double-precision floating-point value used to initialize each vector
+///    element of the result.
+/// \returns An initialized 128-bit floating-point vector of [2 x double].
+static __inline__ __m128d __DEFAULT_FN_ATTRS
+_mm_set_pd1(double __w)
+{
+  return _mm_set1_pd(__w);
+}
+
 /// \brief Constructs a 128-bit floating-point vector of [2 x double]
 ///    initialized with the specified double-precision floating-point values.
 ///
index a140a6ce55b518fe6c3c30f34f8b7aacce138122..ca51314d80b867f6db412c9dc951fb2e871eebc3 100644 (file)
@@ -951,6 +951,13 @@ __m128d test_mm_set_pd(double A, double B) {
   return _mm_set_pd(A, B);
 }
 
+__m128d test_mm_set_pd1(double A) {
+  // CHECK-LABEL: test_mm_set_pd1
+  // CHECK: insertelement <2 x double> undef, double %{{.*}}, i32 0
+  // CHECK: insertelement <2 x double> %{{.*}}, double %{{.*}}, i32 1
+  return _mm_set_pd1(A);
+}
+
 __m128d test_mm_set_sd(double A) {
   // CHECK-LABEL: test_mm_set_sd
   // CHECK: insertelement <2 x double> undef, double %{{.*}}, i32 0