]> gcc.gnu.org Git - gcc.git/blame - gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-1.c
dumpfile.c (opt_info_switch_p): Change -fopt-info default to -fopt-info=optimized...
[gcc.git] / gcc / testsuite / gcc.dg / vect / fast-math-bb-slp-call-1.c
CommitLineData
190c2236
JJ
1#include "tree-vect.h"
2
3extern float copysignf (float, float);
4extern float sqrtf (float);
5extern float fabsf (float);
6extern void abort (void);
7float a[64], b[64], c[64], d[64];
8
9__attribute__((noinline, noclone)) void
10f1 (void)
11{
12 a[0] = copysignf (b[0], c[0]) + 1.0f + sqrtf (d[0]);
13 a[1] = copysignf (b[1], c[1]) + 2.0f + sqrtf (d[1]);
14 a[2] = copysignf (b[2], c[2]) + 3.0f + sqrtf (d[2]);
15 a[3] = copysignf (b[3], c[3]) + 4.0f + sqrtf (d[3]);
16 a[4] = copysignf (b[4], c[4]) + 5.0f + sqrtf (d[4]);
17 a[5] = copysignf (b[5], c[5]) + 6.0f + sqrtf (d[5]);
18 a[6] = copysignf (b[6], c[6]) + 7.0f + sqrtf (d[6]);
19 a[7] = copysignf (b[7], c[7]) + 8.0f + sqrtf (d[7]);
20}
21
22__attribute__((noinline, noclone)) int
23main1 ()
24{
25 int i;
26
27 for (i = 0; i < 8; i++)
28 {
29 asm ("");
30 b[i] = (i & 1) ? -4 * i : 4 * i;
31 c[i] = (i & 2) ? -8 * i : 8 * i;
32 d[i] = i * i;
33 }
34 f1 ();
35 for (i = 0; i < 8; i++)
36 if (fabsf (((i & 2) ? -4 * i : 4 * i) + 1 + i + i - a[i]) >= 0.0001f)
37 abort ();
38 return 0;
39}
40
41int
42main ()
43{
44 check_vect ();
45 return main1 ();
46}
47
5d318fd4 48/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target { vect_call_copysignf && vect_call_sqrtf } } } } */
190c2236 49/* { dg-final { cleanup-tree-dump "slp" } } */
This page took 1.061231 seconds and 5 git commands to generate.