Next:Byte-Swapping Builtins, Previous:Floating-Point Format Builtins, Up:Additional Builtins for Numeric Operations [Contents][Index]
int__builtin_ffs(intx) ¶Returns one plus the index of the least significant 1-bit ofx, orifx is zero, returns zero.
int__builtin_clz(unsigned intx) ¶Returns the number of leading 0-bits inx, starting at the mostsignificant bit position. Ifx is 0, the result is undefined.
int__builtin_ctz(unsigned intx) ¶Returns the number of trailing 0-bits inx, starting at the leastsignificant bit position. Ifx is 0, the result is undefined.
int__builtin_clrsb(intx) ¶Returns the number of leading redundant sign bits inx, i.e. thenumber of bits following the most significant bit that are identicalto it. There are no special cases for 0 or other values.
int__builtin_popcount(unsigned intx) ¶Returns the number of 1-bits inx.
int__builtin_parity(unsigned intx) ¶Returns the parity ofx, i.e. the number of 1-bits inxmodulo 2.
int__builtin_ffsl(long) ¶Similar to__builtin_ffs, except the argument type islong.
int__builtin_clzl(unsigned long) ¶Similar to__builtin_clz, except the argument type isunsigned long.
int__builtin_ctzl(unsigned long) ¶Similar to__builtin_ctz, except the argument type isunsigned long.
int__builtin_clrsbl(long) ¶Similar to__builtin_clrsb, except the argument type islong.
int__builtin_popcountl(unsigned long) ¶Similar to__builtin_popcount, except the argument type isunsigned long.
int__builtin_parityl(unsigned long) ¶Similar to__builtin_parity, except the argument type isunsigned long.
int__builtin_ffsll(long long) ¶Similar to__builtin_ffs, except the argument type islong long.
int__builtin_clzll(unsigned long long) ¶Similar to__builtin_clz, except the argument type isunsigned long long.
int__builtin_ctzll(unsigned long long) ¶Similar to__builtin_ctz, except the argument type isunsigned long long.
int__builtin_clrsbll(long long) ¶Similar to__builtin_clrsb, except the argument type islong long.
int__builtin_popcountll(unsigned long long) ¶Similar to__builtin_popcount, except the argument type isunsigned long long.
int__builtin_parityll(unsigned long long) ¶Similar to__builtin_parity, except the argument type isunsigned long long.
int__builtin_ffsg(...) ¶Similar to__builtin_ffs, except the argument is type-genericsigned integer (standard, extended or bit-precise). No integral argumentpromotions are performed on the argument.
int__builtin_clzg(...) ¶Similar to__builtin_clz, except the argument is type-genericunsigned integer (standard, extended or bit-precise) and there isoptional second argument with int type. No integral argument promotionsare performed on the first argument. If two arguments are specified,and first argument is 0, the result is the second argument. If onlyone argument is specified and it is 0, the result is undefined.
int__builtin_ctzg(...) ¶Similar to__builtin_ctz, except the argument is type-genericunsigned integer (standard, extended or bit-precise) and there isoptional second argument with int type. No integral argument promotionsare performed on the first argument. If two arguments are specified,and first argument is 0, the result is the second argument. If onlyone argument is specified and it is 0, the result is undefined.
int__builtin_clrsbg(...) ¶Similar to__builtin_clrsb, except the argument is type-genericsigned integer (standard, extended or bit-precise). No integral argumentpromotions are performed on the argument.
int__builtin_popcountg(...) ¶Similar to__builtin_popcount, except the argument is type-genericunsigned integer (standard, extended or bit-precise). No integral argumentpromotions are performed on the argument.
int__builtin_parityg(...) ¶Similar to__builtin_parity, except the argument is type-genericunsigned integer (standard, extended or bit-precise). No integral argumentpromotions are performed on the argument.
type__builtin_stdc_bit_ceil(typearg) ¶The__builtin_stdc_bit_ceil function is available onlyin C. It is type-generic, the argument can be any unsigned integer(standard, extended or bit-precise). No integral argument promotions areperformed on the argument. It is equivalent toarg <= 1 ? (type) 1: (type) 2 << (prec - 1 - __builtin_clzg ((type) (arg - 1)))whereprec is bit width oftype, except that side-effectsinarg are evaluated just once.
type__builtin_stdc_bit_floor(typearg) ¶The__builtin_stdc_bit_floor function is available onlyin C. It is type-generic, the argument can be any unsigned integer(standard, extended or bit-precise). No integral argument promotions areperformed on the argument. It is equivalent toarg == 0 ? (type) 0: (type) 1 << (prec - 1 - __builtin_clzg (arg))whereprec is bit width oftype, except that side-effectsinarg are evaluated just once.
unsigned int__builtin_stdc_bit_width(typearg) ¶The__builtin_stdc_bit_width function is available onlyin C. It is type-generic, the argument can be any unsigned integer(standard, extended or bit-precise). No integral argument promotions areperformed on the argument. It is equivalent to(unsigned int) (prec - __builtin_clzg (arg,prec))whereprec is bit width oftype.
unsigned int__builtin_stdc_count_ones(typearg) ¶The__builtin_stdc_count_ones function is available onlyin C. It is type-generic, the argument can be any unsigned integer(standard, extended or bit-precise). No integral argument promotions areperformed on the argument. It is equivalent to(unsigned int) __builtin_popcountg (arg)
unsigned int__builtin_stdc_count_zeros(typearg) ¶The__builtin_stdc_count_zeros function is available onlyin C. It is type-generic, the argument can be any unsigned integer(standard, extended or bit-precise). No integral argument promotions areperformed on the argument. It is equivalent to(unsigned int) __builtin_popcountg ((type) ~arg)
unsigned int__builtin_stdc_first_leading_one(typearg) ¶The__builtin_stdc_first_leading_one function is available onlyin C. It is type-generic, the argument can be any unsigned integer(standard, extended or bit-precise). No integral argument promotions areperformed on the argument. It is equivalent to__builtin_clzg (arg, -1) + 1U
unsigned int__builtin_stdc_first_leading_zero(typearg) ¶The__builtin_stdc_first_leading_zero function is available onlyin C. It is type-generic, the argument can be any unsigned integer(standard, extended or bit-precise). No integral argument promotions areperformed on the argument. It is equivalent to__builtin_clzg ((type) ~arg, -1) + 1U
unsigned int__builtin_stdc_first_trailing_one(typearg) ¶The__builtin_stdc_first_trailing_one function is available onlyin C. It is type-generic, the argument can be any unsigned integer(standard, extended or bit-precise). No integral argument promotions areperformed on the argument. It is equivalent to__builtin_ctzg (arg, -1) + 1U
unsigned int__builtin_stdc_first_trailing_zero(typearg) ¶The__builtin_stdc_first_trailing_zero function is available onlyin C. It is type-generic, the argument can be any unsigned integer(standard, extended or bit-precise). No integral argument promotions areperformed on the argument. It is equivalent to__builtin_ctzg ((type) ~arg, -1) + 1U
unsigned int__builtin_stdc_has_single_bit(typearg) ¶The__builtin_stdc_has_single_bit function is available onlyin C. It is type-generic, the argument can be any unsigned integer(standard, extended or bit-precise). No integral argument promotions areperformed on the argument. It is equivalent to(_Bool) (__builtin_popcountg (arg) == 1)
unsigned int__builtin_stdc_leading_ones(typearg) ¶The__builtin_stdc_leading_ones function is available onlyin C. It is type-generic, the argument can be any unsigned integer(standard, extended or bit-precise). No integral argument promotions areperformed on the argument. It is equivalent to(unsigned int) __builtin_clzg ((type) ~arg,prec)
unsigned int__builtin_stdc_leading_zeros(typearg) ¶The__builtin_stdc_leading_zeros function is available onlyin C. It is type-generic, the argument can be any unsigned integer(standard, extended or bit-precise). No integral argument promotions areperformed on the argument. It is equivalent to(unsigned int) __builtin_clzg (arg,prec)
unsigned int__builtin_stdc_trailing_ones(typearg) ¶The__builtin_stdc_trailing_ones function is available onlyin C. It is type-generic, the argument can be any unsigned integer(standard, extended or bit-precise). No integral argument promotions areperformed on the argument. It is equivalent to(unsigned int) __builtin_ctzg ((type) ~arg,prec)
unsigned int__builtin_stdc_trailing_zeros(typearg) ¶The__builtin_stdc_trailing_zeros function is available onlyin C. It is type-generic, the argument can be any unsigned integer(standard, extended or bit-precise). No integral argument promotions areperformed on the argument. It is equivalent to(unsigned int) __builtin_ctzg (arg,prec)
type1__builtin_stdc_rotate_left(type1arg1,type2arg2) ¶The__builtin_stdc_rotate_left function is available onlyin C. It is type-generic, the first argument can be any unsigned integer(standard, extended or bit-precise) and second argument any signed orunsigned integer orchar. No integral argument promotions areperformed on the arguments. It is equivalent to(type1) ((arg1 << (arg2 %prec))| (arg1 >> ((-(unsignedtype2)arg2) %prec)))whereprec is bit width oftype1, except that side-effectsinarg1 andarg2 are evaluated just once. The behavior isundefined ifarg2 is negative.
type1__builtin_stdc_rotate_right(type1arg1,type2arg2) ¶The__builtin_stdc_rotate_right function is available onlyin C. It is type-generic, the first argument can be any unsigned integer(standard, extended or bit-precise) and second argument any signed orunsigned integer orchar. No integral argument promotions areperformed on the arguments. It is equivalent to(type1) ((arg1 >> (arg2 %prec))| (arg1 << ((-(unsignedtype2)arg2) %prec)))whereprec is bit width oftype1, except that side-effectsinarg1 andarg2 are evaluated just once. The behavior isundefined ifarg2 is negative.
Next:Byte-Swapping Builtins, Previous:Floating-Point Format Builtins, Up:Additional Builtins for Numeric Operations [Contents][Index]