Files | |
file | division.c |
SW implementation of 32 and 64 bit division and modulo. | |
file | division.h |
file | multiplication.c |
SW implementation of 32 and 64 bit multiplication. | |
file | multiplication.h |
Defines | |
#define | ABSVAL(x) ( (x) > 0 ? (x) : -(x)) |
#define | SGN(x) ( (x) >= 0 ? 1 : 0 ) |
#define | SOFTINT_CHECK_OF 0 |
Set 1 to return INT64_MAX or INT64_MIN on overflow. | |
Functions | |
long long | __divdi3 (long long a, long long b) |
int | __divsi3 (int a, int b) |
long long | __moddi3 (long long a, long long b) |
int | __modsi3 (int a, int b) |
long long | __muldi3 (long long a, long long b) |
Emulate multiplication of two 64-bit long long integers. | |
unsigned long long | __udivdi3 (unsigned long long a, unsigned long long b) |
unsigned long long | __udivmoddi3 (unsigned long long a, unsigned long long b, unsigned long long *c) |
unsigned int | __udivsi3 (unsigned int a, unsigned int b) |
unsigned long long | __umoddi3 (unsigned long long a, unsigned long long b) |
unsigned int | __umodsi3 (unsigned int a, unsigned int b) |
static unsigned int | divandmod32 (unsigned int a, unsigned int b, unsigned int *remainder) |
static unsigned long long | divandmod64 (unsigned long long a, unsigned long long b, unsigned long long *remainder) |
static unsigned long long | mul (unsigned int a, unsigned int b) |
Multiply two integers and return long long as result. |
static unsigned long long mul | ( | unsigned int | a, | |
unsigned int | b | |||
) | [static] |
Multiply two integers and return long long as result.
This function is overflow safe.
Definition at line 50 of file multiplication.c.