summaryrefslogtreecommitdiffstats
path: root/clang/lib/Headers/mmintrin.h
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2019-02-08 19:45:08 +0000
committerCraig Topper <craig.topper@intel.com>2019-02-08 19:45:08 +0000
commitbe4cbe87268dc7962ca08b9af9b79b51cbdf69a0 (patch)
treee36eccb8b09f0f5506fcc751d95c1a6399d47966 /clang/lib/Headers/mmintrin.h
parent297b6a2b6ea68a0a5cda92c785abf292ac571683 (diff)
downloadbcm5719-llvm-be4cbe87268dc7962ca08b9af9b79b51cbdf69a0.tar.gz
bcm5719-llvm-be4cbe87268dc7962ca08b9af9b79b51cbdf69a0.zip
[X86] Add explicit alignment to __m128/__m128i/__m128d/etc. to allow matching of MSVC behavior with #pragma pack.
Summary: With MSVC, #pragma pack is ignored when there is explicit alignment. This differs from gcc. Clang emulates this difference when compiling for Windows. It appears that MSVC and its headers consider the __m128/__m128i/__m128d/etc. types to be explicitly aligned and ignores #pragma pack for them. Since we don't have explicit alignment on them in our headers, we don't match the MSVC behavior here. This patch adds explicit alignment to match this behavior. I'm hoping this won't cause any problems when we're not emulating MSVC. But if someone knows of something that would be different we can swith to conditionally adding the alignment based on _MSC_VER. I had to add explicitly unaligned types as well so we could use them in the loadu/storeu intrinsics which use __attribute__(__packed__). Using the now explicitly aligned types wouldn't produce align 1 accesses when targeting Windows. Reviewers: rnk, erichkeane, spatel, RKSimon Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57961 llvm-svn: 353555
Diffstat (limited to 'clang/lib/Headers/mmintrin.h')
-rw-r--r--clang/lib/Headers/mmintrin.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Headers/mmintrin.h b/clang/lib/Headers/mmintrin.h
index a73539942a9..5dc304e451d 100644
--- a/clang/lib/Headers/mmintrin.h
+++ b/clang/lib/Headers/mmintrin.h
@@ -24,7 +24,7 @@
#ifndef __MMINTRIN_H
#define __MMINTRIN_H
-typedef long long __m64 __attribute__((__vector_size__(8)));
+typedef long long __m64 __attribute__((__vector_size__(8), __aligned__(8)));
typedef long long __v1di __attribute__((__vector_size__(8)));
typedef int __v2si __attribute__((__vector_size__(8)));
OpenPOWER on IntegriCloud