Skip to content

Rose::BitOps

Bit operations on unsigned integers.

Functions

Name

Description

all

Generate a value with all bits set or cleared.

allLsb

Set or clear the low‐order bits.

bit

Extract a single bit.

bitLsb

Extract a single bit.

bits

Extract part of a value.

bitsLsb

Extract part of a value limited by width.

convert

Extend or truncate a value.

convertSigned

Sign extend or truncate a value.

highMask

Generate a value with high order bits set.

lowMask

Generate a value with low order bits set.

mask

Generate a mask.

maskLsb

Generate a mask without affecting other bits.

msb

Most significant bit.

msbLsb

Most significant bit within lsb region.

nBits

Number of bits in a type or value.

nSet

position

Generate a single‐bit mask.

positionLsb

Generate a single‐bit mask without affecting the high‐order bits.

replicate

Replicate low‐order bits to fill return value.

replicateLsb

Replicate low‐order bits to fill region without affecting other bits.

rotateLeft

Rotate bits left.

rotateLeftLsb

Rotate low‐order bits left without affecting others.

rotateRight

Rotate bits right.

rotateRightLsb

Rotate low‐order bits right without affecting others.

select

Combine two values based on a bit mask.

shiftLeft

Left shift a value.

shiftLeftLsb

Left shift part of a value without affecting the rest.

shiftRight

Right shift a value.

shiftRightLsb

Right shift part of a value without affecting the rest.

shiftRightSigned

shiftRightSigned overloads

signExtend

Sign extend part of a value to the full width of the src type.

signExtendLsb

Sign extend part of value without affecting other bits.

Description

This namespace provides functions that operate at the bit level on unsigned integer types and avoid C/C++ undefined behavior.

Created with MrDocs