Produces two pcmpestri instructions for test1 and pcmpestri followed by pcmpestrm for test2`,
Demo: https://godbolt.org/z/GE783h8dz
I expect that _mm_cmpestrc is fused with the other intrinsic, so there's one pcmpestri in test1 and one pcmpestrm for test2.
(MSVC does this susion for test1, and gcc does this fusion for both test1 and test2)
The following C++ code:
```c++
#include <immintrin.h>
int test1(__m128i needle, __m128i haystack) {
if (_mm_cmpestrc(needle, 2, haystack, 8, _SIDD_CMP_EQUAL_ORDERED | _SIDD_BIT_MASK))
{
int bitmask = _mm_cmpestri(needle, 2, haystack, 8, _SIDD_CMP_EQUAL_ORDERED | _SIDD_BIT_MASK);
return bitmask;
}
else
{
return 0;
}
}
int test2(__m128i needle, __m128i haystack) {
if (_mm_cmpestrc(needle, 2, haystack, 8, _SIDD_CMP_EQUAL_ORDERED | _SIDD_BIT_MASK))
{
int bitmask = _mm_cvtsi128_si32(_mm_cmpestrm(needle, 2, haystack, 8, _SIDD_CMP_EQUAL_ORDERED | _SIDD_BIT_MASK));
return bitmask;
}
else
{
return 0;
}
}
```
Produces two `pcmpestri` instructions for `test1` and `pcmpestri` followed by `pcmpestrm` for test2`,
Demo: https://godbolt.org/z/GE783h8dz
I expect that `_mm_cmpestrc` is fused with the other intrinsic, so there's one `pcmpestri` in `test1` and one `pcmpestrm` for test2.
(MSVC does this susion for `test1`, and gcc does this fusion for both `test1` and `test2`)
The following C++ code:
Produces two
pcmpestri
instructions fortest1
andpcmpestri
followed bypcmpestrm
for test2`, Demo: https://godbolt.org/z/GE783h8dzI expect that
_mm_cmpestrc
is fused with the other intrinsic, so there's onepcmpestri
intest1
and onepcmpestrm
for test2. (MSVC does this susion fortest1
, and gcc does this fusion for bothtest1
andtest2
)