Add bt2c::reverseFixedLenIntBits()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 31 May 2024 19:43:23 +0000 (15:43 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 4 Sep 2024 19:05:14 +0000 (15:05 -0400)
commite3dc1a7a45954244fdd6096757bfd23c87c9f516
tree337f6b9bd7892ffda498264334f596a9a698974c
parent9d7b288ef209f0157d1cc68057ff6cc9db52d904
Add bt2c::reverseFixedLenIntBits()

This new function reverses the first N least significant bits of a
64-bit integer value, sign-extending if needed, and returns the result.

I basically read [1], which shows the version of Knuth, and adapted that
code to our coding style and requirements.

[1]: https://matthewarcus.wordpress.com/2012/11/18/reversing-a-64-bit-word/

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ib67fd5e8b94e0a82f46527534d47617c87013418
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12706
src/Makefile.am
src/cpp-common/bt2c/reverse-fixed-len-int-bits.hpp [new file with mode: 0644]
This page took 0.025152 seconds and 4 git commands to generate.