diff options
author | Jim Wilson <jim.wilson@linaro.org> | 2017-02-25 20:04:09 -0800 |
---|---|---|
committer | Jim Wilson <jim.wilson@linaro.org> | 2017-02-25 20:04:09 -0800 |
commit | ac189e7bf8865d61b4f5e89a530476f9e4c5c70b (patch) | |
tree | 6259f1c8e9c66da0df22cb004046855101fa5111 /sim/testsuite | |
parent | a8a0c9384831bc03b43e60b8d7896a403807335a (diff) | |
download | gdb-ac189e7bf8865d61b4f5e89a530476f9e4c5c70b.zip gdb-ac189e7bf8865d61b4f5e89a530476f9e4c5c70b.tar.gz gdb-ac189e7bf8865d61b4f5e89a530476f9e4c5c70b.tar.bz2 |
Add missing cnt (popcount) instruction support.
sim/aarch64/
* simulator.c (popcount): New.
(do_vec_CNT): New.
(do_vec_op1): Add do_vec_CNT call.
sim/testsuite/sim/aarch64/
* cnt.s: New.
Diffstat (limited to 'sim/testsuite')
-rw-r--r-- | sim/testsuite/sim/aarch64/ChangeLog | 4 | ||||
-rw-r--r-- | sim/testsuite/sim/aarch64/cnt.s | 33 |
2 files changed, 37 insertions, 0 deletions
diff --git a/sim/testsuite/sim/aarch64/ChangeLog b/sim/testsuite/sim/aarch64/ChangeLog index f737e9d..fcd5873 100644 --- a/sim/testsuite/sim/aarch64/ChangeLog +++ b/sim/testsuite/sim/aarch64/ChangeLog @@ -1,3 +1,7 @@ +2017-02-25 Jim Wilson <jim.wilson@linaro.org> + + * cnt.s: New. + 2017-02-19 Jim Wilson <jim.wilson@linaro.org> * bit.s: Change cmp immediates to account for addv bug fix. diff --git a/sim/testsuite/sim/aarch64/cnt.s b/sim/testsuite/sim/aarch64/cnt.s new file mode 100644 index 0000000..b4be2e3 --- /dev/null +++ b/sim/testsuite/sim/aarch64/cnt.s @@ -0,0 +1,33 @@ +# mach: aarch64 + +# Check the popcount instruction: cnt. + +.include "testutils.inc" + + .data + .align 4 +input: + .word 0x04030201 + .word 0x0f070605 + .word 0x44332211 + .word 0xff776655 + + start + adrp x0, input + ldr q0, [x0, #:lo12:input] + + cnt v1.8b, v0.8b + addv b2, v1.8b + mov x1, v2.d[0] + cmp x1, #16 + bne .Lfailure + + cnt v1.16b, v0.16b + addv b2, v1.16b + mov x1, v2.d[0] + cmp x1, #48 + bne .Lfailure + + pass +.Lfailure: + fail |