summaryrefslogtreecommitdiff
path: root/tests/test-bitops.c
AgeCommit message (Collapse)AuthorFilesLines
2016-06-17bitops.h: Implement half-shuffle and half-unshuffle opsPeter Maydell1-0/+72
A half-shuffle operation takes a word with zeros in the high half: 0000 0000 0000 0000 ABCD EFGH IJKL MNOP and spreads the bits out so they are in every other bit of the word: 0A0B 0C0D 0E0F 0G0H 0I0J 0K0L 0M0N 0O0P A half-unshuffle performs the reverse operation. Provide functions in bitops.h which implement these operations for 32-bit and 64-bit inputs, and add tests for them. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Shannon Zhao <shannon.zhao@linaro.org> Tested-by: Shannon Zhao <shannon.zhao@linaro.org> Message-id: 1465915112-29272-3-git-send-email-peter.maydell@linaro.org
2016-06-07tests: Remove unnecessary glib.h includesPeter Maydell1-1/+0
Remove glib.h includes, as it is provided by osdep.h. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com> Tested-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-02-16tests: Clean up includesPeter Maydell1-2/+1
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com> Tested-by: Eric Blake <eblake@redhat.com>
2014-11-02tests: Add missing include to test-bitops.cEduardo Habkost1-0/+1
The test code needs osdep.h for the ARRAY_SIZE macro. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-05tests: fix 64-bit int literals for 32-bit hostsStefan Hajnoczi1-2/+2
On 32-bit hosts: CC tests/test-opts-visitor.o tests/test-opts-visitor.c: In function 'test_value': tests/test-opts-visitor.c:128: warning: integer constant is too large for 'long' type CC tests/test-bitops.o tests/test-bitops.c:34: warning: integer constant is too large for 'long' type tests/test-bitops.c:35: warning: integer constant is too large for 'long' type tests/test-bitops.c:35: warning: integer constant is too large for 'long' type CC tests/endianness-test.o tests/endianness-test.c:47: warning: integer constant is too large for 'long' type Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1383669768-23926-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-07-22tests: Add test-bitops.c with some sextract testsPeter Maydell1-0/+75
Add some simple test cases for the new sextract32 and sextract64 functions. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Message-id: 1372419632-5521-3-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>