https://llvm.org/bugs/show_bug.cgi?id=24562
Bug ID: 24562 Summary: pshufb intrinsic doesn't understand that indices with high-bit set give zeros Product: libraries Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: Backend: X86 Assignee: unassignedb...@nondot.org Reporter: dbau...@gmail.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Created attachment 14767 --> https://llvm.org/bugs/attachment.cgi?id=14767&action=edit C file to compare clang/LLVM and GCC The `pshufb` SSSE3 instruction takes two vectors of i8's, x and y, and returns <x[y[0] % 16], x[y[1] % 16], ..., x[y[15] % 16]>, except for indices where the high bit is set, which return zero. LLVM seems to ignore the high-bit, and will lower calls to `llvm.x86.ssse3.pshuf.b.128` as if they unconditionally indexed with the mask. The attached pshufb.c file prints "1 1 ... 1" with clang, and "0 0 ... 0" with gcc. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs