r301637 - [X86][SSE] Add _mm_set_pd1 (PR32827)

Simon Pilgrim via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 28 03:28:32 PDT 2017


Author: rksimon
Date: Fri Apr 28 05:28:32 2017
New Revision: 301637

URL: http://llvm.org/viewvc/llvm-project?rev=301637&view=rev
Log:
[X86][SSE] Add _mm_set_pd1 (PR32827)

Matches _mm_set_ps1 implementation

Modified:
    cfe/trunk/lib/Headers/emmintrin.h
    cfe/trunk/test/CodeGen/sse2-builtins.c

Modified: cfe/trunk/lib/Headers/emmintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/emmintrin.h?rev=301637&r1=301636&r2=301637&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/emmintrin.h (original)
+++ cfe/trunk/lib/Headers/emmintrin.h Fri Apr 28 05:28:32 2017
@@ -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.
 ///

Modified: cfe/trunk/test/CodeGen/sse2-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse2-builtins.c?rev=301637&r1=301636&r2=301637&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/sse2-builtins.c (original)
+++ cfe/trunk/test/CodeGen/sse2-builtins.c Fri Apr 28 05:28:32 2017
@@ -951,6 +951,13 @@ __m128d test_mm_set_pd(double A, double
   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




More information about the cfe-commits mailing list