Lines Matching refs:Radix
50 inline static unsigned getDigit(char cdigit, uint8_t radix) {
53 if (radix == 16 || radix == 36) {
59 if (r <= radix - 11U)
63 if (r <= radix - 11U)
66 radix = 10;
70 if (r < radix)
117 APInt::APInt(unsigned numbits, StringRef Str, uint8_t radix)
120 fromString(numbits, Str, radix);
611 unsigned APInt::getBitsNeeded(StringRef str, uint8_t radix) {
613 assert((radix == 10 || radix == 8 || radix == 16 || radix == 2 ||
614 radix == 36) &&
615 "Radix should be 2, 8, 10, 16, or 36!");
630 if (radix == 2)
632 if (radix == 8)
634 if (radix == 16)
648 = radix == 10? (slen == 1 ? 4 : slen * 64/18)
652 APInt tmp(sufficient, StringRef(p, slen), radix);
2065 void APInt::fromString(unsigned numbits, StringRef str, uint8_t radix) {
2068 assert((radix == 10 || radix == 8 || radix == 16 || radix == 2 ||
2069 radix == 36) &&
2070 "Radix should be 2, 8, 10, 16, or 36!");
2080 assert((slen <= numbits || radix != 2) && "Insufficient bit width");
2081 assert(((slen-1)*3 <= numbits || radix != 8) && "Insufficient bit width");
2082 assert(((slen-1)*4 <= numbits || radix != 16) && "Insufficient bit width");
2083 assert((((slen-1)*64)/22 <= numbits || radix != 10) &&
2091 unsigned shift = (radix == 16 ? 4 : radix == 8 ? 3 : radix == 2 ? 1 : 0);
2096 APInt apradix(getBitWidth(), radix);
2100 unsigned digit = getDigit(*p, radix);
2101 assert(digit < radix && "Invalid character in digit string");
2103 // Shift or multiply the value by the radix
2125 void APInt::toString(SmallVectorImpl<char> &Str, unsigned Radix,
2127 assert((Radix == 10 || Radix == 8 || Radix == 16 || Radix == 2 ||
2128 Radix == 36) &&
2129 "Radix should be 2, 8, 10, 16, or 36!");
2133 switch (Radix) {
2148 llvm_unreachable("Invalid radix!");
2187 *--BufPtr = Digits[N % Radix];
2188 N /= Radix;
2216 if (Radix == 2 || Radix == 8 || Radix == 16) {
2218 unsigned ShiftAmt = (Radix == 16 ? 4 : (Radix == 8 ? 3 : 1));
2219 unsigned MaskAmt = Radix - 1;
2227 APInt divisor(Radix == 10? 4 : 8, Radix);
2234 assert(Digit < Radix && "divide failed");
2247 std::string APInt::toString(unsigned Radix = 10, bool Signed = true) const {
2249 toString(S, Radix, Signed, /* formatAsCLiteral = */false);