]> granicus.if.org Git - clang/commitdiff
[AVX512] Add unaligned FP load intrinsics
authorAdam Nemet <anemet@apple.com>
Thu, 31 Jul 2014 04:00:39 +0000 (04:00 +0000)
committerAdam Nemet <anemet@apple.com>
Thu, 31 Jul 2014 04:00:39 +0000 (04:00 +0000)
Part of <rdar://problem/17688758>

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

lib/Headers/avx512fintrin.h
test/CodeGen/avx512f-builtins.c

index 690638ae5535e640d05cb8215409cd365aa257b5..c205662c164e26a3025804dc154983efa100b18d 100644 (file)
@@ -791,6 +791,24 @@ _mm512_maskz_loadu_pd(__mmask8 __U, void const *__P)
                                                    (__mmask8) __U);
 }
 
+static __inline __m512d __attribute__((__always_inline__, __nodebug__))
+_mm512_loadu_pd(double const *__p)
+{
+  struct __loadu_pd {
+    __m512d __v;
+  } __attribute__((packed, may_alias));
+  return ((struct __loadu_pd*)__p)->__v;
+}
+
+static __inline __m512 __attribute__((__always_inline__, __nodebug__))
+_mm512_loadu_ps(float const *__p)
+{
+  struct __loadu_ps {
+    __m512 __v;
+  } __attribute__((packed, may_alias));
+  return ((struct __loadu_ps*)__p)->__v;
+}
+
 /* SIMD store ops */
 
 static __inline void __attribute__ ((__always_inline__, __nodebug__))
index 3281830787a6dd851d0f897ceed68043f69d8d7c..4c4a064ff5d056f9719e2e35b3c08f1de3d2e4fb 100644 (file)
@@ -89,6 +89,20 @@ void test_mm512_store_pd(void *p, __m512d a)
   _mm512_store_pd(p, a);
 }
 
+__m512 test_mm512_loadu_ps(void *p)
+{
+  // CHECK-LABEL: @test_mm512_loadu_ps
+  // CHECK: load <16 x float>* {{.*}}, align 1{{$}}
+  return _mm512_loadu_ps(p);
+}
+
+__m512d test_mm512_loadu_pd(void *p)
+{
+  // CHECK-LABEL: @test_mm512_loadu_pd
+  // CHECK: load <8 x double>* {{.*}}, align 1{{$}}
+  return _mm512_loadu_pd(p);
+}
+
 __m512d test_mm512_set1_pd(double d)
 {
   // CHECK-LABEL: @test_mm512_set1_pd