Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/pr123017_3.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 t += 7;
14 t ^= 0x55;
15 t *= 0x55;
16 t -= 0x5;
17 t &= 0xFE;
18 t ^= 0x55;
19 out[i] = t;
20 } else {
21 int t = v * 5;
22 t += 4;
23 t ^= 0x65;
24 t *= 0x35;
25 t -= 0x7;
26 t &= 0x0E;
27 t ^= 0x45;
28 out[i] = t;
29 }
30 }
31 }
32