Namespaces |
namespace | anonymous_namespace{APInt.cpp} |
Defines |
#define | DEBUG_TYPE "apint" |
#define | rot(x, k) (((x)<<(k)) | ((x)>>(32-(k)))) |
#define | mix(a, b, c) |
#define | final(a, b, c) |
#define | COMPILE_TIME_ASSERT(cond) extern int CTAssert[(cond) ? 1 : -1] |
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 bool | add_1 (uint64_t dest[], uint64_t x[], unsigned len, uint64_t y) |
| add_1 - This function adds a single "digit" integer, y, to the multiple "digit" integer array, x[].
|
static bool | sub_1 (uint64_t x[], unsigned len, uint64_t y) |
| sub_1 - This function subtracts a single "digit" (64-bit word), y, from the multi-digit integer array, x[], propagating the borrowed 1 value until no further borrowing is neeeded or it runs out of "digits" in x.
|
static bool | add (uint64_t *dest, const uint64_t *x, const uint64_t *y, unsigned len) |
| add - This function adds the integer array x to the integer array Y and places the result in dest.
|
static bool | sub (uint64_t *dest, const uint64_t *x, const uint64_t *y, unsigned len) |
| Subtracts the integer array y from the integer array x.
|
static uint64_t | mul_1 (uint64_t dest[], uint64_t x[], unsigned len, uint64_t y) |
| Multiplies an integer array, x, by a uint64_t integer and places the result into dest.
|
static void | mul (uint64_t dest[], uint64_t x[], unsigned xlen, uint64_t y[], unsigned ylen) |
| Multiplies integer array x by integer array y and stores the result into the integer array dest.
|
static uint32_t | hashword (const uint64_t *k64, size_t length) |
static uint32_t | hashword8 (const uint64_t k64) |
static unsigned | countLeadingOnes_64 (uint64_t V, unsigned skip) |
static void | KnuthDiv (unsigned *u, unsigned *v, unsigned *q, unsigned *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.
|
| COMPILE_TIME_ASSERT (integerPartWidth%2==0) |
static integerPart | anonymous_namespace{APInt.cpp}::lowBitMask (unsigned int bits) |
static integerPart | anonymous_namespace{APInt.cpp}::lowHalf (integerPart part) |
static integerPart | anonymous_namespace{APInt.cpp}::highHalf (integerPart part) |
static unsigned int | anonymous_namespace{APInt.cpp}::partMSB (integerPart value) |
static unsigned int | anonymous_namespace{APInt.cpp}::partLSB (integerPart value) |
static bool sub_1 |
( |
uint64_t |
x[], |
|
|
unsigned |
len, |
|
|
uint64_t |
y | |
|
) |
| | [static] |
sub_1 - This function subtracts a single "digit" (64-bit word), y, from the multi-digit integer array, x[], propagating the borrowed 1 value until no further borrowing is neeeded or it runs out of "digits" in x.
The result is 1 if "borrowing" exhausted the digits in x, or 0 if x was not exhausted. In other words, if y > x then this function returns 1, otherwise 0.
- Returns:
- the borrow out of the subtraction