view gcc/testsuite/gcc.dg/vect/vect-120.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-do compile } */
/* { dg-require-effective-target vect_float } */
/* { dg-require-effective-target vect_shift } */
/* { dg-require-effective-target vect_floatint_cvt } */

static inline float
i2f(int x)
{
  union { float f; int i; } tmp;
  tmp.i=x;
  return tmp.f;
}
static inline float
vect_ldexpf(float x, int n)
{
  n = (n+0x7f)<<23;
  return x * i2f(n);
}

float __attribute__ ((aligned(16))) a[1024];
float __attribute__ ((aligned(16))) b[1024];
float __attribute__ ((aligned(16))) c[1024];

void
tV()
{
  int i;
  for (i=0; i!=1024; ++i)
    {
      float z = a[i];
      int n = b[i];
      c[i] = vect_ldexpf(z,n);
    }
}

/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */