diff --git a/include/clang/Basic/BuiltinsX86.def b/include/clang/Basic/BuiltinsX86.def index 1e1e8f6306..8262b3e6a5 100644 --- a/include/clang/Basic/BuiltinsX86.def +++ b/include/clang/Basic/BuiltinsX86.def @@ -425,9 +425,9 @@ BUILTIN(__builtin_ia32_cvttps2dq256, "V8iV8f", "") BUILTIN(__builtin_ia32_vperm2f128_pd256, "V4dV4dV4dIc", "") BUILTIN(__builtin_ia32_vperm2f128_ps256, "V8fV8fV8fIc", "") BUILTIN(__builtin_ia32_vperm2f128_si256, "V8iV8iV8iIc", "") -BUILTIN(__builtin_ia32_vpermilpd, "V2dV2dc", "") +BUILTIN(__builtin_ia32_vpermilpd, "V2dV2dIc", "") BUILTIN(__builtin_ia32_vpermilps, "V4fV4fc", "") -BUILTIN(__builtin_ia32_vpermilpd256, "V4dV4dc", "") +BUILTIN(__builtin_ia32_vpermilpd256, "V4dV4dIc", "") BUILTIN(__builtin_ia32_vpermilps256, "V8fV8fc", "") BUILTIN(__builtin_ia32_vinsertf128_pd256, "V4dV4dV2dIc", "") BUILTIN(__builtin_ia32_vinsertf128_ps256, "V8fV8fV4fIc", "") @@ -436,8 +436,8 @@ BUILTIN(__builtin_ia32_sqrtpd256, "V4dV4d", "") BUILTIN(__builtin_ia32_sqrtps256, "V8fV8f", "") BUILTIN(__builtin_ia32_rsqrtps256, "V8fV8f", "") BUILTIN(__builtin_ia32_rcpps256, "V8fV8f", "") -BUILTIN(__builtin_ia32_roundpd256, "V4dV4di", "") -BUILTIN(__builtin_ia32_roundps256, "V8fV8fi", "") +BUILTIN(__builtin_ia32_roundpd256, "V4dV4dIi", "") +BUILTIN(__builtin_ia32_roundps256, "V8fV8fIi", "") BUILTIN(__builtin_ia32_vtestzpd, "iV2dV2d", "") BUILTIN(__builtin_ia32_vtestcpd, "iV2dV2d", "") BUILTIN(__builtin_ia32_vtestnzcpd, "iV2dV2d", "") diff --git a/lib/Headers/avxintrin.h b/lib/Headers/avxintrin.h index 4c7c4ced91..ea26fa575f 100644 --- a/lib/Headers/avxintrin.h +++ b/lib/Headers/avxintrin.h @@ -145,17 +145,13 @@ _mm256_rcp_ps(__m256 a) return (__m256)__builtin_ia32_rcpps256((__v8sf)a); } -static __inline __m256d __attribute__((__always_inline__, __nodebug__)) -_mm256_round_pd(__m256d v, const int m) -{ - return (__m256d)__builtin_ia32_roundpd256((__v4df)v, m); -} +#define _mm256_round_pd(V, M) __extension__ ({ \ + __m256d __V = (V); \ + (__m256d)__builtin_ia32_roundpd256((__v4df)__V, M); }) -static __inline __m256 __attribute__((__always_inline__, __nodebug__)) -_mm256_round_ps(__m256 v, const int m) -{ - return (__m256)__builtin_ia32_roundps256((__v8sf)v, m); -} +#define _mm256_round_ps(V, M) __extension__ ({ \ + __m256 __V = (V); \ + (__m256)__builtin_ia32_roundps256((__v8sf)__V, M); }) #define _mm256_ceil_pd(V) _mm256_round_pd((V), _MM_FROUND_CEIL) #define _mm256_floor_pd(V) _mm256_round_pd((V), _MM_FROUND_FLOOR) @@ -262,17 +258,13 @@ _mm256_permutevar_ps(__m256 a, __m256i c) (__v8si)c); } -static __inline __m128d __attribute__((__always_inline__, __nodebug__)) -_mm_permute_pd(__m128d a, const int c) -{ - return (__m128d)__builtin_ia32_vpermilpd((__v2df)a, c); -} +#define _mm_permute_pd(A, C) __extension__ ({ \ + __m128d __A = (A); \ + (__m128d)__builtin_ia32_vpermilpd((__v2df)__A, C); }) -static __inline __m256d __attribute__((__always_inline__, __nodebug__)) -_mm256_permute_pd(__m256d a, const int c) -{ - return (__m256d)__builtin_ia32_vpermilpd256((__v4df)a, c); -} +#define _mm256_permute_pd(A, C) __extension__ ({ \ + __m256d __A = (A); \ + (__m256d)__builtin_ia32_vpermilpd256((__v4df)__A, C); }) static __inline __m128 __attribute__((__always_inline__, __nodebug__)) _mm_permute_ps(__m128 a, const int c) diff --git a/test/CodeGen/builtins-x86.c b/test/CodeGen/builtins-x86.c index 728ade34c1..7f028e5932 100644 --- a/test/CodeGen/builtins-x86.c +++ b/test/CodeGen/builtins-x86.c @@ -434,8 +434,8 @@ void f0() { tmp_V8f = __builtin_ia32_sqrtps256(tmp_V8f); tmp_V8f = __builtin_ia32_rsqrtps256(tmp_V8f); tmp_V8f = __builtin_ia32_rcpps256(tmp_V8f); - tmp_V4d = __builtin_ia32_roundpd256(tmp_V4d, tmp_i); - tmp_V8f = __builtin_ia32_roundps256(tmp_V8f, tmp_i); + tmp_V4d = __builtin_ia32_roundpd256(tmp_V4d, 0x1); + tmp_V8f = __builtin_ia32_roundps256(tmp_V8f, 0x1); tmp_i = __builtin_ia32_vtestzpd(tmp_V2d, tmp_V2d); tmp_i = __builtin_ia32_vtestcpd(tmp_V2d, tmp_V2d); tmp_i = __builtin_ia32_vtestnzcpd(tmp_V2d, tmp_V2d);