Lines Matching defs:radix
47 inline static unsigned getDigit(char cdigit, uint8_t radix) {
50 if (radix == 16 || radix == 36) {
56 if (r <= radix - 11U)
60 if (r <= radix - 11U)
63 radix = 10;
67 if (r < radix)
116 APInt::APInt(unsigned numbits, StringRef Str, uint8_t radix)
118 fromString(numbits, Str, radix);
549 unsigned APInt::getBitsNeeded(StringRef str, uint8_t radix) {
552 unsigned sufficient = getSufficientBitsNeeded(str, radix);
556 if (radix == 2 || radix == 8 || radix == 16)
575 APInt tmp(sufficient, StringRef(p, slen), radix);
2087 void APInt::fromString(unsigned numbits, StringRef str, uint8_t radix) {
2090 assert((radix == 10 || radix == 8 || radix == 16 || radix == 2 ||
2091 radix == 36) &&
2102 assert((slen <= numbits || radix != 2) && "Insufficient bit width");
2103 assert(((slen-1)*3 <= numbits || radix != 8) && "Insufficient bit width");
2104 assert(((slen-1)*4 <= numbits || radix != 16) && "Insufficient bit width");
2105 assert((((slen-1)*64)/22 <= numbits || radix != 10) &&
2115 unsigned shift = (radix == 16 ? 4 : radix == 8 ? 3 : radix == 2 ? 1 : 0);
2119 unsigned digit = getDigit(*p, radix);
2120 assert(digit < radix && "Invalid character in digit string");
2122 // Shift or multiply the value by the radix
2127 *this *= radix;
2162 llvm_unreachable("Invalid radix!");