Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/popcnt-le-3.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 ** le16:
10 ** sub w([0-9]+), w0, #1
11 ** and w([0-9]+), (?:w0, w\1|w\1, w0)
12 ** tst w\2, 65535
13 ** cset w0, eq
14 ** ret
15 */
16
17 unsigned le16 (const unsigned short a) {
18 return __builtin_popcountg (a) <= 1;
19 }
20
21 /*
22 ** gt16:
23 ** sub w([0-9]+), w0, #1
24 ** and w([0-9]+), (?:w0, w\1|w\1, w0)
25 ** tst w\2, 65535
26 ** cset w0, ne
27 ** ret
28 */
29 unsigned gt16 (const unsigned short a) {
30 return __builtin_popcountg (a) > 1;
31 }