From cf7881a99f1557a84bf61e1eefd50daef7afa254 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sun, 29 Nov 2015 22:53:32 +0000 Subject: [PATCH] [X86] _mm256_permutevar8x32_ps should take an integer vector for its shuffle index input. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254270 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/BuiltinsX86.def | 2 +- lib/Headers/avx2intrin.h | 4 ++-- test/CodeGen/avx2-builtins.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/clang/Basic/BuiltinsX86.def b/include/clang/Basic/BuiltinsX86.def index cd682f1cf1..eeae2a1b60 100644 --- a/include/clang/Basic/BuiltinsX86.def +++ b/include/clang/Basic/BuiltinsX86.def @@ -597,7 +597,7 @@ TARGET_BUILTIN(__builtin_ia32_psrlqi256, "V4LLiV4LLii", "", "avx2") TARGET_BUILTIN(__builtin_ia32_psrlq256, "V4LLiV4LLiV2LLi", "", "avx2") TARGET_BUILTIN(__builtin_ia32_movntdqa256, "V4LLiV4LLiC*", "", "avx2") TARGET_BUILTIN(__builtin_ia32_permvarsi256, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_permvarsf256, "V8fV8fV8f", "", "avx2") +TARGET_BUILTIN(__builtin_ia32_permvarsf256, "V8fV8fV8i", "", "avx2") TARGET_BUILTIN(__builtin_ia32_permti256, "V4LLiV4LLiV4LLiIc", "", "avx2") TARGET_BUILTIN(__builtin_ia32_maskloadd256, "V8iV8iC*V8i", "", "avx2") TARGET_BUILTIN(__builtin_ia32_maskloadq256, "V4LLiV4LLiC*V4LLi", "", "avx2") diff --git a/lib/Headers/avx2intrin.h b/lib/Headers/avx2intrin.h index 84b40b11ea..8a57b0f99e 100644 --- a/lib/Headers/avx2intrin.h +++ b/lib/Headers/avx2intrin.h @@ -867,9 +867,9 @@ _mm256_permutevar8x32_epi32(__m256i __a, __m256i __b) ((M) & 0x30) >> 4, ((M) & 0xc0) >> 6); }) static __inline__ __m256 __DEFAULT_FN_ATTRS -_mm256_permutevar8x32_ps(__m256 __a, __m256 __b) +_mm256_permutevar8x32_ps(__m256 __a, __m256i __b) { - return (__m256)__builtin_ia32_permvarsf256((__v8sf)__a, (__v8sf)__b); + return (__m256)__builtin_ia32_permvarsf256((__v8sf)__a, (__v8si)__b); } #define _mm256_permute4x64_epi64(V, M) __extension__ ({ \ diff --git a/test/CodeGen/avx2-builtins.c b/test/CodeGen/avx2-builtins.c index 3f710c15bf..8e4f057616 100644 --- a/test/CodeGen/avx2-builtins.c +++ b/test/CodeGen/avx2-builtins.c @@ -862,7 +862,7 @@ __m256d test_mm256_permute4x64_pd(__m256d a) { return _mm256_permute4x64_pd(a, 25); } -__m256 test_mm256_permutevar8x32_ps(__m256 a, __m256 b) { +__m256 test_mm256_permutevar8x32_ps(__m256 a, __m256i b) { // CHECK: @llvm.x86.avx2.permps // CHECK-ASM: vpermps %ymm{{.*}}, %ymm{{.*}}, %ymm{{.*}} return _mm256_permutevar8x32_ps(a, b);