gcc/testsuite/gcc.target/aarch64/pr123017_4.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2" } */ |
| 3 | /* { dg-final { scan-assembler-times "csel\t" 0 } } */ |
| 4 | |
| 5 | void f(const int *restrict in, |
| 6 | int *restrict out, |
| 7 | int n, int threshold) |
| 8 | { |
| 9 | for (int i = 0; i < n; ++i) { |
| 10 | int v = in[i]; |
| 11 | if (v > threshold) { |
| 12 | int t = v * 3; |
| 13 | out[i] = t; |
| 14 | } |
| 15 | } |
| 16 | } |
| 17 |