From f16beb39429b3adcbd0c1baf018bc021ad844957 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 10 Nov 2011 00:11:13 +0000 Subject: [PATCH] Fix some additional x86 intrinsics to use "I" (ICE) markings. Fix *mmintrin.h to take them into account. llvm-svn: 144246 --- clang/include/clang/Basic/BuiltinsX86.def | 12 +++++----- clang/lib/Headers/avxintrin.h | 27 ++++++++++------------- clang/lib/Headers/smmintrin.h | 27 ++++++++++------------- 3 files changed, 30 insertions(+), 36 deletions(-) diff --git a/clang/include/clang/Basic/BuiltinsX86.def b/clang/include/clang/Basic/BuiltinsX86.def index 8ed8c7aa6f60..cfe4e6f5d1f0 100644 --- a/clang/include/clang/Basic/BuiltinsX86.def +++ b/clang/include/clang/Basic/BuiltinsX86.def @@ -314,9 +314,9 @@ BUILTIN(__builtin_ia32_insertps128, "V4fV4fV4fi", "") BUILTIN(__builtin_ia32_storelv4si, "vV2i*V2LLi", "") BUILTIN(__builtin_ia32_pblendvb128, "V16cV16cV16cV16c", "") -BUILTIN(__builtin_ia32_pblendw128, "V8sV8sV8si", "") -BUILTIN(__builtin_ia32_blendpd, "V2dV2dV2di", "") -BUILTIN(__builtin_ia32_blendps, "V4fV4fV4fi", "") +BUILTIN(__builtin_ia32_pblendw128, "V8sV8sV8sIi", "") +BUILTIN(__builtin_ia32_blendpd, "V2dV2dV2dIi", "") +BUILTIN(__builtin_ia32_blendps, "V4fV4fV4fIi", "") BUILTIN(__builtin_ia32_blendvpd, "V2dV2dV2dV2d", "") BUILTIN(__builtin_ia32_blendvps, "V4fV4fV4fV4f", "") @@ -404,11 +404,11 @@ BUILTIN(__builtin_ia32_vpermilvarpd, "V2dV2dV2LLi", "") BUILTIN(__builtin_ia32_vpermilvarps, "V4fV4fV4i", "") BUILTIN(__builtin_ia32_vpermilvarpd256, "V4dV4dV4LLi", "") BUILTIN(__builtin_ia32_vpermilvarps256, "V8fV8fV8i", "") -BUILTIN(__builtin_ia32_blendpd256, "V4dV4dV4di", "") -BUILTIN(__builtin_ia32_blendps256, "V8fV8fV8fi", "") +BUILTIN(__builtin_ia32_blendpd256, "V4dV4dV4dIi", "") +BUILTIN(__builtin_ia32_blendps256, "V8fV8fV8fIi", "") BUILTIN(__builtin_ia32_blendvpd256, "V4dV4dV4dV4d", "") BUILTIN(__builtin_ia32_blendvps256, "V8fV8fV8fV8f", "") -BUILTIN(__builtin_ia32_dpps256, "V8fV8fV8fi", "") +BUILTIN(__builtin_ia32_dpps256, "V8fV8fV8fIi", "") BUILTIN(__builtin_ia32_cmppd256, "V4dV4dV4dc", "") BUILTIN(__builtin_ia32_cmpps256, "V8fV8fV8fc", "") BUILTIN(__builtin_ia32_vextractf128_pd256, "V2dV4dc", "") diff --git a/clang/lib/Headers/avxintrin.h b/clang/lib/Headers/avxintrin.h index b2d16d5386ad..85a2c747c2f0 100644 --- a/clang/lib/Headers/avxintrin.h +++ b/clang/lib/Headers/avxintrin.h @@ -305,17 +305,15 @@ _mm256_permute2f128_si256(__m256i a, __m256i b, const int c) } /* Vector Blend */ -static __inline __m256d __attribute__((__always_inline__, __nodebug__)) -_mm256_blend_pd(__m256d a, __m256d b, const int c) -{ - return (__m256d)__builtin_ia32_blendpd256((__v4df)a, (__v4df)b, c); -} +#define _mm256_blend_pd(V1, V2, M) __extension__ ({ \ + __m256d __V1 = (V1); \ + __m256d __V2 = (V2); \ + (__m256d)__builtin_ia32_blendpd256((__v4df)__V1, (__v4df)__V2, M); }) -static __inline __m256 __attribute__((__always_inline__, __nodebug__)) -_mm256_blend_ps(__m256 a, __m256 b, const int c) -{ - return (__m256)__builtin_ia32_blendps256((__v8sf)a, (__v8sf)b, c); -} +#define _mm256_blend_ps(V1, V2, M) __extension__ ({ \ + __m256 __V1 = (V1); \ + __m256 __V2 = (V2); \ + (__m256)__builtin_ia32_blendps256((__v8sf)__V1, (__v8sf)__V2, M); }) static __inline __m256d __attribute__((__always_inline__, __nodebug__)) _mm256_blendv_pd(__m256d a, __m256d b, __m256d c) @@ -330,11 +328,10 @@ _mm256_blendv_ps(__m256 a, __m256 b, __m256 c) } /* Vector Dot Product */ -static __inline __m256 __attribute__((__always_inline__, __nodebug__)) -_mm256_dp_ps(__m256 a, __m256 b, const int c) -{ - return (__m256)__builtin_ia32_dpps256((__v8sf)a, (__v8sf)b, c); -} +#define _mm256_dp_ps(V1, V2, M) __extension__ ({ \ + __m256 __V1 = (V1); \ + __m256 __V2 = (V2); \ + (__m256)__builtin_ia32_dpps256((__v8sf)__V1, (__v8sf)__V2, M); }) /* Vector shuffle */ #define _mm256_shuffle_ps(a, b, mask) __extension__ ({ \ diff --git a/clang/lib/Headers/smmintrin.h b/clang/lib/Headers/smmintrin.h index aa0c031d8669..09ae2ba314d8 100644 --- a/clang/lib/Headers/smmintrin.h +++ b/clang/lib/Headers/smmintrin.h @@ -63,17 +63,15 @@ #define _mm_round_sd(X, Y, M) __builtin_ia32_roundsd((X), (Y), (M)) /* SSE4 Packed Blending Intrinsics. */ -static __inline__ __m128d __attribute__((__always_inline__, __nodebug__)) -_mm_blend_pd (__m128d __V1, __m128d __V2, const int __M) -{ - return (__m128d) __builtin_ia32_blendpd ((__v2df)__V1, (__v2df)__V2, __M); -} +#define _mm_blend_pd(V1, V2, M) __extension__ ({ \ + __m128d __V1 = (V1); \ + __m128d __V2 = (V2); \ + (__m128d) __builtin_ia32_blendpd ((__v2df)__V1, (__v2df)__V2, M); }) -static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) -_mm_blend_ps (__m128 __V1, __m128 __V2, const int __M) -{ - return (__m128) __builtin_ia32_blendps ((__v4sf)__V1, (__v4sf)__V2, __M); -} +#define _mm_blend_ps(V1, V2, M) __extension__ ({ \ + __m128 __V1 = (V1); \ + __m128 __V2 = (V2); \ + (__m128) __builtin_ia32_blendps ((__v4sf)__V1, (__v4sf)__V2, M); }) static __inline__ __m128d __attribute__((__always_inline__, __nodebug__)) _mm_blendv_pd (__m128d __V1, __m128d __V2, __m128d __M) @@ -96,11 +94,10 @@ _mm_blendv_epi8 (__m128i __V1, __m128i __V2, __m128i __M) (__v16qi)__M); } -static __inline__ __m128i __attribute__((__always_inline__, __nodebug__)) -_mm_blend_epi16 (__m128i __V1, __m128i __V2, const int __M) -{ - return (__m128i) __builtin_ia32_pblendw128 ((__v8hi)__V1, (__v8hi)__V2, __M); -} +#define _mm_blend_epi16(V1, V2, M) __extension__ ({ \ + __m128i __V1 = (V1); \ + __m128i __V2 = (V2); \ + (__m128i) __builtin_ia32_pblendw128 ((__v8hi)__V1, (__v8hi)__V2, M); }) /* SSE4 Dword Multiply Instructions. */ static __inline__ __m128i __attribute__((__always_inline__, __nodebug__))