r353555 - [X86] Add explicit alignment to __m128/__m128i/__m128d/etc. to allow matching of MSVC behavior with #pragma pack.
Craig Topper via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 8 11:45:08 PST 2019
Author: ctopper
Date: Fri Feb 8 11:45:08 2019
New Revision: 353555
URL: http://llvm.org/viewvc/llvm-project?rev=353555&view=rev
Log:
[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
Added:
cfe/trunk/test/CodeGen/x86-vec-struct-packing.c
Modified:
cfe/trunk/lib/Headers/avx512bwintrin.h
cfe/trunk/lib/Headers/avx512fintrin.h
cfe/trunk/lib/Headers/avx512vlbwintrin.h
cfe/trunk/lib/Headers/avx512vlintrin.h
cfe/trunk/lib/Headers/avxintrin.h
cfe/trunk/lib/Headers/emmintrin.h
cfe/trunk/lib/Headers/mmintrin.h
cfe/trunk/lib/Headers/xmmintrin.h
Modified: cfe/trunk/lib/Headers/avx512bwintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512bwintrin.h?rev=353555&r1=353554&r2=353555&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512bwintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512bwintrin.h Fri Feb 8 11:45:08 2019
@@ -1751,7 +1751,7 @@ static __inline __m512i __DEFAULT_FN_ATT
_mm512_loadu_epi16 (void const *__P)
{
struct __loadu_epi16 {
- __m512i __v;
+ __m512i_u __v;
} __attribute__((__packed__, __may_alias__));
return ((struct __loadu_epi16*)__P)->__v;
}
@@ -1777,7 +1777,7 @@ static __inline __m512i __DEFAULT_FN_ATT
_mm512_loadu_epi8 (void const *__P)
{
struct __loadu_epi8 {
- __m512i __v;
+ __m512i_u __v;
} __attribute__((__packed__, __may_alias__));
return ((struct __loadu_epi8*)__P)->__v;
}
@@ -1803,7 +1803,7 @@ static __inline void __DEFAULT_FN_ATTRS5
_mm512_storeu_epi16 (void *__P, __m512i __A)
{
struct __storeu_epi16 {
- __m512i __v;
+ __m512i_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_epi16*)__P)->__v = __A;
}
@@ -1820,7 +1820,7 @@ static __inline void __DEFAULT_FN_ATTRS5
_mm512_storeu_epi8 (void *__P, __m512i __A)
{
struct __storeu_epi8 {
- __m512i __v;
+ __m512i_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_epi8*)__P)->__v = __A;
}
Modified: cfe/trunk/lib/Headers/avx512fintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512fintrin.h?rev=353555&r1=353554&r2=353555&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512fintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512fintrin.h Fri Feb 8 11:45:08 2019
@@ -40,9 +40,13 @@ typedef unsigned short __v32hu __attribu
typedef unsigned long long __v8du __attribute__((__vector_size__(64)));
typedef unsigned int __v16su __attribute__((__vector_size__(64)));
-typedef float __m512 __attribute__((__vector_size__(64)));
-typedef double __m512d __attribute__((__vector_size__(64)));
-typedef long long __m512i __attribute__((__vector_size__(64)));
+typedef float __m512 __attribute__((__vector_size__(64), __aligned__(64)));
+typedef double __m512d __attribute__((__vector_size__(64), __aligned__(64)));
+typedef long long __m512i __attribute__((__vector_size__(64), __aligned__(64)));
+
+typedef float __m512_u __attribute__((__vector_size__(64), __aligned__(1)));
+typedef double __m512d_u __attribute__((__vector_size__(64), __aligned__(1)));
+typedef long long __m512i_u __attribute__((__vector_size__(64), __aligned__(1)));
typedef unsigned char __mmask8;
typedef unsigned short __mmask16;
@@ -4324,7 +4328,7 @@ static __inline __m512i __DEFAULT_FN_ATT
_mm512_loadu_si512 (void const *__P)
{
struct __loadu_si512 {
- __m512i __v;
+ __m512i_u __v;
} __attribute__((__packed__, __may_alias__));
return ((struct __loadu_si512*)__P)->__v;
}
@@ -4333,7 +4337,7 @@ static __inline __m512i __DEFAULT_FN_ATT
_mm512_loadu_epi32 (void const *__P)
{
struct __loadu_epi32 {
- __m512i __v;
+ __m512i_u __v;
} __attribute__((__packed__, __may_alias__));
return ((struct __loadu_epi32*)__P)->__v;
}
@@ -4360,7 +4364,7 @@ static __inline __m512i __DEFAULT_FN_ATT
_mm512_loadu_epi64 (void const *__P)
{
struct __loadu_epi64 {
- __m512i __v;
+ __m512i_u __v;
} __attribute__((__packed__, __may_alias__));
return ((struct __loadu_epi64*)__P)->__v;
}
@@ -4420,7 +4424,7 @@ static __inline __m512d __DEFAULT_FN_ATT
_mm512_loadu_pd(void const *__p)
{
struct __loadu_pd {
- __m512d __v;
+ __m512d_u __v;
} __attribute__((__packed__, __may_alias__));
return ((struct __loadu_pd*)__p)->__v;
}
@@ -4429,7 +4433,7 @@ static __inline __m512 __DEFAULT_FN_ATTR
_mm512_loadu_ps(void const *__p)
{
struct __loadu_ps {
- __m512 __v;
+ __m512_u __v;
} __attribute__((__packed__, __may_alias__));
return ((struct __loadu_ps*)__p)->__v;
}
@@ -4504,7 +4508,7 @@ static __inline void __DEFAULT_FN_ATTRS5
_mm512_storeu_epi64 (void *__P, __m512i __A)
{
struct __storeu_epi64 {
- __m512i __v;
+ __m512i_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_epi64*)__P)->__v = __A;
}
@@ -4520,7 +4524,7 @@ static __inline void __DEFAULT_FN_ATTRS5
_mm512_storeu_si512 (void *__P, __m512i __A)
{
struct __storeu_si512 {
- __m512i __v;
+ __m512i_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_si512*)__P)->__v = __A;
}
@@ -4529,7 +4533,7 @@ static __inline void __DEFAULT_FN_ATTRS5
_mm512_storeu_epi32 (void *__P, __m512i __A)
{
struct __storeu_epi32 {
- __m512i __v;
+ __m512i_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_epi32*)__P)->__v = __A;
}
@@ -4551,7 +4555,7 @@ static __inline void __DEFAULT_FN_ATTRS5
_mm512_storeu_pd(void *__P, __m512d __A)
{
struct __storeu_pd {
- __m512d __v;
+ __m512d_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_pd*)__P)->__v = __A;
}
@@ -4567,7 +4571,7 @@ static __inline void __DEFAULT_FN_ATTRS5
_mm512_storeu_ps(void *__P, __m512 __A)
{
struct __storeu_ps {
- __m512 __v;
+ __m512_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_ps*)__P)->__v = __A;
}
Modified: cfe/trunk/lib/Headers/avx512vlbwintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512vlbwintrin.h?rev=353555&r1=353554&r2=353555&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512vlbwintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512vlbwintrin.h Fri Feb 8 11:45:08 2019
@@ -2301,7 +2301,7 @@ static __inline __m128i __DEFAULT_FN_ATT
_mm_loadu_epi16 (void const *__P)
{
struct __loadu_epi16 {
- __m128i __v;
+ __m128i_u __v;
} __attribute__((__packed__, __may_alias__));
return ((struct __loadu_epi16*)__P)->__v;
}
@@ -2327,7 +2327,7 @@ static __inline __m256i __DEFAULT_FN_ATT
_mm256_loadu_epi16 (void const *__P)
{
struct __loadu_epi16 {
- __m256i __v;
+ __m256i_u __v;
} __attribute__((__packed__, __may_alias__));
return ((struct __loadu_epi16*)__P)->__v;
}
@@ -2353,7 +2353,7 @@ static __inline __m128i __DEFAULT_FN_ATT
_mm_loadu_epi8 (void const *__P)
{
struct __loadu_epi8 {
- __m128i __v;
+ __m128i_u __v;
} __attribute__((__packed__, __may_alias__));
return ((struct __loadu_epi8*)__P)->__v;
}
@@ -2379,7 +2379,7 @@ static __inline __m256i __DEFAULT_FN_ATT
_mm256_loadu_epi8 (void const *__P)
{
struct __loadu_epi8 {
- __m256i __v;
+ __m256i_u __v;
} __attribute__((__packed__, __may_alias__));
return ((struct __loadu_epi8*)__P)->__v;
}
@@ -2405,7 +2405,7 @@ static __inline void __DEFAULT_FN_ATTRS1
_mm_storeu_epi16 (void *__P, __m128i __A)
{
struct __storeu_epi16 {
- __m128i __v;
+ __m128i_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_epi16*)__P)->__v = __A;
}
@@ -2422,7 +2422,7 @@ static __inline void __DEFAULT_FN_ATTRS2
_mm256_storeu_epi16 (void *__P, __m256i __A)
{
struct __storeu_epi16 {
- __m256i __v;
+ __m256i_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_epi16*)__P)->__v = __A;
}
@@ -2439,7 +2439,7 @@ static __inline void __DEFAULT_FN_ATTRS1
_mm_storeu_epi8 (void *__P, __m128i __A)
{
struct __storeu_epi8 {
- __m128i __v;
+ __m128i_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_epi8*)__P)->__v = __A;
}
@@ -2456,7 +2456,7 @@ static __inline void __DEFAULT_FN_ATTRS2
_mm256_storeu_epi8 (void *__P, __m256i __A)
{
struct __storeu_epi8 {
- __m256i __v;
+ __m256i_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_epi8*)__P)->__v = __A;
}
Modified: cfe/trunk/lib/Headers/avx512vlintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512vlintrin.h?rev=353555&r1=353554&r2=353555&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512vlintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512vlintrin.h Fri Feb 8 11:45:08 2019
@@ -5513,7 +5513,7 @@ static __inline __m128i __DEFAULT_FN_ATT
_mm_loadu_epi64 (void const *__P)
{
struct __loadu_epi64 {
- __m128i __v;
+ __m128i_u __v;
} __attribute__((__packed__, __may_alias__));
return ((struct __loadu_epi64*)__P)->__v;
}
@@ -5539,7 +5539,7 @@ static __inline __m256i __DEFAULT_FN_ATT
_mm256_loadu_epi64 (void const *__P)
{
struct __loadu_epi64 {
- __m256i __v;
+ __m256i_u __v;
} __attribute__((__packed__, __may_alias__));
return ((struct __loadu_epi64*)__P)->__v;
}
@@ -5565,7 +5565,7 @@ static __inline __m128i __DEFAULT_FN_ATT
_mm_loadu_epi32 (void const *__P)
{
struct __loadu_epi32 {
- __m128i __v;
+ __m128i_u __v;
} __attribute__((__packed__, __may_alias__));
return ((struct __loadu_epi32*)__P)->__v;
}
@@ -5591,7 +5591,7 @@ static __inline __m256i __DEFAULT_FN_ATT
_mm256_loadu_epi32 (void const *__P)
{
struct __loadu_epi32 {
- __m256i __v;
+ __m256i_u __v;
} __attribute__((__packed__, __may_alias__));
return ((struct __loadu_epi32*)__P)->__v;
}
@@ -5717,7 +5717,7 @@ static __inline void __DEFAULT_FN_ATTRS1
_mm_storeu_epi64 (void *__P, __m128i __A)
{
struct __storeu_epi64 {
- __m128i __v;
+ __m128i_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_epi64*)__P)->__v = __A;
}
@@ -5734,7 +5734,7 @@ static __inline void __DEFAULT_FN_ATTRS2
_mm256_storeu_epi64 (void *__P, __m256i __A)
{
struct __storeu_epi64 {
- __m256i __v;
+ __m256i_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_epi64*)__P)->__v = __A;
}
@@ -5751,7 +5751,7 @@ static __inline void __DEFAULT_FN_ATTRS1
_mm_storeu_epi32 (void *__P, __m128i __A)
{
struct __storeu_epi32 {
- __m128i __v;
+ __m128i_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_epi32*)__P)->__v = __A;
}
@@ -5768,7 +5768,7 @@ static __inline void __DEFAULT_FN_ATTRS2
_mm256_storeu_epi32 (void *__P, __m256i __A)
{
struct __storeu_epi32 {
- __m256i __v;
+ __m256i_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_epi32*)__P)->__v = __A;
}
Modified: cfe/trunk/lib/Headers/avxintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avxintrin.h?rev=353555&r1=353554&r2=353555&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avxintrin.h (original)
+++ cfe/trunk/lib/Headers/avxintrin.h Fri Feb 8 11:45:08 2019
@@ -45,9 +45,13 @@ typedef unsigned char __v32qu __attribut
* appear in the interface though. */
typedef signed char __v32qs __attribute__((__vector_size__(32)));
-typedef float __m256 __attribute__ ((__vector_size__ (32)));
-typedef double __m256d __attribute__((__vector_size__(32)));
-typedef long long __m256i __attribute__((__vector_size__(32)));
+typedef float __m256 __attribute__ ((__vector_size__ (32), __aligned__(32)));
+typedef double __m256d __attribute__((__vector_size__(32), __aligned__(32)));
+typedef long long __m256i __attribute__((__vector_size__(32), __aligned__(32)));
+
+typedef float __m256_u __attribute__ ((__vector_size__ (32), __aligned__(1)));
+typedef double __m256d_u __attribute__((__vector_size__(32), __aligned__(1)));
+typedef long long __m256i_u __attribute__((__vector_size__(32), __aligned__(1)));
/* Define the default attributes for the functions in this file. */
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx"), __min_vector_width__(256)))
@@ -3113,7 +3117,7 @@ static __inline __m256d __DEFAULT_FN_ATT
_mm256_loadu_pd(double const *__p)
{
struct __loadu_pd {
- __m256d __v;
+ __m256d_u __v;
} __attribute__((__packed__, __may_alias__));
return ((struct __loadu_pd*)__p)->__v;
}
@@ -3133,7 +3137,7 @@ static __inline __m256 __DEFAULT_FN_ATTR
_mm256_loadu_ps(float const *__p)
{
struct __loadu_ps {
- __m256 __v;
+ __m256_u __v;
} __attribute__((__packed__, __may_alias__));
return ((struct __loadu_ps*)__p)->__v;
}
@@ -3169,7 +3173,7 @@ static __inline __m256i __DEFAULT_FN_ATT
_mm256_loadu_si256(__m256i const *__p)
{
struct __loadu_si256 {
- __m256i __v;
+ __m256i_u __v;
} __attribute__((__packed__, __may_alias__));
return ((struct __loadu_si256*)__p)->__v;
}
@@ -3246,7 +3250,7 @@ static __inline void __DEFAULT_FN_ATTRS
_mm256_storeu_pd(double *__p, __m256d __a)
{
struct __storeu_pd {
- __m256d __v;
+ __m256d_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_pd*)__p)->__v = __a;
}
@@ -3266,7 +3270,7 @@ static __inline void __DEFAULT_FN_ATTRS
_mm256_storeu_ps(float *__p, __m256 __a)
{
struct __storeu_ps {
- __m256 __v;
+ __m256_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_ps*)__p)->__v = __a;
}
@@ -3304,7 +3308,7 @@ static __inline void __DEFAULT_FN_ATTRS
_mm256_storeu_si256(__m256i *__p, __m256i __a)
{
struct __storeu_si256 {
- __m256i __v;
+ __m256i_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_si256*)__p)->__v = __a;
}
Modified: cfe/trunk/lib/Headers/emmintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/emmintrin.h?rev=353555&r1=353554&r2=353555&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/emmintrin.h (original)
+++ cfe/trunk/lib/Headers/emmintrin.h Fri Feb 8 11:45:08 2019
@@ -26,8 +26,11 @@
#include <xmmintrin.h>
-typedef double __m128d __attribute__((__vector_size__(16)));
-typedef long long __m128i __attribute__((__vector_size__(16)));
+typedef double __m128d __attribute__((__vector_size__(16), __aligned__(16)));
+typedef long long __m128i __attribute__((__vector_size__(16), __aligned__(16)));
+
+typedef double __m128d_u __attribute__((__vector_size__(16), __aligned__(1)));
+typedef long long __m128i_u __attribute__((__vector_size__(16), __aligned__(1)));
/* Type defines. */
typedef double __v2df __attribute__ ((__vector_size__ (16)));
@@ -1652,7 +1655,7 @@ static __inline__ __m128d __DEFAULT_FN_A
_mm_loadu_pd(double const *__dp)
{
struct __loadu_pd {
- __m128d __v;
+ __m128d_u __v;
} __attribute__((__packed__, __may_alias__));
return ((struct __loadu_pd*)__dp)->__v;
}
@@ -2042,7 +2045,7 @@ static __inline__ void __DEFAULT_FN_ATTR
_mm_storeu_pd(double *__dp, __m128d __a)
{
struct __storeu_pd {
- __m128d __v;
+ __m128d_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_pd*)__dp)->__v = __a;
}
@@ -3567,7 +3570,7 @@ static __inline__ __m128i __DEFAULT_FN_A
_mm_loadu_si128(__m128i const *__p)
{
struct __loadu_si128 {
- __m128i __v;
+ __m128i_u __v;
} __attribute__((__packed__, __may_alias__));
return ((struct __loadu_si128*)__p)->__v;
}
@@ -4030,7 +4033,7 @@ static __inline__ void __DEFAULT_FN_ATTR
_mm_storeu_si128(__m128i *__p, __m128i __b)
{
struct __storeu_si128 {
- __m128i __v;
+ __m128i_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_si128*)__p)->__v = __b;
}
Modified: cfe/trunk/lib/Headers/mmintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/mmintrin.h?rev=353555&r1=353554&r2=353555&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/mmintrin.h (original)
+++ cfe/trunk/lib/Headers/mmintrin.h Fri Feb 8 11:45:08 2019
@@ -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)));
Modified: cfe/trunk/lib/Headers/xmmintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/xmmintrin.h?rev=353555&r1=353554&r2=353555&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/xmmintrin.h (original)
+++ cfe/trunk/lib/Headers/xmmintrin.h Fri Feb 8 11:45:08 2019
@@ -28,7 +28,9 @@
typedef int __v4si __attribute__((__vector_size__(16)));
typedef float __v4sf __attribute__((__vector_size__(16)));
-typedef float __m128 __attribute__((__vector_size__(16)));
+typedef float __m128 __attribute__((__vector_size__(16), __aligned__(16)));
+
+typedef float __m128_u __attribute__((__vector_size__(16), __aligned__(1)));
/* Unsigned types */
typedef unsigned int __v4su __attribute__((__vector_size__(16)));
@@ -1987,7 +1989,7 @@ static __inline__ void __DEFAULT_FN_ATTR
_mm_storeu_ps(float *__p, __m128 __a)
{
struct __storeu_ps {
- __m128 __v;
+ __m128_u __v;
} __attribute__((__packed__, __may_alias__));
((struct __storeu_ps*)__p)->__v = __a;
}
Added: cfe/trunk/test/CodeGen/x86-vec-struct-packing.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/x86-vec-struct-packing.c?rev=353555&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/x86-vec-struct-packing.c (added)
+++ cfe/trunk/test/CodeGen/x86-vec-struct-packing.c Fri Feb 8 11:45:08 2019
@@ -0,0 +1,227 @@
+// RUN: %clang_cc1 -ffreestanding -emit-llvm-only -triple x86_64-windows-coff -fdump-record-layouts %s | FileCheck %s --check-prefix=CHECK-MS
+// RUN: %clang_cc1 -ffreestanding -emit-llvm-only -triple x86_64-apple-darwin -fdump-record-layouts %s | FileCheck %s --check-prefix=CHECK-NOTMS
+#include <x86intrin.h>
+
+#pragma pack(1)
+
+struct s_m64 {
+ int a;
+ __m64 b;
+};
+typedef struct s_m64 m64;
+
+#if defined(_WIN32)
+static int a1[(sizeof(m64) == 16) - 1];
+#else
+static int a1[(sizeof(m64) == 12) - 1];
+#endif
+
+struct s_m128 {
+ int a;
+ __m128 b;
+};
+typedef struct s_m128 m128;
+
+#if defined(_WIN32)
+static int a1[(sizeof(m128) == 32) - 1];
+#else
+static int a1[(sizeof(m128) == 20) - 1];
+#endif
+
+struct s_m128i {
+ int a;
+ __m128i b;
+};
+typedef struct s_m128i m128i;
+
+#if defined(_WIN32)
+static int a1[(sizeof(m128i) == 32) - 1];
+#else
+static int a1[(sizeof(m128i) == 20) - 1];
+#endif
+
+struct s_m128d {
+ int a;
+ __m128d b;
+};
+typedef struct s_m128d m128d;
+
+#if defined(_WIN32)
+static int a1[(sizeof(m128d) == 32) - 1];
+#else
+static int a1[(sizeof(m128d) == 20) - 1];
+#endif
+
+struct s_m256 {
+ int a;
+ __m256 b;
+};
+typedef struct s_m256 m256;
+
+#if defined(_WIN32)
+static int a1[(sizeof(m256) == 64) - 1];
+#else
+static int a1[(sizeof(m256) == 36) - 1];
+#endif
+
+struct s_m256i {
+ int a;
+ __m256i b;
+};
+typedef struct s_m256i m256i;
+
+#if defined(_WIN32)
+static int a1[(sizeof(m256i) == 64) - 1];
+#else
+static int a1[(sizeof(m256i) == 36) - 1];
+#endif
+
+struct s_m256d {
+ int a;
+ __m256d b;
+};
+typedef struct s_m256d m256d;
+
+#if defined(_WIN32)
+static int a1[(sizeof(m256d) == 64) - 1];
+#else
+static int a1[(sizeof(m256d) == 36) - 1];
+#endif
+
+struct s_m512 {
+ int a;
+ __m512 b;
+};
+typedef struct s_m512 m512;
+
+#if defined(_WIN32)
+static int a1[(sizeof(m512) == 128) - 1];
+#else
+static int a1[(sizeof(m512) == 68) - 1];
+#endif
+
+struct s_m512i {
+ int a;
+ __m512i b;
+};
+typedef struct s_m512i m512i;
+
+#if defined(_WIN32)
+static int a1[(sizeof(m512i) == 128) - 1];
+#else
+static int a1[(sizeof(m512i) == 68) - 1];
+#endif
+
+struct s_m512d {
+ int a;
+ __m512d b;
+};
+typedef struct s_m512d m512d;
+
+#if defined(_WIN32)
+static int a1[(sizeof(m512d) == 128) - 1];
+#else
+static int a1[(sizeof(m512d) == 68) - 1];
+#endif
+
+// CHECK-MS: *** Dumping AST Record Layout
+// CHECK-MS: 0 | struct s_m64
+// CHECK-MS: 0 | int a
+// CHECK-MS: 8 | __m64 b
+// CHECK-MS: | [sizeof=16, align=8]
+// CHECK-MS: *** Dumping AST Record Layout
+// CHECK-MS: 0 | struct s_m128
+// CHECK-MS: 0 | int a
+// CHECK-MS: 16 | __m128 b
+// CHECK-MS: | [sizeof=32, align=16]
+// CHECK-MS: *** Dumping AST Record Layout
+// CHECK-MS: 0 | struct s_m128i
+// CHECK-MS: 0 | int a
+// CHECK-MS: 16 | __m128i b
+// CHECK-MS: | [sizeof=32, align=16]
+// CHECK-MS: *** Dumping AST Record Layout
+// CHECK-MS: 0 | struct s_m128d
+// CHECK-MS: 0 | int a
+// CHECK-MS: 16 | __m128d b
+// CHECK-MS: | [sizeof=32, align=16]
+// CHECK-MS: *** Dumping AST Record Layout
+// CHECK-MS: 0 | struct s_m256
+// CHECK-MS: 0 | int a
+// CHECK-MS: 32 | __m256 b
+// CHECK-MS: | [sizeof=64, align=32]
+// CHECK-MS: *** Dumping AST Record Layout
+// CHECK-MS: 0 | struct s_m256i
+// CHECK-MS: 0 | int a
+// CHECK-MS: 32 | __m256i b
+// CHECK-MS: | [sizeof=64, align=32]
+// CHECK-MS: *** Dumping AST Record Layout
+// CHECK-MS: 0 | struct s_m256d
+// CHECK-MS: 0 | int a
+// CHECK-MS: 32 | __m256d b
+// CHECK-MS: | [sizeof=64, align=32]
+// CHECK-MS: *** Dumping AST Record Layout
+// CHECK-MS: 0 | struct s_m512
+// CHECK-MS: 0 | int a
+// CHECK-MS: 64 | __m512 b
+// CHECK-MS: | [sizeof=128, align=64]
+// CHECK-MS: *** Dumping AST Record Layout
+// CHECK-MS: 0 | struct s_m512i
+// CHECK-MS: 0 | int a
+// CHECK-MS: 64 | __m512i b
+// CHECK-MS: | [sizeof=128, align=64]
+// CHECK-MS: *** Dumping AST Record Layout
+// CHECK-MS: 0 | struct s_m512d
+// CHECK-MS: 0 | int a
+// CHECK-MS: 64 | __m512d b
+// CHECK-MS: | [sizeof=128, align=64]
+
+// CHECK-NOTMS: *** Dumping AST Record Layout
+// CHECK-NOTMS: 0 | struct s_m64
+// CHECK-NOTMS: 0 | int a
+// CHECK-NOTMS: 4 | __m64 b
+// CHECK-NOTMS: | [sizeof=12, align=1]
+// CHECK-NOTMS: *** Dumping AST Record Layout
+// CHECK-NOTMS: 0 | struct s_m128
+// CHECK-NOTMS: 0 | int a
+// CHECK-NOTMS: 4 | __m128 b
+// CHECK-NOTMS: | [sizeof=20, align=1]
+// CHECK-NOTMS: *** Dumping AST Record Layout
+// CHECK-NOTMS: 0 | struct s_m128i
+// CHECK-NOTMS: 0 | int a
+// CHECK-NOTMS: 4 | __m128i b
+// CHECK-NOTMS: | [sizeof=20, align=1]
+// CHECK-NOTMS: *** Dumping AST Record Layout
+// CHECK-NOTMS: 0 | struct s_m128d
+// CHECK-NOTMS: 0 | int a
+// CHECK-NOTMS: 4 | __m128d b
+// CHECK-NOTMS: | [sizeof=20, align=1]
+// CHECK-NOTMS: *** Dumping AST Record Layout
+// CHECK-NOTMS: 0 | struct s_m256
+// CHECK-NOTMS: 0 | int a
+// CHECK-NOTMS: 4 | __m256 b
+// CHECK-NOTMS: | [sizeof=36, align=1]
+// CHECK-NOTMS: *** Dumping AST Record Layout
+// CHECK-NOTMS: 0 | struct s_m256i
+// CHECK-NOTMS: 0 | int a
+// CHECK-NOTMS: 4 | __m256i b
+// CHECK-NOTMS: | [sizeof=36, align=1]
+// CHECK-NOTMS: *** Dumping AST Record Layout
+// CHECK-NOTMS: 0 | struct s_m256d
+// CHECK-NOTMS: 0 | int a
+// CHECK-NOTMS: 4 | __m256d b
+// CHECK-NOTMS: | [sizeof=36, align=1]
+// CHECK-NOTMS: *** Dumping AST Record Layout
+// CHECK-NOTMS: 0 | struct s_m512
+// CHECK-NOTMS: 0 | int a
+// CHECK-NOTMS: 4 | __m512 b
+// CHECK-NOTMS: | [sizeof=68, align=1]
+// CHECK-NOTMS: *** Dumping AST Record Layout
+// CHECK-NOTMS: 0 | struct s_m512i
+// CHECK-NOTMS: 0 | int a
+// CHECK-NOTMS: 4 | __m512i b
+// CHECK-NOTMS: | [sizeof=68, align=1]
+// CHECK-NOTMS: *** Dumping AST Record Layout
+// CHECK-NOTMS: 0 | struct s_m512d
+// CHECK-NOTMS: 0 | int a
+// CHECK-NOTMS: 4 | __m512d b
+// CHECK-NOTMS: | [sizeof=68, align=1]
More information about the cfe-commits
mailing list