User`s guide
Inline Assembly Language and Intrinsics
Intrinsic Functions
164
Targeting MC56F83xx/DSP5685x Controllers
Normalization
The intrinsic functions of the normalization group are:
• ffs_s
• norm_s
• ffs_l
• norm_l
ffs_s
Computes the number of left shifts required to normalize a 16-bit value, returning a
16-bit result (finds 1st sign bit). Returns a shift count of 31 for an input of 0x0000.
NOTE
Does not actually normalize the value! Also see the intrinsic norm_s
which handles the case where the input == 0x0000 differently.
Prototype
Word16 ffs_s(Word16 ssrc)
Example
short s1 = 0x2000;/* .25 */
short result;
result = ffs_s(s1);
// Expected value of result: 1
norm_s
Computes the number of left shifts required to normalize a 16-bit value, returning a
16-bit result. Returns a shift count of 0 for an input of 0x0000.