r333593 - [X86] Add __extension__ to a bunch of places in our intrinsic headers that fail if you run it through -pedantic -ansi.

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Wed May 30 14:08:27 PDT 2018


Author: ctopper
Date: Wed May 30 14:08:27 2018
New Revision: 333593

URL: http://llvm.org/viewvc/llvm-project?rev=333593&view=rev
Log:
[X86] Add __extension__ to a bunch of places in our intrinsic headers that fail if you run it through -pedantic -ansi.

All of these are lines that create a 'compound literal' to concatenate elements together.

Modified:
    cfe/trunk/lib/Headers/avx512fintrin.h
    cfe/trunk/lib/Headers/avxintrin.h
    cfe/trunk/lib/Headers/emmintrin.h
    cfe/trunk/lib/Headers/xmmintrin.h

Modified: cfe/trunk/lib/Headers/avx512fintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512fintrin.h?rev=333593&r1=333592&r2=333593&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512fintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512fintrin.h Wed May 30 14:08:27 2018
@@ -180,7 +180,7 @@ typedef enum
 static  __inline __m512i __DEFAULT_FN_ATTRS
 _mm512_setzero_si512(void)
 {
-  return (__m512i)(__v8di){ 0, 0, 0, 0, 0, 0, 0, 0 };
+  return __extension__ (__m512i)(__v8di){ 0, 0, 0, 0, 0, 0, 0, 0 };
 }
 
 #define _mm512_setzero_epi32 _mm512_setzero_si512
