diff options
Diffstat (limited to 'clang/test/CodeGen/X86/avx2-builtins.c')
-rw-r--r-- | clang/test/CodeGen/X86/avx2-builtins.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/CodeGen/X86/avx2-builtins.c b/clang/test/CodeGen/X86/avx2-builtins.c index 27da56f..adbb854 100644 --- a/clang/test/CodeGen/X86/avx2-builtins.c +++ b/clang/test/CodeGen/X86/avx2-builtins.c @@ -9,6 +9,7 @@ #include <immintrin.h> +#include "builtin_test_helpers.h" // NOTE: This should match the tests in llvm/test/CodeGen/X86/avx2-intrinsics-fast-isel.ll @@ -97,6 +98,7 @@ __m256i test_mm256_and_si256(__m256i a, __m256i b) { // CHECK: and <4 x i64> return _mm256_and_si256(a, b); } +TEST_CONSTEXPR(match_v4di(_mm256_and_si256((__m256i)(__v4di){0, -1, 0, -1}, (__m256i)(__v4di){0, 0, -1, -1}), 0, 0, 0, -1)); __m256i test_mm256_andnot_si256(__m256i a, __m256i b) { // CHECK-LABEL: test_mm256_andnot_si256 @@ -104,6 +106,7 @@ __m256i test_mm256_andnot_si256(__m256i a, __m256i b) { // CHECK: and <4 x i64> return _mm256_andnot_si256(a, b); } +TEST_CONSTEXPR(match_v4di(_mm256_andnot_si256((__m256i)(__v4di){0, -1, 0, -1}, (__m256i)(__v4di){0, 0, -1, -1}), 0, 0, -1, 0)); __m256i test_mm256_avg_epu8(__m256i a, __m256i b) { // CHECK-LABEL: test_mm256_avg_epu8 @@ -890,12 +893,14 @@ __m256i test_mm256_mulhi_epu16(__m256i a, __m256i b) { // CHECK: call <16 x i16> @llvm.x86.avx2.pmulhu.w(<16 x i16> %{{.*}}, <16 x i16> %{{.*}}) return _mm256_mulhi_epu16(a, b); } +TEST_CONSTEXPR(match_v16hi(_mm256_mulhi_epu16((__m256i)(__v16hi){+1, -2, +3, -4, +5, -6, +7, -8, +9, -10, +11, -12, +13, -14, +15, -16}, (__m256i)(__v16hi){-32, -30, +28, +26, -24, -22, +20, +18, -16, -14, +12, +10, -8, +6, -4, +2}), 0, -32, 0, 25, 4, -28, 0, 17, 8, -24, 0, 9, 12, 5, 14, 1)); __m256i test_mm256_mulhi_epi16(__m256i a, __m256i b) { // CHECK-LABEL: test_mm256_mulhi_epi16 // CHECK: call <16 x i16> @llvm.x86.avx2.pmulh.w(<16 x i16> %{{.*}}, <16 x i16> %{{.*}}) return _mm256_mulhi_epi16(a, b); } +TEST_CONSTEXPR(match_v16hi(_mm256_mulhi_epi16((__m256i)(__v16hi){+1, -2, +3, -4, +5, -6, +7, -8, +9, -10, +11, -12, +13, -14, +15, -16}, (__m256i)(__v16hi){-32, -30, +28, +26, -24, -22, +20, +18, -16, -14, +12, +10, -8, +6, -4, +2}), -1, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, -1, -1, -1)); __m256i test_mm256_mulhrs_epi16(__m256i a, __m256i b) { // CHECK-LABEL: test_mm256_mulhrs_epi16 @@ -908,6 +913,7 @@ __m256i test_mm256_mullo_epi16(__m256i a, __m256i b) { // CHECK: mul <16 x i16> return _mm256_mullo_epi16(a, b); } +TEST_CONSTEXPR(match_v16hi(_mm256_mullo_epi16((__m256i)(__v16hi){+1, -2, +3, -4, +5, -6, +7, -8, +9, -10, +11, -12, +13, -14, +15, -16}, (__m256i)(__v16hi){-32, -30, +28, +26, -24, -22, +20, +18, -16, -14, +12, +10, -8, +6, -4, +2}), -32, 60, 84, -104, -120, 132, 140, -144, -144, 140, 132, -120, -104, -84, -60, -32)); __m256i test_mm256_mullo_epi32(__m256i a, __m256i b) { // CHECK-LABEL: test_mm256_mullo_epi32 @@ -920,6 +926,7 @@ __m256i test_mm256_or_si256(__m256i a, __m256i b) { // CHECK: or <4 x i64> return _mm256_or_si256(a, b); } +TEST_CONSTEXPR(match_v4di(_mm256_or_si256((__m256i)(__v4di){0, -1, 0, -1}, (__m256i)(__v4di){0, 0, -1, -1}), 0, -1, -1, -1)); __m256i test_mm256_packs_epi16(__m256i a, __m256i b) { // CHECK-LABEL: test_mm256_packs_epi16 @@ -1336,3 +1343,4 @@ __m256i test_mm256_xor_si256(__m256i a, __m256i b) { // CHECK: xor <4 x i64> return _mm256_xor_si256(a, b); } +TEST_CONSTEXPR(match_v4di(_mm256_xor_si256((__m256i)(__v4di){0, -1, 0, -1}, (__m256i)(__v4di){0, 0, -1, -1}), 0, -1, -1, 0)); |