macros.h
changeset 4274 af2ccbc3f643
parent 3943 d3d5f7b3d3d0
child 4300 c7e43c47a2b9
equal deleted inserted replaced
4273:131c3aba4c14 4274:af2ccbc3f643
    53 static inline uint32 BIGMULUS(uint32 a, uint32 b, int shift) {
    53 static inline uint32 BIGMULUS(uint32 a, uint32 b, int shift) {
    54 	return (uint32)(((uint64)(a) * (uint64)(b)) >> (shift));
    54 	return (uint32)(((uint64)(a) * (uint64)(b)) >> (shift));
    55 }
    55 }
    56 
    56 
    57 static inline int64 BIGMULS(int32 a, int32 b) {
    57 static inline int64 BIGMULS(int32 a, int32 b) {
    58 	return (int32)(((int64)(a) * (int64)(b)));
    58 	return (int64)(a) * (int64)(b);
    59 }
    59 }
    60 
    60 
    61 /* OPT: optimized into an unsigned comparison */
    61 /* OPT: optimized into an unsigned comparison */
    62 //#define IS_INSIDE_1D(x, base, size) ((x) >= (base) && (x) < (base) + (size))
    62 //#define IS_INSIDE_1D(x, base, size) ((x) >= (base) && (x) < (base) + (size))
    63 #define IS_INSIDE_1D(x, base, size) ( (uint)((x) - (base)) < ((uint)(size)) )
    63 #define IS_INSIDE_1D(x, base, size) ( (uint)((x) - (base)) < ((uint)(size)) )