bitfield operations

(deleted)

I assume you are talking C/C++. You could easily construct macros or functions to return a value like bfffo would but there are no built-in operators or library functions that I know of that would do that.

No BFFFO indeed.

you have basic Bits and Bytes macros:

bit() ;
bitClear() ;
bitRead() ;
bitSet() ;
bitWrite() ; 
highByte() ;
lowByte() ;

You can also use the __builtin_xxx functions of GCC:

Built-in Function: int __builtin_ffs (int x)
Returns one plus the index of the least significant 1-bit of x, or if x is zero, returns zero.

Built-in Function: int __builtin_clz (unsigned int x)
Returns the number of leading 0-bits in x, starting at the most significant bit position. If x is 0, the result is undefined.

Built-in Function: int __builtin_ctz (unsigned int x)
Returns the number of trailing 0-bits in x, starting at the least significant bit position. If x is 0, the result is undefined.

Built-in Function: int __builtin_clrsb (int x)
Returns the number of leading redundant sign bits in x, i.e. the number of bits following the most significant bit that are identical to it. There are no special cases for 0 or other values.

Built-in Function: int __builtin_popcount (unsigned int x)
Returns the number of 1-bits in x.

Built-in Function: int __builtin_parity (unsigned int x)
Returns the parity of x, i.e. the number of 1-bits in x modulo 2.