@@ -262,8 +262,8 @@ _mm512_maskz_broadcastq_epi64 (__mmask8
 static __inline __m512 __DEFAULT_FN_ATTRS
 _mm512_setzero_ps(void)
 {
-  return (__m512){ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
-                   0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
+  return __extension__ (__m512){ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+                                 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
 }
 
 #define _mm512_setzero _mm512_setzero_ps
@@ -271,49 +271,52 @@ _mm512_setzero_ps(void)
 static  __inline __m512d __DEFAULT_FN_ATTRS
 _mm512_setzero_pd(void)
 {
-  return (__m512d){ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
+  return __extension__ (__m512d){ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
 }
 
 static __inline __m512 __DEFAULT_FN_ATTRS
 _mm512_set1_ps(float __w)
 {
-  return (__m512){ __w, __w, __w, __w, __w, __w, __w, __w,
-                   __w, __w, __w, __w, __w, __w, __w, __w  };
+  return __extension__ (__m512){ __w, __w, __w, __w, __w, __w, __w, __w,
+                                 __w, __w, __w, __w, __w, __w, __w, __w  };
 }
 
 static __inline __m512d __DEFAULT_FN_ATTRS
 _mm512_set1_pd(double __w)
 {
-  return (__m512d){ __w, __w, __w, __w, __w, __w, __w, __w };
+  return __extension__ (__m512d){ __w, __w, __w, __w, __w, __w, __w, __w };
 }
 
 static __inline __m512i __DEFAULT_FN_ATTRS
 _mm512_set1_epi8(char __w)
 {
-  return (__m512i)(__v64qi){ __w, __w, __w, __w, __w, __w, __w, __w,
-                             __w, __w, __w, __w, __w, __w, __w, __w,
-                             __w, __w, __w, __w, __w, __w, __w, __w,
-                             __w, __w, __w, __w, __w, __w, __w, __w,
-                             __w, __w, __w, __w, __w, __w, __w, __w,
-                             __w, __w, __w, __w, __w, __w, __w, __w,
-                             __w, __w, __w, __w, __w, __w, __w, __w,
-                             __w, __w, __w, __w, __w, __w, __w, __w  };
+  return __extension__ (__m512i)(__v64qi){
+    __w, __w, __w, __w, __w, __w, __w, __w,
+    __w, __w, __w, __w, __w, __w, __w, __w,
+    __w, __w, __w, __w, __w, __w, __w, __w,
+    __w, __w, __w, __w, __w, __w, __w, __w,
+    __w, __w, __w, __w, __w, __w, __w, __w,
+    __w, __w, __w, __w, __w, __w, __w, __w,
+    __w, __w, __w, __w, __w, __w, __w, __w,
+    __w, __w, __w, __w, __w, __w, __w, __w  };
 }
 
 static __inline __m512i __DEFAULT_FN_ATTRS
 _mm512_set1_epi16(short __w)
 {
-  return (__m512i)(__v32hi){ __w, __w, __w, __w, __w, __w, __w, __w,
-                             __w, __w, __w, __w, __w, __w, __w, __w,
-                             __w, __w, __w, __w, __w, __w, __w, __w,
-                             __w, __w, __w, __w, __w, __w, __w, __w };
+  return __extension__ (__m512i)(__v32hi){
+    __w, __w, __w, __w, __w, __w, __w, __w,
+    __w, __w, __w, __w, __w, __w, __w, __w,
+    __w, __w, __w, __w, __w, __w, __w, __w,
+    __w, __w, __w, __w, __w, __w, __w, __w };
 }
 
 static __inline __m512i __DEFAULT_FN_ATTRS
 _mm512_set1_epi32(int __s)
 {
-  return (__m512i)(__v16si){ __s, __s, __s, __s, __s, __s, __s, __s,
-                             __s, __s, __s, __s, __s, __s, __s, __s };
+  return __extension__ (__m512i)(__v16si){
+    __s, __s, __s, __s, __s, __s, __s, __s,
+    __s, __s, __s, __s, __s, __s, __s, __s };
 }
 
 static __inline __m512i __DEFAULT_FN_ATTRS
@@ -327,7 +330,7 @@ _mm512_maskz_set1_epi32(__mmask16 __M, i
 static __inline __m512i __DEFAULT_FN_ATTRS
 _mm512_set1_epi64(long long __d)
 {
-  return (__m512i)(__v8di){ __d, __d, __d, __d, __d, __d, __d, __d };
+  return __extension__(__m512i)(__v8di){ __d, __d, __d, __d, __d, __d, __d, __d };
 }
 
 static __inline __m512i __DEFAULT_FN_ATTRS
@@ -349,7 +352,7 @@ _mm512_broadcastss_ps(__m128 __A)
 static __inline __m512i __DEFAULT_FN_ATTRS
 _mm512_set4_epi32 (int __A, int __B, int __C, int __D)
 {
-  return  (__m512i)(__v16si)
+  return __extension__ (__m512i)(__v16si)
    { __D, __C, __B, __A, __D, __C, __B, __A,
      __D, __C, __B, __A, __D, __C, __B, __A };
 }
@@ -358,21 +361,21 @@ static __inline __m512i __DEFAULT_FN_ATT
 _mm512_set4_epi64 (long long __A, long long __B, long long __C,
        long long __D)
 {
-  return  (__m512i) (__v8di)
+  return __extension__ (__m512i) (__v8di)
    { __D, __C, __B, __A, __D, __C, __B, __A };
 }
 
 static __inline __m512d __DEFAULT_FN_ATTRS
 _mm512_set4_pd (double __A, double __B, double __C, double __D)
 {
-  return  (__m512d)
+  return __extension__ (__m512d)
    { __D, __C, __B, __A, __D, __C, __B, __A };
 }
 
 static __inline __m512 __DEFAULT_FN_ATTRS
 _mm512_set4_ps (float __A, float __B, float __C, float __D)
 {
-  return  (__m512)
+  return __extension__ (__m512)
    { __D, __C, __B, __A, __D, __C, __B, __A,
      __D, __C, __B, __A, __D, __C, __B, __A };
 }
@@ -9063,7 +9066,7 @@ static __inline__ __m128 __DEFAULT_FN_AT
 _mm_mask_load_ss (__m128 __W, __mmask8 __U, const float* __A)
 {
   __m128 src = (__v4sf) __builtin_shufflevector((__v4sf) __W,
-                                                (__v4sf) {0.0, 0.0, 0.0, 0.0},
+                                                (__v4sf)_mm_setzero_ps(),
                                                 0, 4, 4, 4);
 
   return (__m128) __builtin_ia32_loadss128_mask ((__v4sf *) __A, src, __U & 1);
@@ -9081,7 +9084,8 @@ static __inline__ __m128d __DEFAULT_FN_A
 _mm_mask_load_sd (__m128d __W, __mmask8 __U, const double* __A)
 {
   __m128d src = (__v2df) __builtin_shufflevector((__v2df) __W,
-                                                 (__v2df) {0.0, 0.0}, 0, 2);
+                                                 (__v2df)_mm_setzero_pd(),
+                                                 0, 2);
 
   return (__m128d) __builtin_ia32_loadsd128_mask ((__v2df *) __A, src, __U & 1);
 }

Modified: cfe/trunk/lib/Headers/avxintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avxintrin.h?rev=333593&r1=333592&r2=333593&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avxintrin.h (original)
+++ cfe/trunk/lib/Headers/avxintrin.h Wed May 30 14:08:27 2018
@@ -3055,7 +3055,7 @@ static __inline __m128 __DEFAULT_FN_ATTR
 _mm_broadcast_ss(float const *__a)
 {
   float __f = *__a;
-  return (__m128)(__v4sf){ __f, __f, __f, __f };
+  return __extension__ (__m128)(__v4sf){ __f, __f, __f, __f };
 }
 
 /// Loads a scalar double-precision floating point value from the
@@ -3074,7 +3074,7 @@ static __inline __m256d __DEFAULT_FN_ATT
 _mm256_broadcast_sd(double const *__a)
 {
   double __d = *__a;
-  return (__m256d)(__v4df){ __d, __d, __d, __d };
+  return __extension__ (__m256d)(__v4df){ __d, __d, __d, __d };
 }
 
 /// Loads a scalar single-precision floating point value from the
@@ -3093,7 +3093,7 @@ static __inline __m256 __DEFAULT_FN_ATTR
 _mm256_broadcast_ss(float const *__a)
 {
   float __f = *__a;
-  return (__m256)(__v8sf){ __f, __f, __f, __f, __f, __f, __f, __f };
+  return __extension__ (__m256)(__v8sf){ __f, __f, __f, __f, __f, __f, __f, __f };
 }
 
 /// Loads the data from a 128-bit vector of [2 x double] from the
@@ -3698,7 +3698,7 @@ _mm256_undefined_si256(void)
 static __inline __m256d __DEFAULT_FN_ATTRS
 _mm256_set_pd(double __a, double __b, double __c, double __d)
 {
-  return (__m256d){ __d, __c, __b, __a };
+  return __extension__ (__m256d){ __d, __c, __b, __a };
 }
 
 /// Constructs a 256-bit floating-point vector of [8 x float] initialized
@@ -3738,7 +3738,7 @@ static __inline __m256 __DEFAULT_FN_ATTR
 _mm256_set_ps(float __a, float __b, float __c, float __d,
               float __e, float __f, float __g, float __h)
 {
-  return (__m256){ __h, __g, __f, __e, __d, __c, __b, __a };
+  return __extension__ (__m256){ __h, __g, __f, __e, __d, __c, __b, __a };
 }
 
 /// Constructs a 256-bit integer vector initialized with the specified
@@ -3770,7 +3770,7 @@ static __inline __m256i __DEFAULT_FN_ATT
 _mm256_set_epi32(int __i0, int __i1, int __i2, int __i3,
                  int __i4, int __i5, int __i6, int __i7)
 {
-  return (__m256i)(__v8si){ __i7, __i6, __i5, __i4, __i3, __i2, __i1, __i0 };
+  return __extension__ (__m256i)(__v8si){ __i7, __i6, __i5, __i4, __i3, __i2, __i1, __i0 };
 }
 
 /// Constructs a 256-bit integer vector initialized with the specified
@@ -3820,7 +3820,7 @@ _mm256_set_epi16(short __w15, short __w1
                  short __w07, short __w06, short __w05, short __w04,
                  short __w03, short __w02, short __w01, short __w00)
 {
-  return (__m256i)(__v16hi){ __w00, __w01, __w02, __w03, __w04, __w05, __w06,
+  return __extension__ (__m256i)(__v16hi){ __w00, __w01, __w02, __w03, __w04, __w05, __w06,
     __w07, __w08, __w09, __w10, __w11, __w12, __w13, __w14, __w15 };
 }
 
@@ -3907,7 +3907,7 @@ _mm256_set_epi8(char __b31, char __b30,
                 char __b07, char __b06, char __b05, char __b04,
                 char __b03, char __b02, char __b01, char __b00)
 {
-  return (__m256i)(__v32qi){
+  return __extension__ (__m256i)(__v32qi){
     __b00, __b01, __b02, __b03, __b04, __b05, __b06, __b07,
     __b08, __b09, __b10, __b11, __b12, __b13, __b14, __b15,
     __b16, __b17, __b18, __b19, __b20, __b21, __b22, __b23,
@@ -3935,7 +3935,7 @@ _mm256_set_epi8(char __b31, char __b30,
 static __inline __m256i __DEFAULT_FN_ATTRS
 _mm256_set_epi64x(long long __a, long long __b, long long __c, long long __d)
 {
-  return (__m256i)(__v4di){ __d, __c, __b, __a };
+  return __extension__ (__m256i)(__v4di){ __d, __c, __b, __a };
 }
 
 /* Create vectors with elements in reverse order */
@@ -3964,7 +3964,7 @@ _mm256_set_epi64x(long long __a, long lo
 static __inline __m256d __DEFAULT_FN_ATTRS
 _mm256_setr_pd(double __a, double __b, double __c, double __d)
 {
-  return (__m256d){ __a, __b, __c, __d };
+  return _mm256_set_pd(__a, __b, __c, __d);
 }
 
 /// Constructs a 256-bit floating-point vector of [8 x float],
@@ -4005,7 +4005,7 @@ static __inline __m256 __DEFAULT_FN_ATTR
 _mm256_setr_ps(float __a, float __b, float __c, float __d,
                float __e, float __f, float __g, float __h)
 {
-  return (__m256){ __a, __b, __c, __d, __e, __f, __g, __h };
+  return _mm256_set_ps(__a, __b, __c, __d, __e, __f, __g, __h);
 }
 
 /// Constructs a 256-bit integer vector, initialized in reverse order
@@ -4037,7 +4037,7 @@ static __inline __m256i __DEFAULT_FN_ATT
 _mm256_setr_epi32(int __i0, int __i1, int __i2, int __i3,
                   int __i4, int __i5, int __i6, int __i7)
 {
-  return (__m256i)(__v8si){ __i0, __i1, __i2, __i3, __i4, __i5, __i6, __i7 };
+  return _mm256_set_epi32(__i0, __i1, __i2, __i3, __i4, __i5, __i6, __i7);
 }
 
 /// Constructs a 256-bit integer vector, initialized in reverse order
@@ -4087,8 +4087,10 @@ _mm256_setr_epi16(short __w15, short __w
        short __w07, short __w06, short __w05, short __w04,
        short __w03, short __w02, short __w01, short __w00)
 {
-  return (__m256i)(__v16hi){ __w15, __w14, __w13, __w12, __w11, __w10, __w09,
-    __w08, __w07, __w06, __w05, __w04, __w03, __w02, __w01, __w00 };
+  return _mm256_set_epi16(__w15, __w14, __w13, __w12,
+                          __w11, __w10, __w09, __w08,
+                          __w07, __w06, __w05, __w04,
+                          __w03, __w02, __w01, __w00);
 }
 
 /// Constructs a 256-bit integer vector, initialized in reverse order
@@ -4174,11 +4176,10 @@ _mm256_setr_epi8(char __b31, char __b30,
                  char __b07, char __b06, char __b05, char __b04,
                  char __b03, char __b02, char __b01, char __b00)
 {
-  return (__m256i)(__v32qi){
-    __b31, __b30, __b29, __b28, __b27, __b26, __b25, __b24,
-    __b23, __b22, __b21, __b20, __b19, __b18, __b17, __b16,
-    __b15, __b14, __b13, __b12, __b11, __b10, __b09, __b08,
-    __b07, __b06, __b05, __b04, __b03, __b02, __b01, __b00 };
+  return _mm256_set_epi8(__b31, __b30, __b29, __b28, __b27, __b26, __b25, __b24,
+                         __b23, __b22, __b21, __b20, __b19, __b18, __b17, __b16,
+                         __b15, __b14, __b13, __b12, __b11, __b10, __b09, __b08,
+                         __b07, __b06, __b05, __b04, __b03, __b02, __b01, __b00);
 }
 
 /// Constructs a 256-bit integer vector, initialized in reverse order
@@ -4201,7 +4202,7 @@ _mm256_setr_epi8(char __b31, char __b30,
 static __inline __m256i __DEFAULT_FN_ATTRS
 _mm256_setr_epi64x(long long __a, long long __b, long long __c, long long __d)
 {
-  return (__m256i)(__v4di){ __a, __b, __c, __d };
+  return _mm256_set_epi64x(__a, __b, __c, __d);
 }
 
 /* Create vectors with repeated elements */
@@ -4220,7 +4221,7 @@ _mm256_setr_epi64x(long long __a, long l
 static __inline __m256d __DEFAULT_FN_ATTRS
 _mm256_set1_pd(double __w)
 {
-  return (__m256d){ __w, __w, __w, __w };
+  return _mm256_set_pd(__w, __w, __w, __w);
 }
 
 /// Constructs a 256-bit floating-point vector of [8 x float], with each
@@ -4239,7 +4240,7 @@ _mm256_set1_pd(double __w)
 static __inline __m256 __DEFAULT_FN_ATTRS
 _mm256_set1_ps(float __w)
 {
-  return (__m256){ __w, __w, __w, __w, __w, __w, __w, __w };
+  return _mm256_set_ps(__w, __w, __w, __w, __w, __w, __w, __w);
 }
 
 /// Constructs a 256-bit integer vector of [8 x i32], with each of the
@@ -4258,7 +4259,7 @@ _mm256_set1_ps(float __w)
 static __inline __m256i __DEFAULT_FN_ATTRS
 _mm256_set1_epi32(int __i)
 {
-  return (__m256i)(__v8si){ __i, __i, __i, __i, __i, __i, __i, __i };
+  return _mm256_set_epi32(__i, __i, __i, __i, __i, __i, __i, __i);
 }
 
 /// Constructs a 256-bit integer vector of [16 x i16], with each of the
@@ -4276,8 +4277,8 @@ _mm256_set1_epi32(int __i)
 static __inline __m256i __DEFAULT_FN_ATTRS
 _mm256_set1_epi16(short __w)
 {
-  return (__m256i)(__v16hi){ __w, __w, __w, __w, __w, __w, __w, __w, __w, __w,
-    __w, __w, __w, __w, __w, __w };
+  return _mm256_set_epi16(__w, __w, __w, __w, __w, __w, __w, __w,
+                          __w, __w, __w, __w, __w, __w, __w, __w);
 }
 
 /// Constructs a 256-bit integer vector of [32 x i8], with each of the
@@ -4294,9 +4295,10 @@ _mm256_set1_epi16(short __w)
 static __inline __m256i __DEFAULT_FN_ATTRS
 _mm256_set1_epi8(char __b)
 {
-  return (__m256i)(__v32qi){ __b, __b, __b, __b, __b, __b, __b, __b, __b, __b,
-    __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b,
-    __b, __b, __b, __b, __b, __b, __b };
+  return _mm256_set_epi8(__b, __b, __b, __b, __b, __b, __b, __b,
+                         __b, __b, __b, __b, __b, __b, __b, __b,
+                         __b, __b, __b, __b, __b, __b, __b, __b,
+                         __b, __b, __b, __b, __b, __b, __b, __b);
 }
 
 /// Constructs a 256-bit integer vector of [4 x i64], with each of the
@@ -4314,7 +4316,7 @@ _mm256_set1_epi8(char __b)
 static __inline __m256i __DEFAULT_FN_ATTRS
 _mm256_set1_epi64x(long long __q)
 {
-  return (__m256i)(__v4di){ __q, __q, __q, __q };
+  return _mm256_set_epi64x(__q, __q, __q, __q);
 }
 
 /* Create __zeroed vectors */
@@ -4329,7 +4331,7 @@ _mm256_set1_epi64x(long long __q)
 static __inline __m256d __DEFAULT_FN_ATTRS
 _mm256_setzero_pd(void)
 {
-  return (__m256d){ 0, 0, 0, 0 };
+  return __extension__ (__m256d){ 0, 0, 0, 0 };
 }
 
 /// Constructs a 256-bit floating-point vector of [8 x float] with all
@@ -4343,7 +4345,7 @@ _mm256_setzero_pd(void)
 static __inline __m256 __DEFAULT_FN_ATTRS
 _mm256_setzero_ps(void)
 {
-  return (__m256){ 0, 0, 0, 0, 0, 0, 0, 0 };
+  return __extension__ (__m256){ 0, 0, 0, 0, 0, 0, 0, 0 };
 }
 
 /// Constructs a 256-bit integer vector initialized to zero.
@@ -4356,7 +4358,7 @@ _mm256_setzero_ps(void)
 static __inline __m256i __DEFAULT_FN_ATTRS
 _mm256_setzero_si256(void)
 {
-  return (__m256i){ 0LL, 0LL, 0LL, 0LL };
+  return __extension__ (__m256i)(__v4di){ 0, 0, 0, 0 };
 }
 
 /* Cast between vector types */

Modified: cfe/trunk/lib/Headers/emmintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/emmintrin.h?rev=333593&r1=333592&r2=333593&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/emmintrin.h (original)
+++ cfe/trunk/lib/Headers/emmintrin.h Wed May 30 14:08:27 2018
@@ -236,7 +236,7 @@ static __inline__ __m128d __DEFAULT_FN_A
 _mm_sqrt_sd(__m128d __a, __m128d __b)
 {
   __m128d __c = __builtin_ia32_sqrtsd((__v2df)__b);
-  return (__m128d) { __c[0], __a[1] };
+  return __extension__ (__m128d) { __c[0], __a[1] };
 }
 
 /// Calculates the square root of the each of two values stored in a
@@ -769,7 +769,7 @@ static __inline__ __m128d __DEFAULT_FN_A
 _mm_cmpgt_sd(__m128d __a, __m128d __b)
 {
   __m128d __c = __builtin_ia32_cmpltsd((__v2df)__b, (__v2df)__a);
-  return (__m128d) { __c[0], __a[1] };
+  return __extension__ (__m128d) { __c[0], __a[1] };
 }
 
 /// Compares the lower double-precision floating-point values in each of
@@ -795,7 +795,7 @@ static __inline__ __m128d __DEFAULT_FN_A
 _mm_cmpge_sd(__m128d __a, __m128d __b)
 {
   __m128d __c = __builtin_ia32_cmplesd((__v2df)__b, (__v2df)__a);
-  return (__m128d) { __c[0], __a[1] };
+  return __extension__ (__m128d) { __c[0], __a[1] };
 }
 
 /// Compares the lower double-precision floating-point values in each of
@@ -951,7 +951,7 @@ static __inline__ __m128d __DEFAULT_FN_A
 _mm_cmpngt_sd(__m128d __a, __m128d __b)
 {
   __m128d __c = __builtin_ia32_cmpnltsd((__v2df)__b, (__v2df)__a);
-  return (__m128d) { __c[0], __a[1] };
+  return __extension__ (__m128d) { __c[0], __a[1] };
 }
 
 /// Compares the lower double-precision floating-point values in each of
@@ -977,7 +977,7 @@ static __inline__ __m128d __DEFAULT_FN_A
 _mm_cmpnge_sd(__m128d __a, __m128d __b)
 {
   __m128d __c = __builtin_ia32_cmpnlesd((__v2df)__b, (__v2df)__a);
-  return (__m128d) { __c[0], __a[1] };
+  return __extension__ (__m128d) { __c[0], __a[1] };
 }
 
 /// Compares the lower double-precision floating-point values in each of
@@ -1610,7 +1610,7 @@ _mm_load1_pd(double const *__dp)
     double __u;
   } __attribute__((__packed__, __may_alias__));
   double __u = ((struct __mm_load1_pd_struct*)__dp)->__u;
-  return (__m128d){ __u, __u };
+  return __extension__ (__m128d){ __u, __u };
 }
 
 #define        _mm_load_pd1(dp)        _mm_load1_pd(dp)
@@ -1674,7 +1674,7 @@ _mm_loadu_si64(void const *__a)
     long long __v;
   } __attribute__((__packed__, __may_alias__));
   long long __u = ((struct __loadu_si64*)__a)->__v;
-  return (__m128i){__u, 0L};
+  return __extension__ (__m128i)(__v2di){__u, 0L};
 }
 
 /// Loads a 64-bit double-precision value to the low element of a
@@ -1695,7 +1695,7 @@ _mm_load_sd(double const *__dp)
     double __u;
   } __attribute__((__packed__, __may_alias__));
   double __u = ((struct __mm_load_sd_struct*)__dp)->__u;
-  return (__m128d){ __u, 0 };
+  return __extension__ (__m128d){ __u, 0 };
 }
 
 /// Loads a double-precision value into the high-order bits of a 128-bit
@@ -1722,7 +1722,7 @@ _mm_loadh_pd(__m128d __a, double const *
     double __u;
   } __attribute__((__packed__, __may_alias__));
   double __u = ((struct __mm_loadh_pd_struct*)__dp)->__u;
-  return (__m128d){ __a[0], __u };
+  return __extension__ (__m128d){ __a[0], __u };
 }
 
 /// Loads a double-precision value into the low-order bits of a 128-bit
@@ -1749,7 +1749,7 @@ _mm_loadl_pd(__m128d __a, double const *
     double __u;
   } __attribute__((__packed__, __may_alias__));
   double __u = ((struct __mm_loadl_pd_struct*)__dp)->__u;
-  return (__m128d){ __u, __a[1] };
+  return __extension__ (__m128d){ __u, __a[1] };
 }
 
 /// Constructs a 128-bit floating-point vector of [2 x double] with
@@ -1786,7 +1786,7 @@ _mm_undefined_pd(void)
 static __inline__ __m128d __DEFAULT_FN_ATTRS
 _mm_set_sd(double __w)
 {
-  return (__m128d){ __w, 0 };
+  return __extension__ (__m128d){ __w, 0 };
 }
 
 /// Constructs a 128-bit floating-point vector of [2 x double], with each
@@ -1804,7 +1804,7 @@ _mm_set_sd(double __w)
 static __inline__ __m128d __DEFAULT_FN_ATTRS
 _mm_set1_pd(double __w)
 {
-  return (__m128d){ __w, __w };
+  return __extension__ (__m128d){ __w, __w };
 }
 
 /// Constructs a 128-bit floating-point vector of [2 x double], with each
@@ -1842,7 +1842,7 @@ _mm_set_pd1(double __w)
 static __inline__ __m128d __DEFAULT_FN_ATTRS
 _mm_set_pd(double __w, double __x)
 {
-  return (__m128d){ __x, __w };
+  return __extension__ (__m128d){ __x, __w };
 }
 
 /// Constructs a 128-bit floating-point vector of [2 x double],
@@ -1863,7 +1863,7 @@ _mm_set_pd(double __w, double __x)
 static __inline__ __m128d __DEFAULT_FN_ATTRS
 _mm_setr_pd(double __w, double __x)
 {
-  return (__m128d){ __w, __x };
+  return __extension__ (__m128d){ __w, __x };
 }
 
 /// Constructs a 128-bit floating-point vector of [2 x double]
@@ -1878,7 +1878,7 @@ _mm_setr_pd(double __w, double __x)
 static __inline__ __m128d __DEFAULT_FN_ATTRS
 _mm_setzero_pd(void)
 {
-  return (__m128d){ 0, 0 };
+  return __extension__ (__m128d){ 0, 0 };
 }
 
 /// Constructs a 128-bit floating-point vector of [2 x double]. The lower
@@ -1899,7 +1899,7 @@ _mm_setzero_pd(void)
 static __inline__ __m128d __DEFAULT_FN_ATTRS
 _mm_move_sd(__m128d __a, __m128d __b)
 {
-  return (__m128d){ __b[0], __a[1] };
+  return __extension__ (__m128d){ __b[0], __a[1] };
 }
 
 /// Stores the lower 64 bits of a 128-bit vector of [2 x double] to a
@@ -3471,7 +3471,7 @@ _mm_cvttps_epi32(__m128 __a)
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_cvtsi32_si128(int __a)
 {
-  return (__m128i)(__v4si){ __a, 0, 0, 0 };
+  return __extension__ (__m128i)(__v4si){ __a, 0, 0, 0 };
 }
 
 #ifdef __x86_64__
@@ -3488,7 +3488,7 @@ _mm_cvtsi32_si128(int __a)
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_cvtsi64_si128(long long __a)
 {
-  return (__m128i){ __a, 0 };
+  return __extension__ (__m128i)(__v2di){ __a, 0 };
 }
 #endif
 
@@ -3582,7 +3582,7 @@ _mm_loadl_epi64(__m128i const *__p)
   struct __mm_loadl_epi64_struct {
     long long __u;
   } __attribute__((__packed__, __may_alias__));
-  return (__m128i) { ((struct __mm_loadl_epi64_struct*)__p)->__u, 0};
+  return __extension__ (__m128i) { ((struct __mm_loadl_epi64_struct*)__p)->__u, 0};
 }
 
 /// Generates a 128-bit vector of [4 x i32] with unspecified content.
@@ -3619,7 +3619,7 @@ _mm_undefined_si128(void)
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_set_epi64x(long long __q1, long long __q0)
 {
-  return (__m128i){ __q0, __q1 };
+  return __extension__ (__m128i)(__v2di){ __q0, __q1 };
 }
 
 /// Initializes both 64-bit values in a 128-bit vector of [2 x i64] with
@@ -3641,7 +3641,7 @@ _mm_set_epi64x(long long __q1, long long
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_set_epi64(__m64 __q1, __m64 __q0)
 {
-  return (__m128i){ (long long)__q0, (long long)__q1 };
+  return _mm_set_epi64x((long long)__q0, (long long)__q1);
 }
 
 /// Initializes the 32-bit values in a 128-bit vector of [4 x i32] with
@@ -3669,7 +3669,7 @@ _mm_set_epi64(__m64 __q1, __m64 __q0)
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_set_epi32(int __i3, int __i2, int __i1, int __i0)
 {
-  return (__m128i)(__v4si){ __i0, __i1, __i2, __i3};
+  return __extension__ (__m128i)(__v4si){ __i0, __i1, __i2, __i3};
 }
 
 /// Initializes the 16-bit values in a 128-bit vector of [8 x i16] with
@@ -3709,7 +3709,7 @@ _mm_set_epi32(int __i3, int __i2, int __
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_set_epi16(short __w7, short __w6, short __w5, short __w4, short __w3, short __w2, short __w1, short __w0)
 {
-  return (__m128i)(__v8hi){ __w0, __w1, __w2, __w3, __w4, __w5, __w6, __w7 };
+  return __extension__ (__m128i)(__v8hi){ __w0, __w1, __w2, __w3, __w4, __w5, __w6, __w7 };
 }
 
 /// Initializes the 8-bit values in a 128-bit vector of [16 x i8] with
@@ -3757,7 +3757,7 @@ _mm_set_epi16(short __w7, short __w6, sh
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_set_epi8(char __b15, char __b14, char __b13, char __b12, char __b11, char __b10, char __b9, char __b8, char __b7, char __b6, char __b5, char __b4, char __b3, char __b2, char __b1, char __b0)
 {
-  return (__m128i)(__v16qi){ __b0, __b1, __b2, __b3, __b4, __b5, __b6, __b7, __b8, __b9, __b10, __b11, __b12, __b13, __b14, __b15 };
+  return __extension__ (__m128i)(__v16qi){ __b0, __b1, __b2, __b3, __b4, __b5, __b6, __b7, __b8, __b9, __b10, __b11, __b12, __b13, __b14, __b15 };
 }
 
 /// Initializes both values in a 128-bit integer vector with the
@@ -3776,7 +3776,7 @@ _mm_set_epi8(char __b15, char __b14, cha
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_set1_epi64x(long long __q)
 {
-  return (__m128i){ __q, __q };
+  return _mm_set_epi64x(__q, __q);
 }
 
 /// Initializes both values in a 128-bit vector of [2 x i64] with the
@@ -3795,7 +3795,7 @@ _mm_set1_epi64x(long long __q)
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_set1_epi64(__m64 __q)
 {
-  return (__m128i){ (long long)__q, (long long)__q };
+  return _mm_set_epi64(__q, __q);
 }
 
 /// Initializes all values in a 128-bit vector of [4 x i32] with the
@@ -3814,7 +3814,7 @@ _mm_set1_epi64(__m64 __q)
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_set1_epi32(int __i)
 {
-  return (__m128i)(__v4si){ __i, __i, __i, __i };
+  return _mm_set_epi32(__i, __i, __i, __i);
 }
 
 /// Initializes all values in a 128-bit vector of [8 x i16] with the
@@ -3833,7 +3833,7 @@ _mm_set1_epi32(int __i)
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_set1_epi16(short __w)
 {
-  return (__m128i)(__v8hi){ __w, __w, __w, __w, __w, __w, __w, __w };
+  return _mm_set_epi16(__w, __w, __w, __w, __w, __w, __w, __w);
 }
 
 /// Initializes all values in a 128-bit vector of [16 x i8] with the
@@ -3852,7 +3852,7 @@ _mm_set1_epi16(short __w)
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_set1_epi8(char __b)
 {
-  return (__m128i)(__v16qi){ __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b };
+  return _mm_set_epi8(__b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b);
 }
 
 /// Constructs a 128-bit integer vector, initialized in reverse order
@@ -3872,7 +3872,7 @@ _mm_set1_epi8(char __b)
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_setr_epi64(__m64 __q0, __m64 __q1)
 {
-  return (__m128i){ (long long)__q0, (long long)__q1 };
+  return _mm_set_epi64(__q0, __q1);
 }
 
 /// Constructs a 128-bit integer vector, initialized in reverse order
@@ -3895,7 +3895,7 @@ _mm_setr_epi64(__m64 __q0, __m64 __q1)
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_setr_epi32(int __i0, int __i1, int __i2, int __i3)
 {
-  return (__m128i)(__v4si){ __i0, __i1, __i2, __i3};
+  return _mm_set_epi32(__i0, __i1, __i2, __i3);
 }
 
 /// Constructs a 128-bit integer vector, initialized in reverse order
@@ -3926,7 +3926,7 @@ _mm_setr_epi32(int __i0, int __i1, int _
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_setr_epi16(short __w0, short __w1, short __w2, short __w3, short __w4, short __w5, short __w6, short __w7)
 {
-  return (__m128i)(__v8hi){ __w0, __w1, __w2, __w3, __w4, __w5, __w6, __w7 };
+  return _mm_set_epi16(__w0, __w1, __w2, __w3, __w4, __w5, __w6, __w7);
 }
 
 /// Constructs a 128-bit integer vector, initialized in reverse order
@@ -3973,7 +3973,7 @@ _mm_setr_epi16(short __w0, short __w1, s
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_setr_epi8(char __b0, char __b1, char __b2, char __b3, char __b4, char __b5, char __b6, char __b7, char __b8, char __b9, char __b10, char __b11, char __b12, char __b13, char __b14, char __b15)
 {
-  return (__m128i)(__v16qi){ __b0, __b1, __b2, __b3, __b4, __b5, __b6, __b7, __b8, __b9, __b10, __b11, __b12, __b13, __b14, __b15 };
+  return _mm_set_epi8(__b0, __b1, __b2, __b3, __b4, __b5, __b6, __b7, __b8, __b9, __b10, __b11, __b12, __b13, __b14, __b15);
 }
 
 /// Creates a 128-bit integer vector initialized to zero.
@@ -3987,7 +3987,7 @@ _mm_setr_epi8(char __b0, char __b1, char
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_setzero_si128(void)
 {
-  return (__m128i){ 0LL, 0LL };
+  return __extension__ (__m128i)(__v2di){ 0LL, 0LL };
 }
 
 /// Stores a 128-bit integer vector to a memory location aligned on a
@@ -4704,7 +4704,7 @@ _mm_movepi64_pi64(__m128i __a)
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_movpi64_epi64(__m64 __a)
 {
-  return (__m128i){ (long long)__a, 0 };
+  return __extension__ (__m128i)(__v2di){ (long long)__a, 0 };
 }
 
 /// Moves the lower 64 bits of a 128-bit integer vector to a 128-bit
@@ -4722,7 +4722,7 @@ _mm_movpi64_epi64(__m64 __a)
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_move_epi64(__m128i __a)
 {
-  return __builtin_shufflevector((__v2di)__a, (__m128i){ 0 }, 0, 2);
+  return __builtin_shufflevector((__v2di)__a, _mm_setzero_si128(), 0, 2);
 }
 
 /// Unpacks the high-order 64-bit elements from two 128-bit vectors of

Modified: cfe/trunk/lib/Headers/xmmintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/xmmintrin.h?rev=333593&r1=333592&r2=333593&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/xmmintrin.h (original)
+++ cfe/trunk/lib/Headers/xmmintrin.h Wed May 30 14:08:27 2018
@@ -1692,7 +1692,7 @@ _mm_load_ss(const float *__p)
     float __u;
   } __attribute__((__packed__, __may_alias__));
   float __u = ((struct __mm_load_ss_struct*)__p)->__u;
-  return (__m128){ __u, 0, 0, 0 };
+  return __extension__ (__m128){ __u, 0, 0, 0 };
 }
 
 /// Loads a 32-bit float value and duplicates it to all four vector
@@ -1714,7 +1714,7 @@ _mm_load1_ps(const float *__p)
     float __u;
   } __attribute__((__packed__, __may_alias__));
   float __u = ((struct __mm_load1_ps_struct*)__p)->__u;
-  return (__m128){ __u, __u, __u, __u };
+  return __extension__ (__m128){ __u, __u, __u, __u };
 }
 
 #define        _mm_load_ps1(p) _mm_load1_ps(p)
@@ -1806,7 +1806,7 @@ _mm_undefined_ps(void)
 static __inline__ __m128 __DEFAULT_FN_ATTRS
 _mm_set_ss(float __w)
 {
-  return (__m128){ __w, 0, 0, 0 };
+  return __extension__ (__m128){ __w, 0, 0, 0 };
 }
 
 /// Constructs a 128-bit floating-point vector of [4 x float], with each
@@ -1824,7 +1824,7 @@ _mm_set_ss(float __w)
 static __inline__ __m128 __DEFAULT_FN_ATTRS
 _mm_set1_ps(float __w)
 {
-  return (__m128){ __w, __w, __w, __w };
+  return __extension__ (__m128){ __w, __w, __w, __w };
 }
 
 /* Microsoft specific. */
@@ -1870,7 +1870,7 @@ _mm_set_ps1(float __w)
 static __inline__ __m128 __DEFAULT_FN_ATTRS
 _mm_set_ps(float __z, float __y, float __x, float __w)
 {
-  return (__m128){ __w, __x, __y, __z };
+  return __extension__ (__m128){ __w, __x, __y, __z };
 }
 
 /// Constructs a 128-bit floating-point vector of [4 x float],
@@ -1898,7 +1898,7 @@ _mm_set_ps(float __z, float __y, float _
 static __inline__ __m128 __DEFAULT_FN_ATTRS
 _mm_setr_ps(float __z, float __y, float __x, float __w)
 {
-  return (__m128){ __z, __y, __x, __w };
+  return __extension__ (__m128){ __z, __y, __x, __w };
 }
 
 /// Constructs a 128-bit floating-point vector of [4 x float] initialized
@@ -1913,7 +1913,7 @@ _mm_setr_ps(float __z, float __y, float
 static __inline__ __m128 __DEFAULT_FN_ATTRS
 _mm_setzero_ps(void)
 {
-  return (__m128){ 0, 0, 0, 0 };
+  return __extension__ (__m128){ 0, 0, 0, 0 };
 }
 
 /// Stores the upper 64 bits of a 128-bit vector of [4 x float] to a




More information about the cfe-commits mailing list