[PATCH] D21504: [X86] add _mm_loadu_si64

Asaf Badouh via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 19 06:06:15 PDT 2016


AsafBadouh created this revision.
AsafBadouh added reviewers: delena, igorb, m_zuckerman.
AsafBadouh added a subscriber: cfe-commits.
AsafBadouh set the repository for this revision to rL LLVM.

Repository:
  rL LLVM

http://reviews.llvm.org/D21504

Files:
  tools/clang/lib/Headers/emmintrin.h
  tools/clang/test/CodeGen/sse2-builtins.c

Index: tools/clang/lib/Headers/emmintrin.h
===================================================================
--- tools/clang/lib/Headers/emmintrin.h
+++ tools/clang/lib/Headers/emmintrin.h
@@ -505,6 +505,16 @@
   return ((struct __loadu_pd*)__dp)->__v;
 }
 
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_loadu_si64(void const *__a)
+{
+  struct __loadu_si64 {
+    long long __v;
+  } __attribute__((__packed__, __may_alias__));
+  long long __u = ((struct __loadu_si64*)__a)->__v;
+  return (__m128i){__u, 0L};
+}
+
 static __inline__ __m128d __DEFAULT_FN_ATTRS
 _mm_load_sd(double const *__dp)
 {
Index: tools/clang/test/CodeGen/sse2-builtins.c
===================================================================
--- tools/clang/test/CodeGen/sse2-builtins.c
+++ tools/clang/test/CodeGen/sse2-builtins.c
@@ -1520,3 +1520,14 @@
   // CHECK: xor <2 x i64> %{{.*}}, %{{.*}}
   return _mm_xor_si128(A, B);
 }
+
+__m128i test_mm_loadu_si64(void const* A) {
+  // CHECK-LABEL: test_mm_loadu_si64
+  // CHECK: load i64, i64* %__u
+  // CHECK: insertelement <2 x i64> undef, i64 %4, i32 0
+  // CHECK: insertelement <2 x i64> %{{.*}}, i64 0, i32 1
+  // CHECK: store <2 x i64> %{{.*}}, <2 x i64>* %{{.*}}, align 16
+  // CHECK: load <2 x i64>, <2 x i64>* %{{.*}}, align 16
+  return _mm_loadu_si64(A);
+}
+


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21504.61199.patch
Type: text/x-patch
Size: 1337 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160619/24614aef/attachment-0001.bin>


More information about the cfe-commits mailing list