From 56545d209ec455ef171e53da8e80306de3659d3d Mon Sep 17 00:00:00 2001 From: Zvi Rackover Date: Sat, 18 Jun 2016 20:01:07 +0000 Subject: [PATCH] [X86] _MM_ALIGN16 attribute support for non-windows targets Summary: This patch adds support for the _MM_ALIGN16 attribute on non-windows targets. This aligns Clang with ICC which supports the attribute on all targets. Fixes PR28056 Reviewers: aaboud, echristo, cfe-commits, mkuper Subscribers: zvi, mehdi_amini Projects: #clang-c Differential Revision: http://reviews.llvm.org/D21173 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273095 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Headers/xmmintrin.h | 4 +--- test/Headers/xmmintrin.c | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Headers/xmmintrin.h b/lib/Headers/xmmintrin.h index ce32d5a9d7..8d94181a18 100644 --- a/lib/Headers/xmmintrin.h +++ b/lib/Headers/xmmintrin.h @@ -2821,9 +2821,7 @@ _mm_movemask_ps(__m128 __a) } -#ifdef _MSC_VER -#define _MM_ALIGN16 __declspec(align(16)) -#endif +#define _MM_ALIGN16 __attribute__((aligned(16))) #define _MM_SHUFFLE(z, y, x, w) (((z) << 6) | ((y) << 4) | ((x) << 2) | (w)) diff --git a/test/Headers/xmmintrin.c b/test/Headers/xmmintrin.c index 9e15f3ba46..c617504b85 100644 --- a/test/Headers/xmmintrin.c +++ b/test/Headers/xmmintrin.c @@ -7,6 +7,9 @@ // REQUIRES: x86-registered-target #include +// CHECK: @c = common global i8 0, align 16 +_MM_ALIGN16 char c; + // Make sure the last step of _mm_cvtps_pi16 converts <4 x i32> to <4 x i16> by // checking that clang emits PACKSSDW instead of PACKSSWB. -- 2.50.1