------- Comment #10 from ubizjak at gmail dot com  2007-04-22 20:08 -------
float->double and double->float conversions are new vectorized. For a slightly
different test:

--cut here--
void test_fp (float *a, double *b)
{
  int i;

  for (i = 0; i < 4; i++)
    b[i] = (double) a[i];
}

void test_int (int *a, double *b)
{
  int i;

  for (i = 0; i < 4; i++)
    b[i] = (double) a[i];
}
--cut here--

we generate following loops:

test_fd:

.L2:
        movaps  a(%rax), %xmm0
        movhlps %xmm0, %xmm2
        cvtps2pd        %xmm0, %xmm1
        movapd  %xmm1, c(%rax,%rax)
        cvtps2pd        %xmm2, %xmm0
        movapd  %xmm0, c+16(%rax,%rax)
        addq    $16, %rax
        cmpq    $64, %rax
        jne     .L2

test_df:

.L8:
        cvtpd2ps        c(%rax,%rax), %xmm0
        cvtpd2ps        c+16(%rax,%rax), %xmm1
        movlhps %xmm1, %xmm0
        movaps  %xmm0, a(%rax)
        addq    $16, %rax
        cmpq    $64, %rax
        jne     .L8

test_int (no vectorization):

.L13:
        cvtsi2sd        b(,%rax,4), %xmm0
        movsd   %xmm0, c(,%rax,8)
        addq    $1, %rax
        cmpq    $16, %rax
        jne     .L13

Note, that we still don't vectorize double->int and int->double conversions.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24659

Reply via email to