Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/pr123017_5.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
3 /* { dg-final { scan-assembler-times "csel\t" 1 } } */
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 t += 7;
14 out[i] = t;
15 } else {
16 out[i] = v;
17 }
18 }
19 }
20