LLVM 20.0.0git
|
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/bit.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Alignment.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <cmath>
#include <optional>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "apint" |
#define | DEBUG_KNUTH(X) do {} while(false) |
Functions | |
static uint64_t * | getClearedMemory (unsigned numWords) |
A utility function for allocating memory, checking for allocation failures, and ensuring the contents are zeroed. | |
static uint64_t * | getMemory (unsigned numWords) |
A utility function for allocating memory and checking for allocation failure. | |
static unsigned | getDigit (char cdigit, uint8_t radix) |
A utility function that converts a character to a digit. | |
static void | tcComplement (APInt::WordType *dst, unsigned parts) |
static unsigned | rotateModulo (unsigned BitWidth, const APInt &rotateAmt) |
static void | KnuthDiv (uint32_t *u, uint32_t *v, uint32_t *q, uint32_t *r, unsigned m, unsigned n) |
Implementation of Knuth's Algorithm D (Division of nonnegative integers) from "Art of Computer Programming, Volume 2", section 4.3.1, p. | |
static APInt::WordType | lowBitMask (unsigned bits) |
static APInt::WordType | lowHalf (APInt::WordType part) |
Returns the value of the lower half of PART. | |
static APInt::WordType | highHalf (APInt::WordType part) |
Returns the value of the upper half of PART. | |
A utility function for allocating memory and checking for allocation failure.
The content is not zeroed.
Definition at line 44 of file APInt.cpp.
Referenced by llvm::APInt::operator*(), llvm::APInt::sext(), llvm::APInt::trunc(), and llvm::APInt::zext().
|
inlinestatic |
Returns the value of the upper half of PART.
Definition at line 2304 of file APInt.cpp.
References llvm::APInt::APINT_BITS_PER_WORD.
Referenced by llvm::APInt::tcMultiplyPart().
|
static |
Implementation of Knuth's Algorithm D (Division of nonnegative integers) from "Art of Computer Programming, Volume 2", section 4.3.1, p.
Definition at line 1260 of file APInt.cpp.
References assert(), llvm::countl_zero(), llvm::dbgs(), DEBUG_KNUTH, llvm::Hi_32(), isNeg(), llvm::Lo_32(), and llvm::Make_64().
|
inlinestatic |
Definition at line 2293 of file APInt.cpp.
References llvm::APInt::APINT_BITS_PER_WORD, and assert().
Referenced by lowHalf(), and llvm::APInt::tcExtract().
|
inlinestatic |
Returns the value of the lower half of PART.
Definition at line 2299 of file APInt.cpp.
References llvm::APInt::APINT_BITS_PER_WORD, and lowBitMask().
Referenced by llvm::APInt::tcMultiplyPart().
Definition at line 1093 of file APInt.cpp.
References llvm::BitWidth, llvm::APInt::getBitWidth(), llvm::APInt::getLimitedValue(), LLVM_UNLIKELY, llvm::APInt::urem(), and llvm::APInt::zext().
Referenced by llvm::APInt::rotl(), and llvm::APInt::rotr().
|
static |
Definition at line 338 of file APInt.cpp.
Referenced by llvm::APInt::tcNegate().