User`s guide
Inline Assembly Language and Intrinsics
Intrinsic Functions
165Targeting MC56F83xx/DSP5685x Controllers
NOTE Does not actually normalize the value! This operation is not optimal
on the DSP56800E because of the case of returning 0 for an input of
0x0000. See the intrinsic ffs_s
which is more optimal but generates a
different value for the case where the input == 0x0000.
Prototype
Word16 norm_s(Word16 ssrc)
Example
short s1 = 0x2000;/* .25 */
short result;
result = norm_s(s1);
// Expected value of result: 1
ffs_l
Computes the number of left shifts required to normalize a 32-bit value, returning a
16-bit result (finds 1st sign bit). Returns a shift count of 31 for an input of
0x00000000.
NOTE
Does not actually normalize the value! Also, see the intrinsic norm_l
which handles the case where the input == 0x00000000 differently.
Prototype
Word16 ffs_l(Word32 lsrc)