MCPcopy Create free account
hub / github.com/apache/arrow / ReverseUint8

Function ReverseUint8

cpp/src/arrow/util/bitmap_ops.cc:122–127  ·  view source on GitHub ↗

Reverse all bits from entire byte(uint8)

Source from the content-addressed store, hash-verified

120
121// Reverse all bits from entire byte(uint8)
122uint8_t ReverseUint8(uint8_t num) {
123 num = ((num & 0xf0) >> 4) | ((num & 0x0f) << 4);
124 num = ((num & 0xcc) >> 2) | ((num & 0x33) << 2);
125 num = ((num & 0xaa) >> 1) | ((num & 0x55) << 1);
126 return num;
127}
128
129// Get a reverse block of byte(uint8) using offsets, the result can be
130// part of a left block and right block, length indicates the number of bits

Callers 1

GetReversedBlockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected