gcc/testsuite/gcc.target/aarch64/popcnt5.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2" } */ |
| 3 | /* { dg-final { check-function-bodies "**" "" } } */ |
| 4 | /* PR target/113042 */ |
| 5 | |
| 6 | #pragma GCC target "+nocssc" |
| 7 | |
| 8 | /* |
| 9 | ** h8: |
| 10 | ** ldr b[0-9]+, \[x0\] |
| 11 | ** cnt v[0-9]+.8b, v[0-9]+.8b |
| 12 | ** smov w0, v[0-9]+.b\[0\] |
| 13 | ** ret |
| 14 | */ |
| 15 | /* We should not need the addv here since we only need a byte popcount. */ |
| 16 | |
| 17 | unsigned h8 (const unsigned char *a) { |
| 18 | return __builtin_popcountg (a[0]); |
| 19 | } |