aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-120.c
blob: 1b3c5d49cdce68c19bf0438835b1dc4aaa0dd290 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* { 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" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */