FFS.ih.xx-x86-gcc File Reference
Implements the X86 on GCC compiler version of the FFS routines.
More...
|
Functions |
FFS__LCL_FNC int | FFSL (unsigned int w) |
| Find first leading set bit in a 32-bit word, MSb = 0.
|
FFS__LCL_FNC int | FFSl (unsigned int w) |
| Find first leading set bit in a 32-bit word, LSb = 0.
|
FFS__LCL_FNC int | FFST (unsigned int w) |
| Find first trailing set bit in a 32-bit word, MSb = 0.
|
FFS__LCL_FNC int | FFSt (unsigned int w) |
| Find first trailing set bit in a 32-bit word, LSb = 0.
|
FFS__LCL_FNC int | CNTLZ (unsigned int w) |
| Counts the number of leading 0's in a 32 bit word.
|
FFS__LCL_FNC int | CNTTZ (unsigned int w) |
| Counts the number of trailing 0's in a 32 bit word.
|
Detailed Description
Implements the X86 on GCC compiler version of the FFS routines.
- Author:
- JJRussell - russell@slac.stanford.edu
CVS $Id: FFS.ih.xx-x86-gcc,v 1.1.1.1 2006/02/10 21:45:37 saxton Exp $
Function Documentation
FFS__LCL_FNC int CNTLZ |
( |
unsigned int |
w |
) |
|
Counts the number of leading 0's in a 32 bit word.
- Parameters:
-
| w | The 32 bit word to be examined. |
- Returns:
- The number of leading 0's in a 32 bit word.
This routine examines a 32 bit longword, returning the count of leading 0s (left (MSb) to right (LSb)) If it finds a bit it returns a value in the range 0-31. This routine is almost a synomyn for FFSL, but it is protected against 0, returning 32 if the word is 0.
References FFSL().
FFS__LCL_FNC int CNTTZ |
( |
unsigned int |
w |
) |
|
Counts the number of trailing 0's in a 32 bit word.
- Parameters:
-
| w | The 32 bit word to be examined. |
- Returns:
- The number of trailing 0's in a 32 bit word.
This routine examines a 32 bit longword, returning the count of trailing 0s (left (MSb) to right (LSb)) If it finds a bit it returns a value in the range 0-31. This routine is almost a synomyn for FFSt, but it is protected against 0, returning 32 if the word is 0.
References FFSt().
FFS__LCL_FNC int FFSl |
( |
unsigned int |
w |
) |
|
Find first leading set bit in a 32-bit word, LSb = 0.
- Parameters:
-
| w | The 32 bit word to examined from the MSb to LSb for the first set bit. |
- Returns:
- The number of the first set bit in w, where LSb = 0
This routine examines a 32 bit longword from left (MSb) to right (LSb) looking for the first bit set. If it finds a bit it returns a value in the range 0-31. The routine is not protected against 0 as an input and the result is undefined.
FFS__LCL_FNC int FFSL |
( |
unsigned int |
w |
) |
|
Find first leading set bit in a 32-bit word, MSb = 0.
- Parameters:
-
| w | The 32 bit word to examined from the MSb to LSb for the first set bit. |
- Returns:
- The number of the first set bit in w, where MSb = 0
This routine examines a 32 bit longword from left (MSb) to right (LSb) looking for the first bit set. If it finds a bit it returns a value in the range 0-31. The routine is not protected against 0 as an input and the result is undefined.
Referenced by CNTLZ(), lsu__scale(), and lsu_calc().
FFS__LCL_FNC int FFSt |
( |
unsigned int |
w |
) |
|
Find first trailing set bit in a 32-bit word, LSb = 0.
- Parameters:
-
| w | The 32 bit word to examined from the LSb to MSb for the first set bit. |
- Returns:
- The number of the first set bit in w, where LSb = 0
This routine examines a 32 bit longword from right (MSb) to left (LSb) looking for the first bit set. If it finds a bit it returns a value in the range 0-31. The routine is not protected against 0 as an input and the result is undefined.
Referenced by CNTTZ().
FFS__LCL_FNC int FFST |
( |
unsigned int |
w |
) |
|
Find first trailing set bit in a 32-bit word, MSb = 0.
- Parameters:
-
| w | The 32 bit word to examined from the LSb to MSb for the first set bit. |
- Returns:
- The number of the first set bit in w, where MSb = 0
This routine examines a 32 bit longword from right (MSb) to left (LSb) looking for the first bit set. If it finds a bit it returns a value in the range 0-31. The routine is not protected against 0 as an input and the result is undefined.