]> granicus.if.org Git - clang/commitdiff
Represent the unaligned loads natively. These are converted into a call to the
authorBill Wendling <isanbard@gmail.com>
Fri, 13 May 2011 00:11:39 +0000 (00:11 +0000)
committerBill Wendling <isanbard@gmail.com>
Fri, 13 May 2011 00:11:39 +0000 (00:11 +0000)
correct unaligned load.

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

lib/Headers/emmintrin.h
lib/Headers/xmmintrin.h

index 746e717a3098e714893c65c5b79bf04b72ead51f..b2aae8eae925a1fd1b4e89eb0dff9bc47e84fa15 100644 (file)
@@ -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__))
index 42dd3e8d3b8787aabf9ad222d04564bf2f628702..f3e9409b85b9d3aa5058bfcf2e109ce261cbd33c 100644 (file)
@@ -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__))