gcc/testsuite/gcc.target/i386/pr87007-4.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2 -march=skylake-avx512 -mfpmath=sse" } */ |
| 3 | /* Load of d2/d3 is hoisted out, vrndscalesd will reuse loades register to avoid partial dependence. */ |
| 4 | |
| 5 | #include<math.h> |
| 6 | |
| 7 | extern double d1, d2, d3; |
| 8 | void |
| 9 | foo (int n, int k) |
| 10 | { |
| 11 | for (int i = 0; i != n; i++) |
| 12 | if(i < k) |
| 13 | d1 = floor (d2); |
| 14 | else |
| 15 | d1 = ceil (d3); |
| 16 | } |
| 17 | |
| 18 | /* { dg-final { scan-assembler-times "vxorps\[^\n\r\]*xmm\[0-9\]" 0 } } */ |