From 0adfe7aa2f41d940c2198c98828bdb07c64fd082 Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Sat, 17 Dec 2011 01:22:27 +0000 Subject: [PATCH] Fix _mm256_extractf128_* AVX intrinsics to use "I" (ICE) markings. Fix avxintrin.h to take them into account. Part of rdar://10595450 llvm-svn: 146804 --- clang/include/clang/Basic/BuiltinsX86.def | 6 +++--- clang/lib/Headers/avxintrin.h | 24 +++++++++-------------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/clang/include/clang/Basic/BuiltinsX86.def b/clang/include/clang/Basic/BuiltinsX86.def index 88aaf679747f..eefefb5fe151 100644 --- a/clang/include/clang/Basic/BuiltinsX86.def +++ b/clang/include/clang/Basic/BuiltinsX86.def @@ -411,9 +411,9 @@ BUILTIN(__builtin_ia32_blendvps256, "V8fV8fV8fV8f", "") BUILTIN(__builtin_ia32_dpps256, "V8fV8fV8fIi", "") BUILTIN(__builtin_ia32_cmppd256, "V4dV4dV4dc", "") BUILTIN(__builtin_ia32_cmpps256, "V8fV8fV8fc", "") -BUILTIN(__builtin_ia32_vextractf128_pd256, "V2dV4dc", "") -BUILTIN(__builtin_ia32_vextractf128_ps256, "V4fV8fc", "") -BUILTIN(__builtin_ia32_vextractf128_si256, "V4iV8ic", "") +BUILTIN(__builtin_ia32_vextractf128_pd256, "V2dV4dIc", "") +BUILTIN(__builtin_ia32_vextractf128_ps256, "V4fV8fIc", "") +BUILTIN(__builtin_ia32_vextractf128_si256, "V4iV8iIc", "") BUILTIN(__builtin_ia32_cvtdq2pd256, "V4dV4i", "") BUILTIN(__builtin_ia32_cvtdq2ps256, "V8fV8i", "") BUILTIN(__builtin_ia32_cvtpd2ps256, "V4fV4d", "") diff --git a/clang/lib/Headers/avxintrin.h b/clang/lib/Headers/avxintrin.h index bb3246273613..fc606b37770f 100644 --- a/clang/lib/Headers/avxintrin.h +++ b/clang/lib/Headers/avxintrin.h @@ -410,23 +410,17 @@ _mm256_blendv_ps(__m256 a, __m256 b, __m256 c) (__m128)__builtin_ia32_cmpss((__v4sf)__a, (__v4sf)__b, (c)); }) /* Vector extract */ -static __inline __m128d __attribute__((__always_inline__, __nodebug__)) -_mm256_extractf128_pd(__m256d a, const int o) -{ - return (__m128d)__builtin_ia32_vextractf128_pd256((__v4df)a, o); -} +#define _mm256_extractf128_pd(A, O) __extension__ ({ \ + __m256d __A = (A); \ + (__m128d)__builtin_ia32_vextractf128_pd256((__v4df)__A, O); }) -static __inline __m128 __attribute__((__always_inline__, __nodebug__)) -_mm256_extractf128_ps(__m256 a, const int o) -{ - return (__m128)__builtin_ia32_vextractf128_ps256((__v8sf)a, o); -} +#define _mm256_extractf128_ps(A, O) __extension__ ({ \ + __m256 __A = (A); \ + (__m128)__builtin_ia32_vextractf128_ps256((__v8sf)__A, O); }) -static __inline __m128i __attribute__((__always_inline__, __nodebug__)) -_mm256_extractf128_si256(__m256i a, const int o) -{ - return (__m128i)__builtin_ia32_vextractf128_si256((__v8si)a, o); -} +#define _mm256_extractf128_si256(A, O) __extension__ ({ \ + __m256i __A = (A); \ + (__m128i)__builtin_ia32_vextractf128_si256((__v8si)__A, O); }) static __inline int __attribute__((__always_inline__, __nodebug__)) _mm256_extract_epi32(__m256i a, int const imm)