<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 --- - llc generates incorrect AVX code on sandy bridge on following .ll file"
href="http://llvm.org/bugs/show_bug.cgi?id=15298">15298</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>llc generates incorrect AVX code on sandy bridge on following .ll file
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>3.2
</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>enhancement
</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>babslachem@gmail.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>Following ll code is designed to produce a vector of 8 floats with following
values
<0.0, elem(0, source), elem(0, source), 0.0, 0.0, 0.0, 0.0, 0.0>
; ModuleID = 'shufxbug.ll'
target datalayout =
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
target triple = "i386-pc-linux-gnu"
define void @sample_test(<4 x float>* nocapture %source, <8 x float>* nocapture
%dest) nounwind noinline {
L.entry:
%0 = getelementptr <4 x float>* %source, i32 19
%1 = load <4 x float>* %0, align 16
%2 = extractelement <4 x float> %1, i32 0
%3 = insertelement <8 x float> <float 0.000000e+00, float undef, float undef,
float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00,
float 0.000000e+00>, float %2, i32 2
%4 = insertelement <8 x float> %3, float %2, i32 1
%5 = getelementptr <8 x float>* %dest, i32 19
store <8 x float> %4, <8 x float>* %5, align 4
ret void
}
When compiled on a sandy bridge machine as follows:
llc shufxbug.ll -march=x86 -relocation-model=pic -o shufxbug.s
Following assembly is generated:
...
pushl %ebp
.Ltmp5:
.cfi_def_cfa_offset 8
.Ltmp6:
.cfi_offset %ebp, -8
movl %esp, %ebp
.Ltmp7:
.cfi_def_cfa_register %ebp
movl 12(%ebp), %eax
.loc 1 9 0 prologue_end # shufxbug.cl:9:0
.Ltmp8:
vpermilps $65, 304(%eax), %xmm0 # xmm0 = mem[1,0,0,1]
vxorps %xmm1, %xmm1, %xmm1
vinsertf128 $1, %xmm1, %ymm0, %ymm0
movl 16(%ebp), %eax
.loc 1 10 0 # shufxbug.cl:10:0
vmovups %ymm0, 608(%eax)
.loc 1 11 0 # shufxbug.cl:11:0
popl %ebp
vzeroupper
ret
...
Vector created is then
<elem(1, source), elem(0, source), elem(0, source), elem(1, source), 0.0, 0.0,
0.0, 0.0>
On a Core i7 machine code is slightly different and produce expected result</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>