Go to the source code of this file.
Macros | |
#define | ARRAYSIZE(p) (sizeof(p)/sizeof(p[0])) |
TO BE DOCUMENTED. More... | |
#define | END_RUNONCE __RunOnce__ = true;}} |
#define | IS_ALIGNED_2(x) ((x&1)==0) |
#define | IS_ALIGNED_4(x) ((x&3)==0) |
#define | IS_ALIGNED_8(x) ((x&7)==0) |
#define | OFFSET_OF(Class, Member) (size_t)&(((Class*)0)->Member) |
TO BE DOCUMENTED. More... | |
#define | PREVENT_COPY(cur_class) private: cur_class(const cur_class& object); cur_class& operator=(const cur_class& object); |
#define | START_RUNONCE { static bool __RunOnce__ = false; if(!__RunOnce__){ |
Functions | |
inline_ void | _prefetch (void const *ptr) |
FUNCTION ICECORE_API udword | Alignment (udword address) |
inline_ int | ClampToInt16 (int x) |
inline_ void | Compute2DCoords (udword &u, udword &v, udword i, udword nbu) |
inline_ void | Compute3DCoords (udword &u, udword &v, udword &w, udword i, udword nbu, udword nbu_nbv) |
inline_ udword | CountBits (udword n) |
Count the number of '1' bits in a 32 bit word (from Steve Baker's Cute Code Collection) More... | |
inline_ udword | CountBits2 (udword bits) |
Even faster? More... | |
inline_ float | FeedbackFilter (float val, float &memory, float sharpness) |
inline_ BOOL | HasNullByte (udword x) |
inline_ bool | IsPowerOfTwo (udword n) |
Test to see if a number is an exact power of two (from Steve Baker's Cute Code Collection) More... | |
inline_ udword | LowestOneBit (udword w) |
inline_ sdword | min_ (sdword a, sdword b) |
inline_ udword | msb32 (udword x) |
inline_ udword | nlpo2 (udword x) |
inline_ void | ReverseBits (udword &n) |
inline_ void | SetLeastNBits (udword &x, udword n) |
Set the least significant N bits in a word. (from Steve Baker's Cute Code Collection) More... | |
inline_ void | SpreadBits (udword &n) |
inline_ void | Swap (udword &x, udword &y) |
template<class Type > | |
inline_ Type | TClamp (const Type &x, const Type &lo, const Type &hi) |
template<class Type > | |
inline_ void | TSort (Type &a, Type &b) |
template<class Type > | |
inline_ void | TSort (Type &a, Type &b, Type &c) |
template<class Type > | |
inline_ void | TSwap (Type &a, Type &b) |
inline_ void | ZeroLeastSetBit (udword &n) |
Zero the least significant '1' bit in a word. (from Steve Baker's Cute Code Collection) More... | |
#define ARRAYSIZE | ( | p | ) | (sizeof(p)/sizeof(p[0])) |
TO BE DOCUMENTED.
Definition at line 207 of file IceUtils.h.
#define END_RUNONCE __RunOnce__ = true;}} |
Definition at line 16 of file IceUtils.h.
#define IS_ALIGNED_2 | ( | x | ) | ((x&1)==0) |
Definition at line 219 of file IceUtils.h.
#define IS_ALIGNED_4 | ( | x | ) | ((x&3)==0) |
Definition at line 220 of file IceUtils.h.
#define IS_ALIGNED_8 | ( | x | ) | ((x&7)==0) |
Definition at line 221 of file IceUtils.h.
#define OFFSET_OF | ( | Class, | |
Member | |||
) | (size_t)&(((Class*)0)->Member) |
TO BE DOCUMENTED.
Definition at line 205 of file IceUtils.h.
#define PREVENT_COPY | ( | cur_class | ) | private: cur_class(const cur_class& object); cur_class& operator=(const cur_class& object); |
Definition at line 202 of file IceUtils.h.
#define START_RUNONCE { static bool __RunOnce__ = false; if(!__RunOnce__){ |
Definition at line 15 of file IceUtils.h.
FUNCTION ICECORE_API udword Alignment | ( | udword | address | ) |
If you can guarantee that your input domain (i.e. value of x) is slightly limited (abs(x) must be < ((1<<31u)-32767)), then you can use the following code to clamp the resulting value into [-32768,+32767] range:
Definition at line 171 of file IceUtils.h.
Definition at line 238 of file IceUtils.h.
inline_ void Compute3DCoords | ( | udword & | u, |
udword & | v, | ||
udword & | w, | ||
udword | i, | ||
udword | nbu, | ||
udword | nbu_nbv | ||
) |
Definition at line 250 of file IceUtils.h.
Count the number of '1' bits in a 32 bit word (from Steve Baker's Cute Code Collection)
Definition at line 32 of file IceUtils.h.
Even faster?
Definition at line 49 of file IceUtils.h.
inline_ float FeedbackFilter | ( | float | val, |
float & | memory, | ||
float | sharpness | ||
) |
Definition at line 160 of file IceUtils.h.
Definition at line 124 of file IceUtils.h.
Test to see if a number is an exact power of two (from Steve Baker's Cute Code Collection)
Definition at line 87 of file IceUtils.h.
Definition at line 127 of file IceUtils.h.
Definition at line 136 of file IceUtils.h.
Definition at line 76 of file IceUtils.h.
Reverse all the bits in a 32 bit word (from Steve Baker's Cute Code Collection) (each line can be done in any order.
Definition at line 20 of file IceUtils.h.
Set the least significant N bits in a word. (from Steve Baker's Cute Code Collection)
Definition at line 93 of file IceUtils.h.
Spread out bits. EG 00001111 -> 0101010101 00001010 -> 0100010000 This is used to interleve to intergers to produce a ‘Morten Key’ used in Space Filling Curves (See DrDobbs Journal, July 1999) Order is important.
Definition at line 62 of file IceUtils.h.
Classic XOR swap (from Steve Baker's Cute Code Collection) x ^= y; /* x' = (x^y) / y ^= x; / y' = (y^(x^y)) = x / x ^= y; / x' = (x^y)^x = y */
Definition at line 99 of file IceUtils.h.
Definition at line 184 of file IceUtils.h.
Definition at line 186 of file IceUtils.h.
Definition at line 191 of file IceUtils.h.
Definition at line 183 of file IceUtils.h.
Zero the least significant '1' bit in a word. (from Steve Baker's Cute Code Collection)
Definition at line 90 of file IceUtils.h.