From: Adam Nemet Date: Thu, 31 Jul 2014 04:00:39 +0000 (+0000) Subject: [AVX512] Add unaligned FP load intrinsics X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8745a3dc0a0f7f5a564c54ebf1512a364e99bea9;p=clang [AVX512] Add unaligned FP load intrinsics Part of git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214380 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Headers/avx512fintrin.h b/lib/Headers/avx512fintrin.h index 690638ae55..c205662c16 100644 --- a/lib/Headers/avx512fintrin.h +++ b/lib/Headers/avx512fintrin.h @@ -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__)) diff --git a/test/CodeGen/avx512f-builtins.c b/test/CodeGen/avx512f-builtins.c index 3281830787..4c4a064ff5 100644 --- a/test/CodeGen/avx512f-builtins.c +++ b/test/CodeGen/avx512f-builtins.c @@ -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