view gcc/testsuite/gcc.dg/vect/vect-120.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +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" } } */