From 1e4faf56cd310dbd89b7d192db57c3d120bec8a2 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146804 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/BuiltinsX86.def | 6 +++--- lib/Headers/avxintrin.h | 24 +++++++++--------------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/include/clang/Basic/BuiltinsX86.def b/include/clang/Basic/BuiltinsX86.def index 88aaf67974..eefefb5fe1 100644 --- a/include/clang/Basic/BuiltinsX86.def +++ b/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/lib/Headers/avxintrin.h b/lib/Headers/avxintrin.h index bb32462736..fc606b3777 100644 --- a/lib/Headers/avxintrin.h +++ b/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) -- 2.40.0