2727 __min_vector_width__(128 )))
2828#endif
2929
30+ #if defined(__cplusplus) && (__cplusplus >= 201103L)
31+ #define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
32+ #else
33+ #define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
34+ #endif
35+
3036// / Loads data from an unaligned memory location to elements in a 128-bit
3137// / vector.
3238// /
@@ -128,7 +134,7 @@ _mm_hsub_ps(__m128 __a, __m128 __b)
128134// / destination.
129135// / \returns A 128-bit vector of [4 x float] containing the moved and duplicated
130136// / values.
131- static __inline__ __m128 __DEFAULT_FN_ATTRS
137+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
132138_mm_movehdup_ps (__m128 __a)
133139{
134140 return __builtin_shufflevector ((__v4sf)__a, (__v4sf)__a, 1 , 1 , 3 , 3 );
@@ -149,7 +155,7 @@ _mm_movehdup_ps(__m128 __a)
149155// / destination.
150156// / \returns A 128-bit vector of [4 x float] containing the moved and duplicated
151157// / values.
152- static __inline__ __m128 __DEFAULT_FN_ATTRS
158+ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
153159_mm_moveldup_ps (__m128 __a)
154160{
155161 return __builtin_shufflevector ((__v4sf)__a, (__v4sf)__a, 0 , 0 , 2 , 2 );
@@ -250,7 +256,7 @@ _mm_hsub_pd(__m128d __a, __m128d __b)
250256// / [127:64] and [63:0] of the destination.
251257// / \returns A 128-bit vector of [2 x double] containing the moved and
252258// / duplicated values.
253- static __inline__ __m128d __DEFAULT_FN_ATTRS
259+ static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
254260_mm_movedup_pd (__m128d __a)
255261{
256262 return __builtin_shufflevector ((__v2df)__a, (__v2df)__a, 0 , 0 );
@@ -303,5 +309,6 @@ _mm_mwait(unsigned __extensions, unsigned __hints)
303309}
304310
305311#undef __DEFAULT_FN_ATTRS
312+ #undef __DEFAULT_FN_ATTRS_CONSTEXPR
306313
307314#endif /* __PMMINTRIN_H */
0 commit comments