<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 - Compiler no longer producing single horizontal add instruction after ab2c499d"
href="https://bugs.llvm.org/show_bug.cgi?id=50392">50392</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Compiler no longer producing single horizontal add instruction after ab2c499d
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</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>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>douglas_yung@playstation.sony.com
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>One of our internal tests compiles the following code and verifies that it
generates a horizontal add instruction in the resulting assembly when
optimizations are enabled and targeting btver2.
__attribute__((noinline))
__m256d add_pd_002(__m256d a, __m256d b) {
__m256d r = (__m256d){ a[0] + a[1], a[2] + a[3], b[0] + b[1], b[2] + b[3] };
return __builtin_shufflevector(r, a, 0, -1, 2, 3);
}
Prior to commit ab2c499, when compiled with "-g0 -O3 -march=btver2", the
compiler would produce the following code:
vinsertf128 $1, %xmm1, %ymm0, %ymm0
vhaddpd %ymm1, %ymm0, %ymm0
But following the mentioned change, the compiler is now producing the following
code instead:
vextractf128 $1, %ymm1, %xmm2
vhaddpd %xmm0, %xmm0, %xmm0
vhaddpd %xmm2, %xmm1, %xmm1
vperm2f128 $2, %ymm0, %ymm1, %ymm0 # ymm0 = ymm0[0,1],ymm1[0,1]</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>