llvm-project/clang/lib
Craig Topper be4cbe8726 [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
2019-02-08 19:45:08 +00:00
..
ARCMigrate [AST] Update the comments of the various Expr::Ignore* + Related cleanups 2019-02-03 19:50:56 +00:00
AST [AST] Fix structural inequivalence of operators 2019-02-08 08:55:32 +00:00
ASTMatchers Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Analysis [analyzer] [RetainCountChecker] Bugfix: in non-OSObject-mode, do not track CXX method calls 2019-02-05 22:26:44 +00:00
Basic bpf: teach BPF driver about the new CPU "v3" 2019-02-07 22:51:56 +00:00
CodeGen [opaque pointer types] Cleanup CGBuilder's Create*GEP. 2019-02-08 15:34:12 +00:00
CrossTU Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Driver [clang-cl] support /Oy- on aarch64 2019-02-07 12:46:49 +00:00
Edit Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Format [Format/ObjC] Fix [foo bar]->baz formatting as lambda arrow 2019-02-08 15:55:18 +00:00
Frontend [OPENMP]Delay emission of the error messages for the exceptions. 2019-02-08 18:02:25 +00:00
FrontendTool [analyzer][NFC] Supply CheckerRegistry with AnalyzerOptions 2019-01-26 15:59:21 +00:00
Headers [X86] Add explicit alignment to __m128/__m128i/__m128d/etc. to allow matching of MSVC behavior with #pragma pack. 2019-02-08 19:45:08 +00:00
Index Rename getTypeQualifiers to getMethodQualifiers. 2019-01-28 11:37:49 +00:00
Lex [Preprocessor] Add a note with framework location for "file not found" error. 2019-02-05 22:34:55 +00:00
Parse [OpenCL][PR40603] In C++ preserve compatibility with OpenCL C v2.0 2019-02-07 17:32:37 +00:00
Rewrite Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Sema [OPENMP]Delay emission of the error messages for the exceptions. 2019-02-08 18:02:25 +00:00
Serialization [modules] Fix handling of initializers for templated global variables. 2019-02-05 23:37:13 +00:00
StaticAnalyzer Move the SMT API to LLVM 2019-02-07 03:19:45 +00:00
Tooling Switch to cantFail(), since it does the same assertion. 2019-02-06 17:59:39 +00:00
CMakeLists.txt Add Cross Translation Unit support library 2017-09-22 11:11:01 +00:00