]> granicus.if.org Git - clang/commitdiff
[X86] add _mm_loadu_si64
authorAsaf Badouh <asaf.badouh@intel.com>
Sun, 26 Jun 2016 13:51:54 +0000 (13:51 +0000)
committerAsaf Badouh <asaf.badouh@intel.com>
Sun, 26 Jun 2016 13:51:54 +0000 (13:51 +0000)
Differential Revision: http://reviews.llvm.org/D21504

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

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

index 0c2c8546ac326d9e96f559aea1f639f00cade026..22eb02c691193703af30c26a0c16f21e27436e0d 100644 (file)
@@ -505,6 +505,16 @@ _mm_loadu_pd(double const *__dp)
   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 782dbee1a3dd136505226af1bf7c4527f8026ed0..d5aae2276ade04e208be109989e5ab7ccd77dab8 100644 (file)
@@ -1532,3 +1532,12 @@ __m128i test_mm_xor_si128(__m128i A, __m128i B) {
   // 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* %{{.*}}, align 1{{$}}
+  // CHECK: insertelement <2 x i64> undef, i64 %{{.*}}, i32 0
+  // CHECK: insertelement <2 x i64> %{{.*}}, i64 0, i32 1
+  return _mm_loadu_si64(A);
+}
+