[llvm-bugs] [Bug 24562] New: pshufb intrinsic doesn't understand that indices with high-bit set give zeros

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 24 16:05:46 PDT 2015


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: unassignedbugs at nondot.org
          Reporter: dbau.pp at gmail.com
                CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150824/c56d87f2/attachment.html>


More information about the llvm-bugs mailing list