Keil Logo

C166: _PRIORD_ 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 32-bit value?

ANSWER

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

#include <intrins.h>

void testprior (long val)  {
  volatile int temp;

  temp = _priord_ (val);
}

MORE INFORMATION

  • Refer to _priord_ 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
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.