<html>
<head>
<base href="http://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 --- - [AVX] scalarized code generated for zext of <16 x i8> to <16 x i16>"
href="http://llvm.org/bugs/show_bug.cgi?id=17654">17654</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[AVX] scalarized code generated for zext of <16 x i8> to <16 x i16>
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>matt@pharr.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>With top of tree and "llc -mattr=+avx", this code
define <16 x i16> @bar(<16 x i8> %v) {
%v16 = zext <16 x i8> %v to <16 x i16>
ret <16 x i16> %v16
}
generates a long sequence of vpextrb/vpinsrw instructions.
However, if I manually break the vector into two <8 x i8> vectors, do two
zexts, and then reassemble the 16-wide vector, like this:
define <16 x i16> @bat(<16 x i8> %v) {
%va = shufflevector <16 x i8> %v, <16 x i8> undef, <8 x i32> <i32 0, i32 1,
i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
%vb = shufflevector <16 x i8> %v, <16 x i8> undef, <8 x i32> <i32 8, i32 9,
i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
%va16 = zext <8 x i8> %va to <8 x i16>
%vb16 = zext <8 x i8> %vb to <8 x i16>
%v16 = shufflevector <8 x i16> %va16, <8 x i16> %vb16,
<16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32
7,
i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14,
i32 15>
ret <16 x i16> %v16
}
then I get the nice output:
vpunpckhbw %xmm0, %xmm0, %xmm1 # xmm1 =
xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
vmovdqa .LCPI2_0(%rip), %xmm2
vpand %xmm2, %xmm1, %xmm1
vpmovzxbw %xmm0, %xmm0
vpand %xmm2, %xmm0, %xmm0
vinsertf128 $1, %xmm1, %ymm0, %ymm0
It'd be nice if the first implementation got this output as well.</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>