<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - pshufb intrinsic doesn't understand that indices with high-bit set give zeros"
href="https://llvm.org/bugs/show_bug.cgi?id=24562">24562</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>pshufb intrinsic doesn't understand that indices with high-bit set give zeros
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Backend: X86
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>dbau.pp@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=14767" name="attach_14767" title="C file to compare clang/LLVM and GCC">attachment 14767</a> <a href="attachment.cgi?id=14767&action=edit" title="C file to compare clang/LLVM and GCC">[details]</a></span>
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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>