28.2.46 __builtin_ff1l_16
Architecture
dsPIC33A, dsPIC33C/E/F, dsPIC30
Description
Finds the first one-bit from the left. The most left bit is numbered bit 1, increasing towards the least significant bit.
Example:
int result;
int16_t val_1 = 2048;
int16_t val_2 = -2048;
result = __builtin_ff1l_16(val_1);
result = __builtin_ff1l_16(val_2);
The first one-bit for 2048 == 0x0800 == 0b0000.1000.0000.0000 is 5. The first one-bit for -2048 == 0xF800 == 0b1111.1000.0000.0000 is 1.
Prototype
int __builtin_ff1l_16(int16_t x);
Arguments
x
- value to inspect
Return Value
Returns the position of the first one-bit from the left (most-significant bit). The value is
sign-extended to an int
.
Machine Instruction
ff1l
Error Messages
None.