28.2.44 __builtin_fbcl_32

Architecture

 dsPIC33A

Description:

Finds the first bit-change from the left; skipping the sign bit.  The first bit to the right of the sign bit is numbered 0, increasing to the right.

Example:

int result;
int32_t val_1 = 2048;
int32_t val_2 = -2048;
 
result = __builtin_fbcl_32(val_1);
result = __builtin_fbcl_32(val_2);

The first bit change for 2048 == 0x0000.0800 == 0b0000.0000.0000.0000.0000.1000.0000.0000 is 19.  The first bit change for -2048 == 0xFFFF.F800 == 0b1111.1111.1111.1111.1111.1000.0000.0000 is 20.

Prototype

int __builtin_fbcl_32(int32_t x);

Arguments

x  - value to inspect

Return Value

Returns the position of the first bit change from the left, skipping the sign bit.  The value is sign-extended to int.

Machine Instruction

fbcl.l

Error Messages

None.