[cfe-commits] r153724 - in /cfe/trunk: lib/Headers/avxintrin.h test/CodeGen/avx-shuffle-builtins.c
Craig Topper
craig.topper at gmail.com
Thu Mar 29 22:09:18 PDT 2012
Author: ctopper
Date: Fri Mar 30 00:09:18 2012
New Revision: 153724
URL: http://llvm.org/viewvc/llvm-project?rev=153724&view=rev
Log:
Fix shuffle vector calculation for mm_permute_ps. Fixes PR 12401.
Modified:
cfe/trunk/lib/Headers/avxintrin.h
cfe/trunk/test/CodeGen/avx-shuffle-builtins.c
Modified: cfe/trunk/lib/Headers/avxintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avxintrin.h?rev=153724&r1=153723&r2=153724&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avxintrin.h (original)
+++ cfe/trunk/lib/Headers/avxintrin.h Fri Mar 30 00:09:18 2012
@@ -274,7 +274,7 @@
__m128 __A = (A); \
(__m128)__builtin_shufflevector((__v4sf)__A, (__v4sf) _mm_setzero_ps(), \
(C) & 0x3, ((C) & 0xc) >> 2, \
- ((C) & 0x30) >> 4, ((C) & 0xc0) >> 8); })
+ ((C) & 0x30) >> 4, ((C) & 0xc0) >> 6); })
#define _mm256_permute_ps(A, C) __extension__ ({ \
__m256 __A = (A); \
Modified: cfe/trunk/test/CodeGen/avx-shuffle-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx-shuffle-builtins.c?rev=153724&r1=153723&r2=153724&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx-shuffle-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx-shuffle-builtins.c Fri Mar 30 00:09:18 2012
@@ -33,6 +33,13 @@
return _mm_permute_ps(a, 0x1b);
}
+// Test case for PR12401
+__m128 test_mm_permute_ps2(__m128 a) {
+ // Check if the mask is correct
+ // CHECK: shufflevector{{.*}}<i32 2, i32 1, i32 2, i32 3>
+ return _mm_permute_ps(a, 0xe6);
+}
+
__m256 test_mm256_permute_ps(__m256 a) {
// Check if the mask is correct
// CHECK: shufflevector{{.*}}<i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4>
More information about the cfe-commits
mailing list