llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang Author: irhs0 (shri-acha) <details> <summary>Changes</summary> Covers the test for AVX512 comparison intrinsics mentioned in: #<!-- -->162054 --- Full diff: https://github.com/llvm/llvm-project/pull/169452.diff 1 Files Affected: - (modified) clang/test/CodeGen/X86/avx512vlbw-builtins.c (+112-9) ``````````diff diff --git a/clang/test/CodeGen/X86/avx512vlbw-builtins.c b/clang/test/CodeGen/X86/avx512vlbw-builtins.c index 16e113031bfda..cb69205664a3d 100644 --- a/clang/test/CodeGen/X86/avx512vlbw-builtins.c +++ b/clang/test/CodeGen/X86/avx512vlbw-builtins.c @@ -645,20 +645,123 @@ __mmask16 test_mm_cmp_epi8_mask(__m128i __a, __m128i __b) { return (__mmask16)_mm_cmp_epi8_mask(__a, __b, 0); } +// cmpeq tests TEST_CONSTEXPR(_mm_cmpeq_epi8_mask( - ((__m128i)(__v16qi){5, 3, 7, 2, 9, 3, 7, 1, 5, 4, 8, 2, 9, 6, 7, 5}), - ((__m128i)(__v16qi){5, 2, 7, 3, 9, 4, 6, 1, 5, 3, 8, 1, 9, 5, 7, 5}) -) == (__mmask16)0xd595); + ((__m128i)(__v16qi){0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}), + ((__m128i)(__v16qi){0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) +) == (__mmask16)0xffff); + +TEST_CONSTEXPR(_mm_cmpeq_epi8_mask( + ((__m128i)(__v16qi){1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}), + ((__m128i)(__v16qi){1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}) +) == (__mmask16)0xffff); + +TEST_CONSTEXPR(_mm_cmpeq_epi8_mask( + ((__m128i)(__v16qi){127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127}), + ((__m128i)(__v16qi){-128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128}) +) == (__mmask16)0x0000); + +TEST_CONSTEXPR(_mm_cmpeq_epi8_mask( + ((__m128i)(__v16qi){-31, 90, -66, 3, 27, -22, -64, 111, -87, 105, -19, 0, 26, -111, 24, -72}), + ((__m128i)(__v16qi){-84, -98, 20, -83, -98, 80, -46, -9, 22, -120, -123, 53, 117, -85, 50, 94}) +) == (__mmask16)0x0000); + +// cmpneq tests +TEST_CONSTEXPR(_mm_cmpneq_epi8_mask( + ((__m128i)(__v16qi){0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}), + ((__m128i)(__v16qi){0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) +) == (__mmask16)0x0000); + +TEST_CONSTEXPR(_mm_cmpneq_epi8_mask( + ((__m128i)(__v16qi){1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}), + ((__m128i)(__v16qi){1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}) +) == (__mmask16)0x0000); + +TEST_CONSTEXPR(_mm_cmpneq_epi8_mask( + ((__m128i)(__v16qi){127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127}), + ((__m128i)(__v16qi){-128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128}) +) == (__mmask16)0xffff); + +TEST_CONSTEXPR(_mm_cmpneq_epi8_mask( + ((__m128i)(__v16qi){-2, 49, -5, -11, 21, -70, 121, -111, 20, 112, -121, 18, -34, -73, 89, 122}), + ((__m128i)(__v16qi){14, 36, 2, 3, 118, 88, -126, -21, 104, -125, -1, 39, 99, -12, 35, -126}) +) == (__mmask16)0xffff); + +// cmplt tests +TEST_CONSTEXPR(_mm_cmplt_epi8_mask( + ((__m128i)(__v16qi){0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}), + ((__m128i)(__v16qi){0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) +) == (__mmask16)0x0000); TEST_CONSTEXPR(_mm_cmplt_epi8_mask( - ((__m128i)(__v16qi){1, 5, 3, 7, 2, 8, 4, 6, 9, 5, 3, 11, 2, 6, 15, 8}), - ((__m128i)(__v16qi){2, 4, 6, 8, 3, 5, 7, 9, 4, 6, 8, 10, 5, 7, 9, 11}) -) == (__mmask16)0xb6dd); + ((__m128i)(__v16qi){1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}), + ((__m128i)(__v16qi){1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}) +) == (__mmask16)0x0000); +TEST_CONSTEXPR(_mm_cmplt_epi8_mask( + ((__m128i)(__v16qi){127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127}), + ((__m128i)(__v16qi){-128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128}) +) == (__mmask16)0x0000); + +TEST_CONSTEXPR(_mm_cmplt_epi8_mask( + ((__m128i)(__v16qi){-111, -10, -60, -123, -6, -110, -43, -32, -58, -7, 42, -128, -21, 24, 8, -101}), + ((__m128i)(__v16qi){-108, 30, 71, 73, 20, 117, 63, -93, 79, -30, 99, -100, 34, 49, 83, 68}) +) == (__mmask16)0xfd7f); + +// cmple tests +TEST_CONSTEXPR(_mm_cmple_epi8_mask( + ((__m128i)(__v16qi){0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}), + ((__m128i)(__v16qi){0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) +) == (__mmask16)0xffff); TEST_CONSTEXPR(_mm_cmple_epi8_mask( - ((__m128i)(__v16qi){1, 3, 5, 7, 2, 6, 6, 8, 1, 3, 9, 7, 2, 4, 6, 10}), - ((__m128i)(__v16qi){2, 3, 4, 7, 3, 4, 5, 8, 2, 3, 4, 7, 3, 4, 5, 8}) -) == (__mmask16)0x3b9b); + ((__m128i)(__v16qi){1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}), + ((__m128i)(__v16qi){1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}) +) == (__mmask16)0xffff); +TEST_CONSTEXPR(_mm_cmple_epi8_mask( + ((__m128i)(__v16qi){127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127}), + ((__m128i)(__v16qi){-128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128}) +) == (__mmask16)0x0000); +TEST_CONSTEXPR(_mm_cmple_epi8_mask( + ((__m128i)(__v16qi){122, 6, -22, -94, 78, -35, -43, -16, -69, 124, -2, 24, -117, 8, -17, 118}), + ((__m128i)(__v16qi){53, -50, 104, 11, 63, -77, -25, 102, 46, 62, 27, -28, -61, 68, 40, -65}) +) == (__mmask16)0x75cc); + +// cmpge tests +TEST_CONSTEXPR(_mm_cmpge_epi8_mask( + ((__m128i)(__v16qi){0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}), + ((__m128i)(__v16qi){0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) +) == (__mmask16)0xffff); +TEST_CONSTEXPR(_mm_cmpge_epi8_mask( + ((__m128i)(__v16qi){1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}), + ((__m128i)(__v16qi){1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}) +) == (__mmask16)0xffff); +TEST_CONSTEXPR(_mm_cmpge_epi8_mask( + ((__m128i)(__v16qi){127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127}), + ((__m128i)(__v16qi){-128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128}) +) == (__mmask16)0xffff); +TEST_CONSTEXPR(_mm_cmpge_epi8_mask( + ((__m128i)(__v16qi){-11, 0, 97, 123, -48, 105, 26, -118, 62, -86, -94, -32, 14, -4, -50, 72}), + ((__m128i)(__v16qi){-33, 49, 22, 31, -4, -81, 6, -22, 40, 127, -1, -106, 6, -64, 12, 8}) +) == (__mmask16)0xb96d); + +// cmpgt tests +TEST_CONSTEXPR(_mm_cmpgt_epi8_mask( + ((__m128i)(__v16qi){0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}), + ((__m128i)(__v16qi){0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) +) == (__mmask16)0x0000); +TEST_CONSTEXPR(_mm_cmpgt_epi8_mask( + ((__m128i)(__v16qi){1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}), + ((__m128i)(__v16qi){1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}) +) == (__mmask16)0x0000); +TEST_CONSTEXPR(_mm_cmpgt_epi8_mask( + ((__m128i)(__v16qi){127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127}), + ((__m128i)(__v16qi){-128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128}) +) == (__mmask16)0xffff); +TEST_CONSTEXPR(_mm_cmpgt_epi8_mask( + ((__m128i)(__v16qi){-127, 37, -123, -60, 98, -68, -115, 96, 80, -27, -105, 64, -6, -51, -45, -81}), + ((__m128i)(__v16qi){-124, 59, 8, 59, 122, 47, -74, 120, 19, -43, -33, -76, 7, -22, -24, -14}) +) == (__mmask16)0x0b00); + __mmask16 test_mm_mask_cmp_epi8_mask(__mmask16 __u, __m128i __a, __m128i __b) { // CHECK-LABEL: test_mm_mask_cmp_epi8_mask `````````` </details> https://github.com/llvm/llvm-project/pull/169452 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
