]> granicus.if.org Git - clang/commitdiff
[X86] _MM_ALIGN16 attribute support for non-windows targets
authorZvi Rackover <zvi.rackover@intel.com>
Sat, 18 Jun 2016 20:01:07 +0000 (20:01 +0000)
committerZvi Rackover <zvi.rackover@intel.com>
Sat, 18 Jun 2016 20:01:07 +0000 (20:01 +0000)
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
test/Headers/xmmintrin.c

index ce32d5a9d7a8d2d94bb79c637d9fb5341268435e..8d94181a1814842fd17170c7db2ef8e8ea24cd35 100644 (file)
@@ -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))
 
index 9e15f3ba4649b0dea22876c7f7fed2157c6ffff5..c617504b85da575f06ceb8561373b290bc082f0b 100644 (file)
@@ -7,6 +7,9 @@
 // REQUIRES: x86-registered-target
 #include <xmmintrin.h>
 
+// 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.