Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/popcnt-le-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-rtl-expand-details" } */
3 /* { dg-final { check-function-bodies "**" "" } } */
4 /* PR middle-end/90693 */
5
6 #pragma GCC target "+nocssc"
7
8 /*
9 ** le32:
10 ** sub w([0-9]+), w0, #1
11 ** tst (?:w0, w\1|w\1, w0)
12 ** cset w0, eq
13 ** ret
14 */
15
16 unsigned le32 (const unsigned int a) {
17 return __builtin_popcountg (a) <= 1;
18 }
19
20 /*
21 ** gt32:
22 ** sub w([0-9]+), w0, #1
23 ** tst (?:w0, w\1|w\1, w0)
24 ** cset w0, ne
25 ** ret
26 */
27 unsigned gt32 (const unsigned int a) {
28 return __builtin_popcountg (a) > 1;
29 }