LLVM
8.0.1
|
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/Optional.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/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <climits>
#include <cmath>
#include <cstdlib>
#include <cstring>
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. More... | |
static uint64_t * | getMemory (unsigned numWords) |
A utility function for allocating memory and checking for allocation failure. More... | |
static unsigned | getDigit (char cdigit, uint8_t radix) |
A utility function that converts a character to a digit. More... | |
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. More... | |
static APInt::WordType | lowBitMask (unsigned bits) |
static APInt::WordType | lowHalf (APInt::WordType part) |
static APInt::WordType | highHalf (APInt::WordType part) |
static unsigned | partMSB (APInt::WordType value) |
static unsigned | partLSB (APInt::WordType value) |
Referenced by KnuthDiv().
|
inlinestatic |
A utility function for allocating memory, checking for allocation failures, and ensuring the contents are zeroed.
Definition at line 38 of file APInt.cpp.
References llvm::Intrinsic::memset.
Referenced by getDigit(), and llvm::APInt::usub_sat().
A utility function that converts a character to a digit.
Definition at line 51 of file APInt.cpp.
References llvm::APInt::APINT_WORD_SIZE, assert(), llvm::ArrayRef< T >::data(), getClearedMemory(), getMemory(), llvm::APInt::getNumWords(), llvm::Intrinsic::memcpy, llvm::APInt::pVal, llvm::ArrayRef< T >::size(), and llvm::APInt::WORDTYPE_MAX.
Referenced by llvm::APInt::usub_sat().
|
inlinestatic |
A utility function for allocating memory and checking for allocation failure.
The content is not zeroed.
Definition at line 46 of file APInt.cpp.
Referenced by llvm::APInt::APInt(), calculateByteProvider(), getDigit(), matchRotateSub(), llvm::APInt::operator*(), llvm::APInt::sext(), llvm::APInt::trunc(), and llvm::APInt::zext().
|
inlinestatic |
Definition at line 2201 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 1237 of file APInt.cpp.
References assert(), llvm::APInt::countLeadingZeros(), llvm::dbgs(), DEBUG_KNUTH, llvm::Hi_32(), llvm::Lo_32(), llvm::Make_64(), llvm::Intrinsic::memset, llvm::RISCVFenceField::R, and remainder.
|
inlinestatic |
Definition at line 2189 of file APInt.cpp.
References llvm::APInt::APINT_BITS_PER_WORD, and assert().
Referenced by lowHalf(), and llvm::APInt::tcExtract().
|
inlinestatic |
Definition at line 2196 of file APInt.cpp.
References llvm::APInt::APINT_BITS_PER_WORD, and lowBitMask().
Referenced by llvm::APInt::tcMultiplyPart().
|
static |
Definition at line 2213 of file APInt.cpp.
References llvm::findFirstSet(), and llvm::ZB_Max.
Referenced by llvm::APInt::tcLSB().
|
static |
Definition at line 2207 of file APInt.cpp.
References llvm::findLastSet(), and llvm::ZB_Max.
Referenced by llvm::APInt::tcMSB().
Definition at line 979 of file APInt.cpp.
References llvm::APInt::APInt(), llvm::APInt::getBitWidth(), llvm::APInt::getLimitedValue(), llvm::APInt::urem(), and llvm::APInt::zext().
Referenced by llvm::APInt::rotl(), and llvm::APInt::rotr().