Keil™, An ARM® Company

Technical Support

C166: _PRIOR_ INTRINSIC LIBRARY ROUTINE


Information in this article applies to:

  • C166 Version 4.06

QUESTION

Is there a way in C to use the PRIOR assembly instruction to normalize a value?

ANSWER

Yes. The _prior_ intrinsic library routine uses the PRIOR instruction to count the number of shifts required to normalize a number. The return value is a number from 0 to 15 which indicates how many times the number must be shifted left before the MSB is set. For example:

#include <intrins.h>

void testprior (int val)  {
  volatile int temp;

  temp = _prior_ (val);
}

MORE INFORMATION

  • Refer to _prior_ in the C166 User's Guide.

SEE ALSO

Last Reviewed: Thursday, October 20, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure