<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 --- - clang -O3 does not produce best blend code"
href="http://llvm.org/bugs/show_bug.cgi?id=18603">18603</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang -O3 does not produce best blend code
</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>jn@sirrida.de
</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>-O3 seems to assume an out of order architecture (GCC does not).
A better assumption would be in order architecture;
IMHO -O3 ought to produce the "best blend" which runs on all processors.
If e.g. -march=atom is given the in order architecture is assumed.
Example:
int test(int x) {
return ((x>>2) & 15) ^ ((x>>3) & 31);
}
=> clang -O3
movl %edi, %eax
shrl $2, %eax
andl $15, %eax //
shrl $3, %edi // exchange
andl $31, %edi
xorl %eax, %edi
movl %edi, %eax
retq
=> clang -O3 -march=atom
movl %edi, %eax
shrl $3, %edi
shrl $2, %eax
andl $31, %edi
andl $15, %eax
xorl %eax, %edi
movl %edi, %eax
retq</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>