Next: Soft float library routines, Up: Libgcc

The integer arithmetic routines are used on platforms that don't provide hardware support for arithmetic operations on some modes.

— Runtime Function: int **__ashlsi3** (`int a, int b`)

— Runtime Function: long**__ashldi3** (`long a, int b`)

— Runtime Function: long long**__ashlti3** (`long long a, int b`)

— Runtime Function: long

— Runtime Function: long long

These functions return the result of shifting

aleft bybbits.

— Runtime Function: int **__ashrsi3** (`int a, int b`)

— Runtime Function: long**__ashrdi3** (`long a, int b`)

— Runtime Function: long long**__ashrti3** (`long long a, int b`)

— Runtime Function: long

— Runtime Function: long long

These functions return the result of arithmetically shifting

aright bybbits.

— Runtime Function: int **__divsi3** (`int a, int b`)

— Runtime Function: long**__divdi3** (`long a, long b`)

— Runtime Function: long long**__divti3** (`long long a, long long b`)

— Runtime Function: long

— Runtime Function: long long

These functions return the quotient of the signed division of

aandb.

— Runtime Function: int **__lshrsi3** (`int a, int b`)

— Runtime Function: long**__lshrdi3** (`long a, int b`)

— Runtime Function: long long**__lshrti3** (`long long a, int b`)

— Runtime Function: long

— Runtime Function: long long

These functions return the result of logically shifting

aright bybbits.

— Runtime Function: int **__modsi3** (`int a, int b`)

— Runtime Function: long**__moddi3** (`long a, long b`)

— Runtime Function: long long**__modti3** (`long long a, long long b`)

— Runtime Function: long

— Runtime Function: long long

These functions return the remainder of the signed division of

aandb.

— Runtime Function: int **__mulsi3** (`int a, int b`)

— Runtime Function: long**__muldi3** (`long a, long b`)

— Runtime Function: long long**__multi3** (`long long a, long long b`)

— Runtime Function: long

— Runtime Function: long long

These functions return the product of

aandb.

— Runtime Function: long **__negdi2** (`long a`)

— Runtime Function: long long**__negti2** (`long long a`)

— Runtime Function: long long

These functions return the negation of

a.

— Runtime Function: unsigned int **__udivsi3** (`unsigned int a, unsigned int b`)

— Runtime Function: unsigned long**__udivdi3** (`unsigned long a, unsigned long b`)

— Runtime Function: unsigned long long**__udivti3** (`unsigned long long a, unsigned long long b`)

— Runtime Function: unsigned long

— Runtime Function: unsigned long long

These functions return the quotient of the unsigned division of

aandb.

— Runtime Function: unsigned long **__udivmoddi4** (`unsigned long a, unsigned long b, unsigned long *c`)

— Runtime Function: unsigned long long**__udivmodti4** (`unsigned long long a, unsigned long long b, unsigned long long *c`)

— Runtime Function: unsigned long long

These functions calculate both the quotient and remainder of the unsigned division of

aandb. The return value is the quotient, and the remainder is placed in variable pointed to byc.

— Runtime Function: unsigned int **__umodsi3** (`unsigned int a, unsigned int b`)

— Runtime Function: unsigned long**__umoddi3** (`unsigned long a, unsigned long b`)

— Runtime Function: unsigned long long**__umodti3** (`unsigned long long a, unsigned long long b`)

— Runtime Function: unsigned long

— Runtime Function: unsigned long long

These functions return the remainder of the unsigned division of

aandb.

The following functions implement integral comparisons. These functions implement a low-level compare, upon which the higher level comparison operators (such as less than and greater than or equal to) can be constructed. The returned values lie in the range zero to two, to allow the high-level operators to be implemented by testing the returned result using either signed or unsigned comparison.

— Runtime Function: int **__cmpdi2** (`long a, long b`)

— Runtime Function: int**__cmpti2** (`long long a, long long b`)

— Runtime Function: int

These functions perform a signed comparison of

aandb. Ifais less thanb, they return 0; ifais greater thanb, they return 2; and ifaandbare equal they return 1.

— Runtime Function: int **__ucmpdi2** (`unsigned long a, unsigned long b`)

— Runtime Function: int**__ucmpti2** (`unsigned long long a, unsigned long long b`)

— Runtime Function: int

These functions perform an unsigned comparison of

aandb. Ifais less thanb, they return 0; ifais greater thanb, they return 2; and ifaandbare equal they return 1.

The following functions implement trapping arithmetic. These functions
call the libc function `abort`

upon signed arithmetic overflow.

— Runtime Function: int **__absvsi2** (`int a`)

— Runtime Function: long**__absvdi2** (`long a`)

— Runtime Function: long

These functions return the absolute value of

a.

— Runtime Function: int **__addvsi3** (`int a, int b`)

— Runtime Function: long**__addvdi3** (`long a, long b`)

— Runtime Function: long

These functions return the sum of

aandb; that isa`+`

b.

— Runtime Function: int **__mulvsi3** (`int a, int b`)

— Runtime Function: long**__mulvdi3** (`long a, long b`)

— Runtime Function: long

The functions return the product of

aandb; that isa`*`

b.

— Runtime Function: int **__negvsi2** (`int a`)

— Runtime Function: long**__negvdi2** (`long a`)

— Runtime Function: long

These functions return the negation of

a; that is`-`

a.

— Runtime Function: int **__subvsi3** (`int a, int b`)

— Runtime Function: long**__subvdi3** (`long a, long b`)

— Runtime Function: long

These functions return the difference between

banda; that isa`-`

b.

— Runtime Function: int **__clzsi2** (`int a`)

— Runtime Function: int**__clzdi2** (`long a`)

— Runtime Function: int**__clzti2** (`long long a`)

— Runtime Function: int

— Runtime Function: int

These functions return the number of leading 0-bits in

a, starting at the most significant bit position. Ifais zero, the result is undefined.

— Runtime Function: int **__ctzsi2** (`int a`)

— Runtime Function: int**__ctzdi2** (`long a`)

— Runtime Function: int**__ctzti2** (`long long a`)

— Runtime Function: int

— Runtime Function: int

These functions return the number of trailing 0-bits in

a, starting at the least significant bit position. Ifais zero, the result is undefined.

— Runtime Function: int **__ffsdi2** (`long a`)

— Runtime Function: int**__ffsti2** (`long long a`)

— Runtime Function: int

These functions return the index of the least significant 1-bit in

a, or the value zero ifais zero. The least significant bit is index one.

— Runtime Function: int **__paritysi2** (`int a`)

— Runtime Function: int**__paritydi2** (`long a`)

— Runtime Function: int**__parityti2** (`long long a`)

— Runtime Function: int

— Runtime Function: int

These functions return the value zero if the number of bits set in

ais even, and the value one otherwise.