------- Comment #3 from irar at il dot ibm dot com  2008-09-14 10:04 -------
(In reply to comment #2)
> I don't follow.  For vectorize2.c we have
> 
>     b[i] = lrint (a[i]);
> 
> where we should be able to vectorize this using lrint vectorization and
> a scalar long -> int conversion (which is a no-op on i686 and should be
> vectorized on x86_64).  There is no aliasing issue involved here.

I am working on x86_64 using -m32 (without -m32 I get
../../gcc.target/i386/vectorize2.c:15: note: function is not vectorizable.
../../gcc.target/i386/vectorize2.c:15: note: not vectorized: relevant stmt not
supported: D.1603_6 = lrint (D.1602_5); ).

I don't see any conversion:

foo ()
{
  unsigned int ivtmp.65;
  int pretmp.55;
  double pretmp.54;
  int i;
  long int D.1579;
  double D.1578;

<bb 2>:

<bb 3>:
  # i_14 = PHI <i_7(4), 0(2)>
  # ivtmp.65_13 = PHI <ivtmp.65_12(4), 256(2)>
  D.1578_5 = a[i_14];
  D.1579_6 = lrint (D.1578_5);
  b[i_14] = D.1579_6;
  i_7 = i_14 + 1;
  ivtmp.65_12 = ivtmp.65_13 - 1;
  if (ivtmp.65_12 != 0)
    goto <bb 4>;
  else
    goto <bb 5>;

<bb 4>:
  goto <bb 3>;

<bb 5>:
  return;

}

The vectorized version (if the alias check is removed) is:
 ...
  vector long int * ivtmp.120;
  vector long int vect_var_.113;
 ...

  vect_var_.111_20 = *ivtmp.110_18;
  ivtmp.110_21 = ivtmp.110_18 + 16;
  vect_var_.112_22 = *ivtmp.110_21;
  vect_var_.113_23 = __builtin_ia32_vec_pack_sfix (vect_var_.111_20,
vect_var_.112_22);
  *ivtmp.120_26 = vect_var_.113_23;

The alias check is for the store, checking *ivtmp.120_26 and b.


-- 


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

Reply via email to