summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c
blob: 5a8e6967b42e25e88453e89374511c7b4ba58a14 (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
/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math -ftree-vectorize -mavx -mtune=generic -mfpmath=sse -mrecip" } */

float a[16];
float b[16];
float r[16];

extern float sqrtf (float);

void t1(void)
{
 int i;

 for (i = 0; i < 16; i++)
   r[i] = a[i] / sqrtf (b[i]);
}

void t2(void)
{
 int i;

 for (i = 0; i < 16; i++)
   r[i] = sqrtf (a[i] / b[i]);
}

void t3(void)
{
 int i;

 for (i = 0; i < 16; i++)
   r[i] = sqrtf (a[i]);
}

/* Last loop is small enough to be fully unrolled.  */
/* { dg-final { scan-assembler-times "vrsqrtps\[ \\t\]+\[^\n\]*%ymm" 6 } } */