[][src]Trait bitintr::Cls

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](http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc. ddi0487a.k_10775/index.html):
    • 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);
Loading content...

Implementors

impl Cls for i8[src]

impl Cls for i16[src]

impl Cls for i32[src]

impl Cls for i64[src]

impl Cls for u8[src]

impl Cls for u16[src]

impl Cls for u32[src]

impl Cls for u64[src]

Loading content...