template<typename Spec>
class sp::LUT< Spec >
Implement a lookup table.
- Template Parameters
-
Spec | The specification for the lookup table. This must inherit from LUTSpec. |
template<typename Spec >
template<int Bit = 0, int VectorWidth>
static constexpr __uint< VectorWidth > sp::LUT< Spec >::get1BitOutputsFromTransposedInputs |
( |
sp::Vec< __uint< VectorWidth >, info.inputBitCount > |
inputs | ) |
|
|
staticconstexpr |
Get a single bit of output from the LUT for each of a vector of inputs.
This method is intended to be used to generate a LUT that can be used in a highly vectorized fashion. In particular, it implements a bitwise LUT that returns one bit for each input indexing into the same LUT. The transposed nature of the inputs reflects this intended implementation.
- Template Parameters
-
Bit | Which output bit to get. If the LUT has output values other than just 0 and 1, then this parameter can be used to get an output bit other than the least significant bit. |
- Parameters
-
inputs | The inputs to get outputs for. Each element of the sp::Vec is a bit-vector (as a __uint<N>) containing one bit for each input. The number of elements should therefore be the same as the number of bits needed to uniquely represent every integer from 0 to Spec::getMaxInput() inclusive. |
- Returns
- A bit-vector (as a __uint<N>) with one output bit per input.