-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[Clang][X86] Add tests for AVX512 integer comparison intrinsics to be used in constexpr #169452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
dccf63b
6d54113
120d264
448d362
ca27b8a
e4e4e01
bffb0d8
e8893d5
cf7039c
60764b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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}) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you have to use __v16qs / __v32qs / __v64qs to allow you to use signed chars
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. __vqs in epi variants and __vqi for epu variants then?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. vXqu for unsigned char |
||
| ) == (__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); | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need _mm_mask_cmpeq_epi8_mask (et al) test coverage as well
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, I do have those in mind aswell, i will cover those after all of the _mm_mask_cmp*_epi* are complete. |
||
| // 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 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid 'splat' tests like this - all ones/zero results always make me suspicious :)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) okay ,will modify the 'splat' cases here onwards.