gcc/testsuite/gcc.target/aarch64/sve/cnt_fold_4.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2" } */ |
| 3 | /* { dg-final { check-function-bodies "**" "" } } */ |
| 4 | |
| 5 | #include <arm_sve.h> |
| 6 | |
| 7 | /* |
| 8 | ** f1: |
| 9 | ** cnth x0 |
| 10 | ** ret |
| 11 | */ |
| 12 | uint64_t |
| 13 | f1 () |
| 14 | { |
| 15 | uint64_t x = svcntw (); |
| 16 | x >>= 2; |
| 17 | return x << 3; |
| 18 | } |
| 19 | |
| 20 | /* |
| 21 | ** f2: |
| 22 | ** [^\n]+ |
| 23 | ** [^\n]+ |
| 24 | ** ... |
| 25 | ** ret |
| 26 | */ |
| 27 | uint64_t |
| 28 | f2 () |
| 29 | { |
| 30 | uint64_t x = svcntd (); |
| 31 | x >>= 2; |
| 32 | return x << 3; |
| 33 | } |
| 34 | |
| 35 | /* |
| 36 | ** f3: |
| 37 | ** cntb x0, all, mul #4 |
| 38 | ** ret |
| 39 | */ |
| 40 | uint64_t |
| 41 | f3 () |
| 42 | { |
| 43 | uint64_t x = svcntd (); |
| 44 | x >>= 1; |
| 45 | return x << 6; |
| 46 | } |
| 47 | |
| 48 | /* |
| 49 | ** f4: |
| 50 | ** [^\n]+ |
| 51 | ** [^\n]+ |
| 52 | ** ... |
| 53 | ** ret |
| 54 | */ |
| 55 | uint64_t |
| 56 | f4 () |
| 57 | { |
| 58 | uint64_t x = svcntd (); |
| 59 | x >>= 2; |
| 60 | return x << 2; |
| 61 | } |