ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
integerOps.h File Reference
#include <cassert>
#include <limits>
#include <boost/static_assert.hpp>
#include <boost/optional.hpp>
Include dependency graph for integerOps.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  IntegerOpsPrivate::NumBits< T >
 
struct  IntegerOpsPrivate::SHL1Helper< T, Count, TooBig >
 
struct  IntegerOpsPrivate::SHL1Helper< T, Count, true >
 
struct  IntegerOpsPrivate::SHL1Helper< T, Count, false >
 
struct  IntegerOps::SHL1< T, n >
 Bitmask constant with bit n set. More...
 
struct  IntegerOps::GenMask< T, n >
 Bit mask constant with bits 0 through n-1 set. More...
 

Namespaces

 IntegerOpsPrivate
 
 IntegerOps
 Bit-wise operations on integers.
 

Constant Groups

 IntegerOpsPrivate
 
 IntegerOps
 Bit-wise operations on integers.
 

Functions

template<typename T >
IntegerOps::shl1 (size_t n)
 Bitmask with bit n set. More...
 
template<typename T >
IntegerOps::genMask (size_t n)
 Bitmask with bits 0 through N-1 set. More...
 
template<typename T >
IntegerOps::genMask (size_t lobit, size_t hibit)
 Generate a bitmask. More...
 
template<typename T >
bool IntegerOps::isPowerOfTwo (T value)
 Returns true if the value is a power of two. More...
 
template<typename T >
IntegerOps::log2max (T value)
 Returns the base-2 logorithm of value. More...
 
template<typename T >
IntegerOps::log2 (T a)
 
template<typename T >
bool IntegerOps::bitmask_subset (T m1, T m2)
 Determines if one bitmask is a subset of another. More...
 
template<typename T >
size_t IntegerOps::countSet (T val)
 Counts how many bits are set (one). More...
 
template<typename T >
size_t IntegerOps::countClear (T val)
 Counts how many bits are clear (zero). More...
 
template<typename T >
boost::optional< size_t > IntegerOps::msb_set (T val)
 Optionally returns the zero-origin position of the most significant set bit. More...
 
template<size_t NBits, typename T >
bool IntegerOps::signBit (T value)
 Returns true if the sign bit is set, false if clear. More...
 
template<typename T >
bool IntegerOps::signBit2 (T value, size_t width=8 *sizeof(T))
 Returns true if the sign bit is set, false if clear. More...
 
template<size_t FromBits, size_t ToBits, typename T >
IntegerOps::signExtend (T value)
 Sign extend value. More...
 
template<typename T >
IntegerOps::signExtend2 (T value, size_t from_width, size_t to_width)
 Sign extend value. More...
 
template<size_t NBits, typename T >
IntegerOps::shiftLeft (T value, size_t count)
 Shifts bits of value left by count bits. More...
 
template<typename T >
IntegerOps::shiftLeft2 (T value, size_t count, size_t width=8 *sizeof(T))
 Shifts bits of value left by count bits. More...
 
template<size_t NBits, typename T >
IntegerOps::shiftRightLogical (T value, size_t count)
 Shifts bits of value right by count bits without sign extension. More...
 
template<typename T >
IntegerOps::shiftRightLogical2 (T value, size_t count, size_t width=8 *sizeof(T))
 Shifts bits of value right by count bits without sign extension. More...
 
template<size_t NBits, typename T >
IntegerOps::shiftRightArithmetic (T value, size_t count)
 Shifts bits of value right by count bits with sign extension. More...
 
template<typename T >
IntegerOps::shiftRightArithmetic2 (T value, size_t count, size_t width=8 *sizeof(T))
 Shifts bits of value right by count bits with sign extension. More...
 
template<size_t NBits, typename T >
IntegerOps::rotateLeft (T value, size_t count)
 Rotate the bits of the value left by count bits. More...
 
template<typename T >
IntegerOps::rotateLeft2 (T value, size_t count, size_t width=8 *sizeof(T))
 Rotate the bits of the value left by count bits. More...
 
template<size_t NBits, typename T >
IntegerOps::rotateRight (T value, size_t count)
 Rotate bits of the value right by count bits. More...
 
template<typename T >
IntegerOps::rotateRight2 (T value, size_t count, size_t width=8 *sizeof(T))
 Rotate bits of the value right by count bits. More...
 
template<size_t lobit, size_t hibit, typename T >
IntegerOps::shift_to (T value)
 Create a shifted value. More...
 
template<typename T >
IntegerOps::shift_to2 (size_t lobit, size_t hibit, T value)
 Create a shifted value. More...
 
template<size_t lobit, size_t hibit, typename T >
IntegerOps::extract (T bits)
 Extract bits from a value. More...
 
template<typename T >
IntegerOps::extract2 (size_t lobit, size_t hibit, T bits)
 Extract bits from a value. More...