@@ -48,6 +48,14 @@ typedef unsigned int __v4su __attribute__((__vector_size__(16)));
48
48
__min_vector_width__(128 )))
49
49
#endif
50
50
51
+ #if defined(__cplusplus) && (__cplusplus >= 201103L)
52
+ #define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
53
+ #define __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR __DEFAULT_FN_ATTRS_SSE2 constexpr
54
+ #else
55
+ #define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
56
+ #define __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR __DEFAULT_FN_ATTRS_SSE2
57
+ #endif
58
+
51
59
#define __trunc64 (x ) \
52
60
(__m64) __builtin_shufflevector((__v2di)(x), __extension__(__v2di){}, 0 )
53
61
#define __zext128 (x ) \
@@ -75,9 +83,8 @@ typedef unsigned int __v4su __attribute__((__vector_size__(16)));
75
83
// / \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the sum
76
84
// / of the lower 32 bits of both operands. The upper 96 bits are copied from
77
85
// / the upper 96 bits of the first source operand.
78
- static __inline__ __m128 __DEFAULT_FN_ATTRS
79
- _mm_add_ss (__m128 __a , __m128 __b )
80
- {
86
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
87
+ _mm_add_ss (__m128 __a, __m128 __b) {
81
88
__a[0 ] += __b[0 ];
82
89
return __a;
83
90
}
@@ -95,9 +102,8 @@ _mm_add_ss(__m128 __a, __m128 __b)
95
102
// / A 128-bit vector of [4 x float] containing one of the source operands.
96
103
// / \returns A 128-bit vector of [4 x float] containing the sums of both
97
104
// / operands.
98
- static __inline__ __m128 __DEFAULT_FN_ATTRS
99
- _mm_add_ps (__m128 __a , __m128 __b )
100
- {
105
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
106
+ _mm_add_ps (__m128 __a, __m128 __b) {
101
107
return (__m128)((__v4sf)__a + (__v4sf)__b);
102
108
}
103
109
@@ -117,9 +123,8 @@ _mm_add_ps(__m128 __a, __m128 __b)
117
123
// / \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the
118
124
// / difference of the lower 32 bits of both operands. The upper 96 bits are
119
125
// / copied from the upper 96 bits of the first source operand.
120
- static __inline__ __m128 __DEFAULT_FN_ATTRS
121
- _mm_sub_ss (__m128 __a , __m128 __b )
122
- {
126
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
127
+ _mm_sub_ss (__m128 __a, __m128 __b) {
123
128
__a[0 ] -= __b[0 ];
124
129
return __a;
125
130
}
@@ -138,9 +143,8 @@ _mm_sub_ss(__m128 __a, __m128 __b)
138
143
// / A 128-bit vector of [4 x float] containing the subtrahend.
139
144
// / \returns A 128-bit vector of [4 x float] containing the differences between
140
145
// / both operands.
141
- static __inline__ __m128 __DEFAULT_FN_ATTRS
142
- _mm_sub_ps (__m128 __a , __m128 __b )
143
- {
146
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
147
+ _mm_sub_ps (__m128 __a, __m128 __b) {
144
148
return (__m128)((__v4sf)__a - (__v4sf)__b);
145
149
}
146
150
@@ -160,9 +164,8 @@ _mm_sub_ps(__m128 __a, __m128 __b)
160
164
// / \returns A 128-bit vector of [4 x float] containing the product of the lower
161
165
// / 32 bits of both operands. The upper 96 bits are copied from the upper 96
162
166
// / bits of the first source operand.
163
- static __inline__ __m128 __DEFAULT_FN_ATTRS
164
- _mm_mul_ss (__m128 __a , __m128 __b )
165
- {
167
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
168
+ _mm_mul_ss (__m128 __a, __m128 __b) {
166
169
__a[0 ] *= __b[0 ];
167
170
return __a;
168
171
}
@@ -180,9 +183,8 @@ _mm_mul_ss(__m128 __a, __m128 __b)
180
183
// / A 128-bit vector of [4 x float] containing one of the source operands.
181
184
// / \returns A 128-bit vector of [4 x float] containing the products of both
182
185
// / operands.
183
- static __inline__ __m128 __DEFAULT_FN_ATTRS
184
- _mm_mul_ps (__m128 __a , __m128 __b )
185
- {
186
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
187
+ _mm_mul_ps (__m128 __a, __m128 __b) {
186
188
return (__m128)((__v4sf)__a * (__v4sf)__b);
187
189
}
188
190
@@ -202,9 +204,8 @@ _mm_mul_ps(__m128 __a, __m128 __b)
202
204
// / \returns A 128-bit vector of [4 x float] containing the quotients of the
203
205
// / lower 32 bits of both operands. The upper 96 bits are copied from the
204
206
// / upper 96 bits of the first source operand.
205
- static __inline__ __m128 __DEFAULT_FN_ATTRS
206
- _mm_div_ss (__m128 __a , __m128 __b )
207
- {
207
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
208
+ _mm_div_ss (__m128 __a, __m128 __b) {
208
209
__a[0 ] /= __b[0 ];
209
210
return __a;
210
211
}
@@ -221,9 +222,8 @@ _mm_div_ss(__m128 __a, __m128 __b)
221
222
// / A 128-bit vector of [4 x float] containing the divisor.
222
223
// / \returns A 128-bit vector of [4 x float] containing the quotients of both
223
224
// / operands.
224
- static __inline__ __m128 __DEFAULT_FN_ATTRS
225
- _mm_div_ps (__m128 __a , __m128 __b )
226
- {
225
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
226
+ _mm_div_ps (__m128 __a, __m128 __b) {
227
227
return (__m128)((__v4sf)__a / (__v4sf)__b);
228
228
}
229
229
@@ -437,9 +437,8 @@ _mm_max_ps(__m128 __a, __m128 __b)
437
437
// / A 128-bit vector containing one of the source operands.
438
438
// / \returns A 128-bit vector of [4 x float] containing the bitwise AND of the
439
439
// / values between both operands.
440
- static __inline__ __m128 __DEFAULT_FN_ATTRS
441
- _mm_and_ps (__m128 __a , __m128 __b )
442
- {
440
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
441
+ _mm_and_ps (__m128 __a, __m128 __b) {
443
442
return (__m128)((__v4su)__a & (__v4su)__b);
444
443
}
445
444
@@ -459,9 +458,8 @@ _mm_and_ps(__m128 __a, __m128 __b)
459
458
// / \returns A 128-bit vector of [4 x float] containing the bitwise AND of the
460
459
// / one's complement of the first operand and the values in the second
461
460
// / operand.
462
- static __inline__ __m128 __DEFAULT_FN_ATTRS
463
- _mm_andnot_ps (__m128 __a , __m128 __b )
464
- {
461
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
462
+ _mm_andnot_ps (__m128 __a, __m128 __b) {
465
463
return (__m128)(~(__v4su)__a & (__v4su)__b);
466
464
}
467
465
@@ -477,9 +475,8 @@ _mm_andnot_ps(__m128 __a, __m128 __b)
477
475
// / A 128-bit vector of [4 x float] containing one of the source operands.
478
476
// / \returns A 128-bit vector of [4 x float] containing the bitwise OR of the
479
477
// / values between both operands.
480
- static __inline__ __m128 __DEFAULT_FN_ATTRS
481
- _mm_or_ps (__m128 __a , __m128 __b )
482
- {
478
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
479
+ _mm_or_ps (__m128 __a, __m128 __b) {
483
480
return (__m128)((__v4su)__a | (__v4su)__b);
484
481
}
485
482
@@ -496,9 +493,8 @@ _mm_or_ps(__m128 __a, __m128 __b)
496
493
// / A 128-bit vector of [4 x float] containing one of the source operands.
497
494
// / \returns A 128-bit vector of [4 x float] containing the bitwise exclusive OR
498
495
// / of the values between both operands.
499
- static __inline__ __m128 __DEFAULT_FN_ATTRS
500
- _mm_xor_ps (__m128 __a , __m128 __b )
501
- {
496
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
497
+ _mm_xor_ps (__m128 __a, __m128 __b) {
502
498
return (__m128)((__v4su)__a ^ (__v4su)__b);
503
499
}
504
500
@@ -1738,9 +1734,8 @@ _mm_cvt_pi2ps(__m128 __a, __m64 __b)
1738
1734
// / A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1739
1735
// / used in the extraction.
1740
1736
// / \returns A 32-bit float containing the extracted value.
1741
- static __inline__ float __DEFAULT_FN_ATTRS
1742
- _mm_cvtss_f32 (__m128 __a )
1743
- {
1737
+ static __inline__ float __DEFAULT_FN_ATTRS_CONSTEXPR
1738
+ _mm_cvtss_f32 (__m128 __a) {
1744
1739
return __a[0 ];
1745
1740
}
1746
1741
@@ -1931,9 +1926,8 @@ _mm_undefined_ps(void)
1931
1926
// / \returns An initialized 128-bit floating-point vector of [4 x float]. The
1932
1927
// / lower 32 bits contain the value provided in the source operand. The
1933
1928
// / upper 96 bits are set to zero.
1934
- static __inline__ __m128 __DEFAULT_FN_ATTRS
1935
- _mm_set_ss (float __w )
1936
- {
1929
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
1930
+ _mm_set_ss (float __w) {
1937
1931
return __extension__ (__m128){ __w, 0 .0f , 0 .0f , 0 .0f };
1938
1932
}
1939
1933
@@ -1949,9 +1943,8 @@ _mm_set_ss(float __w)
1949
1943
// / A single-precision floating-point value used to initialize each vector
1950
1944
// / element of the result.
1951
1945
// / \returns An initialized 128-bit floating-point vector of [4 x float].
1952
- static __inline__ __m128 __DEFAULT_FN_ATTRS
1953
- _mm_set1_ps (float __w )
1954
- {
1946
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
1947
+ _mm_set1_ps (float __w) {
1955
1948
return __extension__ (__m128){ __w, __w, __w, __w };
1956
1949
}
1957
1950
@@ -1968,9 +1961,8 @@ _mm_set1_ps(float __w)
1968
1961
// / A single-precision floating-point value used to initialize each vector
1969
1962
// / element of the result.
1970
1963
// / \returns An initialized 128-bit floating-point vector of [4 x float].
1971
- static __inline__ __m128 __DEFAULT_FN_ATTRS
1972
- _mm_set_ps1 (float __w )
1973
- {
1964
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
1965
+ _mm_set_ps1 (float __w) {
1974
1966
return _mm_set1_ps (__w);
1975
1967
}
1976
1968
@@ -1995,9 +1987,8 @@ _mm_set_ps1(float __w)
1995
1987
// / A single-precision floating-point value used to initialize bits [31:0]
1996
1988
// / of the result.
1997
1989
// / \returns An initialized 128-bit floating-point vector of [4 x float].
1998
- static __inline__ __m128 __DEFAULT_FN_ATTRS
1999
- _mm_set_ps (float __z , float __y , float __x , float __w )
2000
- {
1990
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
1991
+ _mm_set_ps (float __z, float __y, float __x, float __w) {
2001
1992
return __extension__ (__m128){ __w, __x, __y, __z };
2002
1993
}
2003
1994
@@ -2023,9 +2014,8 @@ _mm_set_ps(float __z, float __y, float __x, float __w)
2023
2014
// / A single-precision floating-point value used to initialize bits [127:96]
2024
2015
// / of the result.
2025
2016
// / \returns An initialized 128-bit floating-point vector of [4 x float].
2026
- static __inline__ __m128 __DEFAULT_FN_ATTRS
2027
- _mm_setr_ps (float __z , float __y , float __x , float __w )
2028
- {
2017
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
2018
+ _mm_setr_ps (float __z, float __y, float __x, float __w) {
2029
2019
return __extension__ (__m128){ __z, __y, __x, __w };
2030
2020
}
2031
2021
@@ -2038,9 +2028,8 @@ _mm_setr_ps(float __z, float __y, float __x, float __w)
2038
2028
// /
2039
2029
// / \returns An initialized 128-bit floating-point vector of [4 x float] with
2040
2030
// / all elements set to zero.
2041
- static __inline__ __m128 __DEFAULT_FN_ATTRS
2042
- _mm_setzero_ps (void )
2043
- {
2031
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
2032
+ _mm_setzero_ps (void ) {
2044
2033
return __extension__ (__m128){ 0 .0f , 0 .0f , 0 .0f , 0 .0f };
2045
2034
}
2046
2035
@@ -2786,9 +2775,8 @@ void _mm_setcsr(unsigned int __i);
2786
2775
// / Bits [95:64] are written to bits [63:32] of the destination. \n
2787
2776
// / Bits [127:96] are written to bits [127:96] of the destination.
2788
2777
// / \returns A 128-bit vector of [4 x float] containing the interleaved values.
2789
- static __inline__ __m128 __DEFAULT_FN_ATTRS
2790
- _mm_unpackhi_ps (__m128 __a , __m128 __b )
2791
- {
2778
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
2779
+ _mm_unpackhi_ps (__m128 __a, __m128 __b) {
2792
2780
return __builtin_shufflevector ((__v4sf)__a, (__v4sf)__b, 2 , 6 , 3 , 7 );
2793
2781
}
2794
2782
@@ -2808,9 +2796,8 @@ _mm_unpackhi_ps(__m128 __a, __m128 __b)
2808
2796
// / Bits [31:0] are written to bits [63:32] of the destination. \n
2809
2797
// / Bits [63:32] are written to bits [127:96] of the destination.
2810
2798
// / \returns A 128-bit vector of [4 x float] containing the interleaved values.
2811
- static __inline__ __m128 __DEFAULT_FN_ATTRS
2812
- _mm_unpacklo_ps (__m128 __a , __m128 __b )
2813
- {
2799
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
2800
+ _mm_unpacklo_ps (__m128 __a, __m128 __b) {
2814
2801
return __builtin_shufflevector ((__v4sf)__a, (__v4sf)__b, 0 , 4 , 1 , 5 );
2815
2802
}
2816
2803
@@ -2830,9 +2817,8 @@ _mm_unpacklo_ps(__m128 __a, __m128 __b)
2830
2817
// / A 128-bit floating-point vector of [4 x float]. The lower 32 bits are
2831
2818
// / written to the lower 32 bits of the result.
2832
2819
// / \returns A 128-bit floating-point vector of [4 x float].
2833
- static __inline__ __m128 __DEFAULT_FN_ATTRS
2834
- _mm_move_ss (__m128 __a , __m128 __b )
2835
- {
2820
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
2821
+ _mm_move_ss (__m128 __a, __m128 __b) {
2836
2822
__a[0 ] = __b[0 ];
2837
2823
return __a;
2838
2824
}
@@ -2852,9 +2838,8 @@ _mm_move_ss(__m128 __a, __m128 __b)
2852
2838
// / A 128-bit floating-point vector of [4 x float]. The upper 64 bits are
2853
2839
// / written to the lower 64 bits of the result.
2854
2840
// / \returns A 128-bit floating-point vector of [4 x float].
2855
- static __inline__ __m128 __DEFAULT_FN_ATTRS
2856
- _mm_movehl_ps (__m128 __a , __m128 __b )
2857
- {
2841
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
2842
+ _mm_movehl_ps (__m128 __a, __m128 __b) {
2858
2843
return __builtin_shufflevector ((__v4sf)__a, (__v4sf)__b, 6 , 7 , 2 , 3 );
2859
2844
}
2860
2845
@@ -2873,9 +2858,8 @@ _mm_movehl_ps(__m128 __a, __m128 __b)
2873
2858
// / A 128-bit floating-point vector of [4 x float]. The lower 64 bits are
2874
2859
// / written to the upper 64 bits of the result.
2875
2860
// / \returns A 128-bit floating-point vector of [4 x float].
2876
- static __inline__ __m128 __DEFAULT_FN_ATTRS
2877
- _mm_movelh_ps (__m128 __a , __m128 __b )
2878
- {
2861
+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
2862
+ _mm_movelh_ps (__m128 __a, __m128 __b) {
2879
2863
return __builtin_shufflevector ((__v4sf)__a, (__v4sf)__b, 0 , 1 , 4 , 5 );
2880
2864
}
2881
2865
@@ -3207,7 +3191,9 @@ do { \
3207
3191
#undef __anyext128
3208
3192
#undef __zeroupper64
3209
3193
#undef __DEFAULT_FN_ATTRS
3194
+ #undef __DEFAULT_FN_ATTRS_CONSTEXPR
3210
3195
#undef __DEFAULT_FN_ATTRS_SSE2
3196
+ #undef __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
3211
3197
3212
3198
/* Ugly hack for backwards-compatibility (compatible with gcc) */
3213
3199
#if defined(__SSE2__) && !__building_module(_Builtin_intrinsics)
0 commit comments