<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - [PCG] Failed to merge identical lower/upper 128-bit shuffles into 256-bit shuffle"
href="https://bugs.llvm.org/show_bug.cgi?id=35833">35833</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[PCG] Failed to merge identical lower/upper 128-bit shuffles into 256-bit shuffle
</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>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</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>konstantin.belochapka@sony.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>__m256 shuf0(__m256 a, __m256 b)
{
return
__builtin_shufflevector(a, b, 0, 2, 4, 6, 8, 10, 12, 14);
}
_Z5shuf0Dv8_fS_:
vextractf128 xmm2,ymm1,1
vshufps xmm1,xmm1,xmm2,88h
vextractf128 xmm2,ymm0,1
vshufps xmm0,xmm0,xmm2,88h
vinsertf128 ymm0,ymm0,xmm1,1
ret
__m256 shuf1(__m256 a, __m256 b)
{
return
__builtin_shufflevector(a, b, 1, 3, 5, 7, 9, 11, 13, 15);
}
_Z5shuf1Dv8_fS_:
vextractf128 xmm2,ymm1,1
vshufps xmm1,xmm1,xmm2,0DDh
vextractf128 xmm2,ymm0,1
vshufps xmm0,xmm0,xmm2,0DDh
vinsertf128 ymm0,ymm0,xmm1,1
ret
Which means that this is far more complicated than it needs to be
__m256 add_shuf0_shuf1(__m256 a, __m256 b)
{
return
__builtin_shufflevector(a, b, 0, 2, 4, 6, 8, 10, 12, 14) +
__builtin_shufflevector(a, b, 1, 3, 5, 7, 9, 11, 13, 15);
}
_Z15add_shuf0_shuf1Dv8_fS_:
vextractf128 xmm2,ymm1,1
vshufps xmm3,xmm1,xmm2,88h
vextractf128 xmm4,ymm0,1
vshufps xmm5,xmm0,xmm4,88h
vinsertf128 ymm3,ymm5,xmm3,1
vshufps xmm1,xmm1,xmm2,0DDh
vshufps xmm0,xmm0,xmm4,0DDh
vinsertf128 ymm0,ymm0,xmm1,1
vaddps ymm0,ymm3,ymm0
ret
These 256-bit shuffles could be achieved as a VPERM2F128 followed by a VSHUFPS</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>