]> Git Repo - qemu.git/commit
bitops.h: Implement half-shuffle and half-unshuffle ops
authorPeter Maydell <[email protected]>
Fri, 17 Jun 2016 14:23:45 +0000 (15:23 +0100)
committerPeter Maydell <[email protected]>
Fri, 17 Jun 2016 14:23:51 +0000 (15:23 +0100)
commitb355438de52d0782983bf4bdc47936189a0c988b
tree2a93d70d0440c5506d1b231af1d930672d4d11a9
parent04716bc8fd919a0ac1c8c4502250b01eda39dd4a
bitops.h: Implement half-shuffle and half-unshuffle ops

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 <[email protected]>
Reviewed-by: Shannon Zhao <[email protected]>
Tested-by: Shannon Zhao <[email protected]>
Message-id: 1465915112[email protected]
include/qemu/bitops.h
tests/test-bitops.c
This page took 0.023893 seconds and 4 git commands to generate.