<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 --- - wrong load instruction type generated for vector FP add (x86)"
href="http://llvm.org/bugs/show_bug.cgi?id=21790">21790</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>wrong load instruction type generated for vector FP add (x86)
</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>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>spatel+llvm@rotateright.com
</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>In the following test case, we want to load the 2 lower floats in a v4f32 and
add them to some other v4f32:
$ cat wrong_load.ll
define <4 x float> @add_2_floats(float* nocapture %p, <4 x float> %x) {
%f1 = load float* %p
%vecins1 = insertelement <4 x float> undef, float %f1, i32 0
%add.ptr = getelementptr float* %p, i32 1
%f2 = load float* %add.ptr
%vecins2 = insertelement <4 x float> %vecins1, float %f2, i32 1
%y = fadd <4 x float> %vecins2, %x
ret <4 x float> %y
}
$ ./llc wrong_load.ll -o -
...
movq (%rdi), %xmm1 <--- integer load
addps %xmm1, %xmm0 <--- floating-point math op
retq
---------------------------------------------------------------------------
We're generating an i64 load instead of the FP instruction for loading 2
floats: 'movlps'. This may cause a domain-crossing penalty.
The bug is located in X86ISelLowering's "EltsFromConsecutiveLoads()" function.</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>