From: Craig Topper Date: Wed, 31 Aug 2016 05:38:55 +0000 (+0000) Subject: [X86] Use v2i64 vectors to implement _mm_and/andn/or/xor_pd. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=afa10826ed3db826a40223694bb6a146ea43d5af;p=clang [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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280196 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Headers/emmintrin.h b/lib/Headers/emmintrin.h index 1590138133..d73b3a8eda 100644 --- a/lib/Headers/emmintrin.h +++ b/lib/Headers/emmintrin.h @@ -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 diff --git a/test/CodeGen/sse2-builtins.c b/test/CodeGen/sse2-builtins.c index ffecb289d5..91fa737ef5 100644 --- a/test/CodeGen/sse2-builtins.c +++ b/test/CodeGen/sse2-builtins.c @@ -73,7 +73,7 @@ __m128i test_mm_adds_epu16(__m128i A, __m128i B) { __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, __m128i B) { __m128d test_mm_andnot_pd(__m128d A, __m128d B) { // CHECK-LABEL: test_mm_andnot_pd - // CHECK: xor <4 x i32> %{{.*}}, - // CHECK: and <4 x i32> + // CHECK: xor <2 x i64> %{{.*}}, + // CHECK: and <2 x i64> return _mm_andnot_pd(A, B); } @@ -845,7 +845,7 @@ __m128i test_mm_mullo_epi16(__m128i A, __m128i B) { __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 B) { __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); }