This is an old revision of the document!
Namespace std::bit
This namespace contains bit-manipulation functions that can make the ACT description more legible.
export template<pint N, W> function repeat(int<W> x) : int<N*W>;
This concatenates N copies of the W-bit input x to create an output of width N*W.
export template<pint W, W2> function sign_extend(int<W> x) : int<W2>;
This sign-extends the integer x (bitwidth W) to bitwidth W2. W2 must be strictly larger than W.
export template<pint W> function rol(int<W> x) : int<W>;
Left rotate the W bit integer by 1. The MSB of x becomes the LSB of the result (rotating shift).
export template<pint W> function ror(int<W> x) : int<W>;
Right rotate x by one, with the LSB of x becoming the MSB of the result.