GNU Compiler Collection (GCC) Internals: Integer library routines |
---|
Next: Soft float library routines, Up: Libgcc [Contents][Index]
The integer arithmetic routines are used on platforms that don’t provide hardware support for arithmetic operations on some modes.
These functions return the result of shifting a left by b bits.
These functions return the result of arithmetically shifting a right by b bits.
These functions return the quotient of the signed division of a and b.
These functions return the result of logically shifting a right by b bits.
These functions return the remainder of the signed division of a and b.
These functions return the product of a and b.
These functions return the negation of a.
These functions return the quotient of the unsigned division of a and b.
These functions calculate both the quotient and remainder of the unsigned division of a and b. The return value is the quotient, and the remainder is placed in variable pointed to by c.
These functions return the remainder of the unsigned division of a and b.
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.
These functions perform a signed comparison of a and b. If a is less than b, they return 0; if a is greater than b, they return 2; and if a and b are equal they return 1.
These functions perform an unsigned comparison of a and b. If a is less than b, they return 0; if a is greater than b, they return 2; and if a and b are equal they return 1.
The following functions implement trapping arithmetic. These functions
call the libc function abort
upon signed arithmetic overflow.
These functions return the absolute value of a.
These functions return the sum of a and b; that is
a + b
.
The functions return the product of a and b; that is
a * b
.
These functions return the negation of a; that is -a
.
These functions return the difference between b and a;
that is
a - b
.
These functions return the number of leading 0-bits in a, starting at the most significant bit position. If a is zero, the result is undefined.
These functions return the number of trailing 0-bits in a, starting at the least significant bit position. If a is zero, the result is undefined.
These functions return the index of the least significant 1-bit in a, or the value zero if a is zero. The least significant bit is index one.
These functions return the value zero if the number of bits set in a is even, and the value one otherwise.
These functions return the number of bits set in a.
These functions return the a byteswapped.
Next: Soft float library routines, Up: Libgcc [Contents][Index]