From eed92a18829575f316313659d6294fd2ef275838 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 13 May 2011 00:11:39 +0000 Subject: [PATCH] Represent the unaligned loads natively. These are converted into a call to the correct unaligned load. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131268 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Headers/emmintrin.h | 10 ++++++++-- lib/Headers/xmmintrin.h | 5 ++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/Headers/emmintrin.h b/lib/Headers/emmintrin.h index 746e717a30..b2aae8eae9 100644 --- a/lib/Headers/emmintrin.h +++ b/lib/Headers/emmintrin.h @@ -466,7 +466,10 @@ _mm_loadr_pd(double const *dp) static __inline__ __m128d __attribute__((__always_inline__, __nodebug__)) _mm_loadu_pd(double const *dp) { - return __builtin_ia32_loadupd(dp); + struct __loadu_pd { + __m128d v; + } __attribute__((packed)); + return ((struct __loadu_pd*)dp)->v; } static __inline__ __m128d __attribute__((__always_inline__, __nodebug__)) @@ -1011,7 +1014,10 @@ _mm_load_si128(__m128i const *p) static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) _mm_loadu_si128(__m128i const *p) { - return (__m128i)__builtin_ia32_loaddqu((char const *)p); + struct __loadu_si128 { + __m128i v; + } __attribute__((packed)); + return ((struct __loadu_si128*)p)->v; } static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) diff --git a/lib/Headers/xmmintrin.h b/lib/Headers/xmmintrin.h index 42dd3e8d3b..f3e9409b85 100644 --- a/lib/Headers/xmmintrin.h +++ b/lib/Headers/xmmintrin.h @@ -539,7 +539,10 @@ _mm_load_ps(const float *p) static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) _mm_loadu_ps(const float *p) { - return __builtin_ia32_loadups(p); + struct __loadu_ps { + __m128 v; + } __attribute__((packed)); + return ((struct __loadu_ps*)p)->v; } static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) -- 2.40.0