Hello!
Attached (RFC!) patch implements vectorization of int -> double
conversion. The testcase:
/* int -> double */
for (i = 0; i < N; i++)
{
da[i] = (double) ib[i];
}
compiles on i686 -msse2 target into:
.L3:
movdqa (%eax,%ecx), %xmm0
cvtdq2pd %xmm0, %xmm1
pshufd $238, %xmm0, %xmm0
movapd %xmm1, (%edx,%eax,2)
cvtdq2pd %xmm0, %xmm0
movapd %xmm0, 16(%edx,%eax,2)
addl $16, %eax
cmpl $128, %eax
jne .L3
(pshufd is there to shuffle SImode vector from x0x1x2x3 into x2x3x2x3.
Regarding the patch: in vectorizable_conversion() we detect
(nunits_out == nunits_in / 2) as EXPAND case and handle conversion in
the same way as vectorizable_type_promotion(). Unfortunatelly, we need
a couple of new tree codes and 4 new optabs to handle signed and
unsigned conversion.