Trait bitintr::Cls
[−]
[src]
pub trait Cls { fn cls(self) -> Self; }
Count leading sign bits
Required Methods
fn cls(self) -> Self
Counts the leading most significant bits set.
When all bits of the operand are set it returns the size of the operand in bits.
Keywords: count leading sign bits, count leading ones, count leading bits set.
Instructions
CLS
:- Description: Count leading sign bits.
- Architecture: ARMv8.
- Registers: 32/64 bits.
Example
let n = 0b1111_1111_1100_1010_u16; assert_eq!(n.cls(), 9); assert_eq!(0b1111_1111_u8.cls(), 7);
Implementors
impl Cls for u8
impl Cls for i8
impl Cls for u16
impl Cls for i16
impl Cls for u32
impl Cls for i32
impl Cls for u64
impl Cls for i64