Rose::BitOps::shiftRightSigned
Right shift low bits without affecting other bits.
Synopsis
Declared in <src/Rose/BitOps.h>
template<typename Unsigned>
Unsigned
shiftRightSigned(
Unsigned src,
size_t w,
size_t n);
Description
Right shift the low‐order w bits by n without affecting higher order bits. The width, w, must not be larger than the src width. If is greater than or equal to w then the w low order bits are set or cleared depending on bit w‐1. Otherwise, the n low order bits are discarded and the n new bits introduced at index w‐1 are either zero or one depending on bit w‐1.
Return Value
Updated value.
Parameters
Name |
Description |
src |
Input value. |
w |
Width of the low‐order region. |
n |
Shift count. |
Created with MrDocs