Predator  [unstable] git snapshot
Data Structures | Namespaces | Typedefs | Functions | Variables
intrange.hh File Reference
#include "config.h"

Go to the source code of this file.

Data Structures

struct  Range
 a closed interval over integral domain More...

Namespaces

namespace  IR

Typedefs

typedef signed long TInt
typedef unsigned long TUInt

Functions

Range rngFromNum (TInt num)
TInt extendSignedIntFromLeft (TInt num)
 insert ones as padding from left
void chkRange (const Range &rng)
 this does nothing unless running a debug build
bool operator== (const Range &a, const Range &b)
bool operator!= (const Range &a, const Range &b)
TInt invertInt (TInt)
 invert polarity of the number
Range operator- (Range rng)
 invert polarity of the range
Range & operator+= (Range &rng, const Range &other)
 add another range, but preserve boundary values if already reached
Range & operator*= (Range &rng, const Range &other)
 multiply by another range, but preserve boundary values if already reached
Range & operator&= (Range &rng, TInt mask)
 bitwise AND on range where the bitmask is a single number
Range & operator<<= (Range &rng, TUInt)
Range & operator>>= (Range &rng, TUInt)
Range & operator-= (Range &rng, const Range &other)
 subtract another range, but preserve boundary values if already reached
Range operator+ (Range rng, const Range &other)
Range operator* (Range rng, const Range &other)
Range operator- (Range rng, const Range &other)
Range operator& (Range rng, TInt mask)
Range operator<< (Range rng, TUInt n)
Range operator>> (Range rng, TUInt n)
Range join (const Range &rng1, const Range &rng2)
 return a range that covers both given ranges, preserve alignment if possible
bool isRangeByNum (bool *pIsRange1, const Range &rng1, const Range &rng2)
 return true if exactly one of the given ranges represents a single number
bool isCovered (const Range &small, const Range &big)
 true if the small range is inside the big one (sharing endpoints is fine)
bool isSingular (const Range &)
 return true if the range contain exactly one number; break if no one at all
bool isAligned (const Range &)
 return true if the range is non-trivially aligned
void adjustAlignment (Range *)
 adjust the alignment so that the bounds are aligned
TUInt widthOf (const Range &)
 return the count of integral numbers that the given range represents

Variables

const TInt Int0
const TInt Int1
const TInt IntMin
const TInt IntMax
const Range FullRange