[Bug target/40811] New: unsigned int to float isn't vectorized
hjl dot tools at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Jul 20 22:55:00 GMT 2009
[hjl@gnu-6 tmp]$ cat x.c
#define N 4
extern unsigned int u4[N] __attribute__ ((aligned(16)));
extern float f4[N] __attribute__ ((aligned(16)));
void
cvt_u4_f4()
{
int j;
for (j=0; j<N; j++)
f4[j]=u4[j];
}
[hjl@gnu-6 tmp]$ /usr/gcc-4.5/bin/gcc -O3 x.c -S
[hjl@gnu-6 tmp]$ cat x.s
.file "x.c"
.text
.p2align 4,,15
.globl cvt_u4_f4
.type cvt_u4_f4, @function
cvt_u4_f4:
.LFB0:
.cfi_startproc
mov u4(%rip), %eax
cvtsi2ssq %rax, %xmm0
mov u4+4(%rip), %eax
movss %xmm0, f4(%rip)
cvtsi2ssq %rax, %xmm0
mov u4+8(%rip), %eax
movss %xmm0, f4+4(%rip)
cvtsi2ssq %rax, %xmm0
mov u4+12(%rip), %eax
movss %xmm0, f4+8(%rip)
cvtsi2ssq %rax, %xmm0
movss %xmm0, f4+12(%rip)
ret
.cfi_endproc
.LFE0:
.size cvt_u4_f4, .-cvt_u4_f4
Icc 11.1 generates:
.globl cvt_u4_f4
cvt_u4_f4:
..B1.1: # Preds ..B1.0
..___tag_value_cvt_u4_f4.1: #6.1
cvtdq2ps u4(%rip), %xmm2 #9.11
movaps %xmm2, %xmm1 #9.11
pxor %xmm0, %xmm0 #9.11
cmpltps %xmm0, %xmm1 #9.11
andps _2il0floatpacket.1(%rip), %xmm1 #9.11
addps %xmm1, %xmm2 #9.11
movaps %xmm2, f4(%rip) #9.5
ret #10.1
.align 16,0x90
..___tag_value_cvt_u4_f4.2: #
# LOE
# mark_end;
.type cvt_u4_f4,@function
.size cvt_u4_f4,.-cvt_u4_f4
.data
# -- End cvt_u4_f4
.section .rodata, "a"
.align 16
.align 16
_2il0floatpacket.1:
.long 0x4f800000,0x4f800000,0x4f800000,0x4f800000
.type _2il0floatpacket.1,@object
.size _2il0floatpacket.1,16
--
Summary: unsigned int to float isn't vectorized
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hjl dot tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40811
More information about the Gcc-bugs
mailing list