This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/81389] _mm_cmpestri segfault on -O0


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81389

--- Comment #4 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to rockeet from comment #3)
> @Martin Liška Yes, my use case is:
> 
> __m128i key128 = { key }; // key is an unsigned char
> int idx = _mm_cmpestri(key128, 1,
>     *(const __m128i*)(data), // don't require memory align
>     len,
>     _SIDD_UBYTE_OPS|_SIDD_CMP_EQUAL_ORDERED|_SIDD_LEAST_SIGNIFICANT);
> 
> // ....

You should load the unaligned data using one of the loadu intrinsics and pass
that to _mm_cmpestri. When optimizing, it should generate the code you want,
but in a safe way.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]