i386: Adjust rtx cost for imulq and imulw [PR115749]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / bb-slp-pow-1.c
blobc186c7b66c65e5f62edee25a924fdcfb25b252ab
1 /* { dg-additional-options "-fno-math-errno -fdisable-tree-sincos" } */
2 /* { dg-require-effective-target vect_float } */
4 void __attribute__ ((noipa))
5 f (float *a)
7 a[0] = a[0] * a[0];
8 a[1] = __builtin_powf (a[1], 2);
9 a[2] = a[2] * a[2];
10 a[3] = __builtin_powf (a[3], 2);
13 float a[4] = { 1, 2, 3, 4 };
15 int
16 main (void)
18 f (a);
19 #pragma GCC novector
20 for (int i = 0; i < 4; ++i)
22 if (a[i] != (i + 1) * (i + 1))
23 __builtin_abort ();
24 asm volatile ("" ::: "memory");
26 return 0;
29 /* On older powerpc hardware (POWER7 and earlier), the default flag
30 -mno-allow-movmisalign prevents vectorization. On POWER8 and later,
31 when vect_hw_misalign is true, vectorization occurs. */
33 /* { dg-final { scan-tree-dump-times "optimized: basic block" 1 "slp2" { target {{ ! powerpc*-*-* } || { powerpc*-*-* && vect_hw_misalign }} } } } */