Lines Matching refs:numBits
651 DE_INLINE deUint32 deBitMask32 (int leastSignificantBitNdx, int numBits) in deBitMask32() argument
654 DE_ASSERT(deInRange32(numBits, 0, 32)); in deBitMask32()
655 DE_ASSERT(deInRange32(leastSignificantBitNdx+numBits, 0, 32)); in deBitMask32()
657 if (numBits < 32 && leastSignificantBitNdx < 32) in deBitMask32()
658 return ((1u<<numBits)-1u) << (deUint32)leastSignificantBitNdx; in deBitMask32()
659 else if (numBits == 0 && leastSignificantBitNdx == 32) in deBitMask32()
663 DE_ASSERT(numBits == 32 && leastSignificantBitNdx == 0); in deBitMask32()
668 DE_INLINE deUint32 deUintMaxValue32 (int numBits) in deUintMaxValue32() argument
670 DE_ASSERT(deInRange32(numBits, 1, 32)); in deUintMaxValue32()
671 if (numBits < 32) in deUintMaxValue32()
672 return ((1u<<numBits)-1u); in deUintMaxValue32()
677 DE_INLINE deInt32 deIntMaxValue32 (int numBits) in deIntMaxValue32() argument
679 DE_ASSERT(deInRange32(numBits, 1, 32)); in deIntMaxValue32()
680 if (numBits < 32) in deIntMaxValue32()
681 return ((deInt32)1 << (numBits - 1)) - 1; in deIntMaxValue32()
689 DE_INLINE deInt32 deIntMinValue32 (int numBits) in deIntMinValue32() argument
691 DE_ASSERT(deInRange32(numBits, 1, 32)); in deIntMinValue32()
692 if (numBits < 32) in deIntMinValue32()
693 return -((deInt32)1 << (numBits - 1)); in deIntMinValue32()
701 DE_INLINE deInt32 deSignExtendTo32 (deInt32 value, int numBits) in deSignExtendTo32() argument
703 DE_ASSERT(deInRange32(numBits, 1, 32)); in deSignExtendTo32()
705 if (numBits < 32) in deSignExtendTo32()
707 deBool signSet = ((deUint32)value & (1u<<(numBits-1))) != 0; in deSignExtendTo32()
708 deUint32 signMask = deBitMask32(numBits, 32-numBits); in deSignExtendTo32()