r280196 - [X86] Use v2i64 vectors to implement _mm_and/andn/or/xor_pd.
Craig Topper via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 30 22:38:56 PDT 2016
Author: ctopper
Date: Wed Aug 31 00:38:55 2016
New Revision: 280196
URL: http://llvm.org/viewvc/llvm-project?rev=280196&view=rev
Log:
[X86] Use v2i64 vectors to implement _mm_and/andn/or/xor_pd.
These will be reused when removing some builtins from avx512vldqintrin.h and this will make the tests for that change show a better number of vector elements.
Modified:
cfe/trunk/lib/Headers/emmintrin.h
cfe/trunk/test/CodeGen/sse2-builtins.c
Modified: cfe/trunk/lib/Headers/emmintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/emmintrin.h?rev=280196&r1=280195&r2=280196&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/emmintrin.h (original)
+++ cfe/trunk/lib/Headers/emmintrin.h Wed Aug 31 00:38:55 2016
@@ -141,25 +141,25 @@ _mm_max_pd(__m128d __a, __m128d __b)
static __inline__ __m128d __DEFAULT_FN_ATTRS
_mm_and_pd(__m128d __a, __m128d __b)
{
- return (__m128d)((__v4su)__a & (__v4su)__b);
+ return (__m128d)((__v2du)__a & (__v2du)__b);
}
static __inline__ __m128d __DEFAULT_FN_ATTRS
_mm_andnot_pd(__m128d __a, __m128d __b)
{
- return (__m128d)(~(__v4su)__a & (__v4su)__b);
+ return (__m128d)(~(__v2du)__a & (__v2du)__b);
}
static __inline__ __m128d __DEFAULT_FN_ATTRS
_mm_or_pd(__m128d __a, __m128d __b)
{
- return (__m128d)((__v4su)__a | (__v4su)__b);
+ return (__m128d)((__v2du)__a | (__v2du)__b);
}
static __inline__ __m128d __DEFAULT_FN_ATTRS
_mm_xor_pd(__m128d __a, __m128d __b)
{
- return (__m128d)((__v4su)__a ^ (__v4su)__b);
+ return (__m128d)((__v2du)__a ^ (__v2du)__b);
}
static __inline__ __m128d __DEFAULT_FN_ATTRS
Modified: cfe/trunk/test/CodeGen/sse2-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse2-builtins.c?rev=280196&r1=280195&r2=280196&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/sse2-builtins.c (original)
+++ cfe/trunk/test/CodeGen/sse2-builtins.c Wed Aug 31 00:38:55 2016
@@ -73,7 +73,7 @@ __m128i test_mm_adds_epu16(__m128i A, __
__m128d test_mm_and_pd(__m128d A, __m128d B) {
// CHECK-LABEL: test_mm_and_pd
- // CHECK: and <4 x i32>
+ // CHECK: and <2 x i64>
return _mm_and_pd(A, B);
}
@@ -85,8 +85,8 @@ __m128i test_mm_and_si128(__m128i A, __m
__m128d test_mm_andnot_pd(__m128d A, __m128d B) {
// CHECK-LABEL: test_mm_andnot_pd
- // CHECK: xor <4 x i32> %{{.*}}, <i32 -1, i32 -1, i32 -1, i32 -1>
- // CHECK: and <4 x i32>
+ // CHECK: xor <2 x i64> %{{.*}}, <i64 -1, i64 -1>
+ // CHECK: and <2 x i64>
return _mm_andnot_pd(A, B);
}
@@ -845,7 +845,7 @@ __m128i test_mm_mullo_epi16(__m128i A, _
__m128d test_mm_or_pd(__m128d A, __m128d B) {
// CHECK-LABEL: test_mm_or_pd
- // CHECK: or <4 x i32> %{{.*}}, %{{.*}}
+ // CHECK: or <2 x i64> %{{.*}}, %{{.*}}
return _mm_or_pd(A, B);
}
@@ -1529,7 +1529,7 @@ __m128d test_mm_unpacklo_pd(__m128d A, _
__m128d test_mm_xor_pd(__m128d A, __m128d B) {
// CHECK-LABEL: test_mm_xor_pd
- // CHECK: xor <4 x i32> %{{.*}}, %{{.*}}
+ // CHECK: xor <2 x i64> %{{.*}}, %{{.*}}
return _mm_xor_pd(A, B);
}
More information about the cfe-commits
mailing list