Low-level integer routines with gcc: Difference between revisions
(Created page with "Gcc supports low-level integer routines similar to the FORTRAN routines POPCOUNT, ISHIFT... <source lang="cpp"> long long __ashlti3 (long long a, int b ) //These functio...") |
No edit summary |
||
Line 5: | Line 5: | ||
long long __divti3 (long long a, long long b ) //These functions return the quotient of the signed division of a and b. | long long __divti3 (long long a, long long b ) //These functions return the quotient of the signed division of a and b. | ||
long long __lshrti3 (long long a, int b ) //These functions return the result of logically shifting a right by b bits. | long long __lshrti3 (long long a, int b ) //These functions return the result of logically shifting a right by b bits. | ||
int __clzti2 (long long a ) //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. | int __clzti2 (long long a ) //These functions return the number of leading 0-bits in a, starting at the most significant bit position. | ||
int __ctzti2 (long long a ) //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. | //If a is zero, the result is undefined. | ||
int __ffsti2 (long long a ) //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. | int __ctzti2 (long long a ) //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. | |||
int __ffsti2 (long long a ) //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. | |||
int __parityti2 (long long a ) //These functions return the value zero if the number of bits set in a is even, and the value one otherwise. | int __parityti2 (long long a ) //These functions return the value zero if the number of bits set in a is even, and the value one otherwise. | ||
int __popcountti2 (long long a ) //These functions return the number of bits set in a. | int __popcountti2 (long long a ) //These functions return the number of bits set in a. | ||
int64_t __bswapdi2 (int64 t a ) //These functions return the a byteswapped. | int64_t __bswapdi2 (int64 t a ) //These functions return the a byteswapped. | ||
</source> | </source> |
Revision as of 17:30, 11 April 2012
Gcc supports low-level integer routines similar to the FORTRAN routines POPCOUNT, ISHIFT... <source lang="cpp"> long long __ashlti3 (long long a, int b ) //These functions return the result of shifting a left by b bits. long long __ashrti3 (long long a, int b ) //These functions return the result of arithmetically shifting a right by b bits. long long __divti3 (long long a, long long b ) //These functions return the quotient of the signed division of a and b. long long __lshrti3 (long long a, int b ) //These functions return the result of logically shifting a right by b bits. int __clzti2 (long long a ) //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.
int __ctzti2 (long long a ) //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.
int __ffsti2 (long long a ) //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.
int __parityti2 (long long a ) //These functions return the value zero if the number of bits set in a is even, and the value one otherwise. int __popcountti2 (long long a ) //These functions return the number of bits set in a. int64_t __bswapdi2 (int64 t a ) //These functions return the a byteswapped. </source>