i386: Adjust rtx cost for imulq and imulw [PR115749]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-ifcvt-18.c
blobc1d3c27d819335ad0882e5af8005667e6ed2a531
1 /* { dg-require-effective-target vect_condition } */
2 /* { dg-require-effective-target vect_float } */
3 /* { dg-additional-options "-Ofast -mavx" { target avx_runtime } } */
6 int A0[4] = {36,39,42,45};
7 int B0[4] = {42,42,0,42};
8 float A1[8] = {36,39,42,45,43,32,21,12};
9 float B1[8] = {42,42,0,42,42,42,0,42};
10 double A2[16] = {36,39,42,45,43,32,21,12,23,34,45,56,42,78,89,11};
11 double B2[16] = {42,42,0,42,42,42,42,42,42,42,42,42,0,42,42,42};
13 int main ()
15 int i, j;
16 int res0 = 1;
17 float res1 = 1.0;
18 double res2 = 1.0;
20 for (i = 0; i < 4; i++)
21 if (B0[i])
22 res0 *= A0[i];
24 for (i = 0; i < 8; i++)
25 if (B1[i])
26 res1 *= A1[i];
28 for (i = 0; i < 16; i++)
29 if (B2[i])
30 res2 *= A2[i];
31 /* check results: */
32 if (res0 != 63180 || res1 != 1043228160.000000
33 ||res2 != 3296728515318523101184.000000)
34 __builtin_abort ();
35 return 0;
38 /* { dg-final { scan-tree-dump "vectorized 3 loops" "vect" { target i?86-*-* x86_64-*-* } } } */