template<unsigned int bit, unsigned int width, typename T > |
CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T >::type | bit_sub (T v) |
| extract bit ranges from plain data types More...
|
|
template<typename T , unsigned B> |
CONSTEXPR T | signextend (const typename std::make_unsigned< T >::type x) |
| sign-extend a given value More...
|
|
template<unsigned int bit, unsigned int width, typename T > |
constexpr std::make_signed< T >::type | signed_bit_sub (T v) |
| a function that converts from B bits to T in one operation More...
|
|
This module contains generic C++ functions being independent of SystemC
◆ bit_sub()
template<unsigned int bit, unsigned int width, typename T >
CONSTEXPR std::enable_if<std::is_unsigned<T>::value, T>::type bit_sub |
( |
T |
v | ) |
|
extract bit ranges from plain data types
- Template Parameters
-
bit | start bit |
width | size of the bit field to extract |
T | data type carrying the bits |
- Parameters
-
v | value from which the bytes are to be extracted |
- Returns
- the extracted bit. It is of the same data type as the passed value
Definition at line 54 of file ities.h.
◆ signed_bit_sub()
template<unsigned int bit, unsigned int width, typename T >
constexpr std::make_signed<T>::type signed_bit_sub |
( |
T |
v | ) |
|
|
inlineconstexpr |
a function that converts from B bits to T in one operation
- Template Parameters
-
- Parameters
-
- Returns
Definition at line 95 of file ities.h.
◆ signextend()
template<typename T , unsigned B>
CONSTEXPR T signextend |
( |
const typename std::make_unsigned< T >::type |
x | ) |
|
sign-extend a given value
- Template Parameters
-
T | the datatype |
B | the numer of signed bits |
- Parameters
-
- Returns
- the sign-extended value of type T
Definition at line 76 of file ities.h.