Trait wasmi_core::Integer

source ·
pub trait Integer<T>: ArithmeticOps<T> {
    // Required methods
    fn leading_zeros(self) -> T;
    fn trailing_zeros(self) -> T;
    fn count_ones(self) -> T;
    fn rotl(self, other: T) -> T;
    fn rotr(self, other: T) -> T;
    fn rem(self, other: T) -> Result<T, TrapCode>;
}
Expand description

Integer value.

Required Methods§

source

fn leading_zeros(self) -> T

Counts leading zeros in the bitwise representation of the value.

source

fn trailing_zeros(self) -> T

Counts trailing zeros in the bitwise representation of the value.

source

fn count_ones(self) -> T

Counts 1-bits in the bitwise representation of the value.

source

fn rotl(self, other: T) -> T

Get left bit rotation result.

source

fn rotr(self, other: T) -> T

Get right bit rotation result.

source

fn rem(self, other: T) -> Result<T, TrapCode>

Get division remainder.

Implementations on Foreign Types§

source§

impl Integer<u64> for u64

source§

fn leading_zeros(self) -> u64

source§

fn trailing_zeros(self) -> u64

source§

fn count_ones(self) -> u64

source§

fn rotl(self, other: u64) -> u64

source§

fn rotr(self, other: u64) -> u64

source§

fn rem(self, other: u64) -> Result<u64, TrapCode>

source§

impl Integer<u32> for u32

source§

fn leading_zeros(self) -> u32

source§

fn trailing_zeros(self) -> u32

source§

fn count_ones(self) -> u32

source§

fn rotl(self, other: u32) -> u32

source§

fn rotr(self, other: u32) -> u32

source§

fn rem(self, other: u32) -> Result<u32, TrapCode>

source§

impl Integer<i64> for i64

source§

fn leading_zeros(self) -> i64

source§

fn trailing_zeros(self) -> i64

source§

fn count_ones(self) -> i64

source§

fn rotl(self, other: i64) -> i64

source§

fn rotr(self, other: i64) -> i64

source§

fn rem(self, other: i64) -> Result<i64, TrapCode>

source§

impl Integer<i32> for i32

source§

fn leading_zeros(self) -> i32

source§

fn trailing_zeros(self) -> i32

source§

fn count_ones(self) -> i32

source§

fn rotl(self, other: i32) -> i32

source§

fn rotr(self, other: i32) -> i32

source§

fn rem(self, other: i32) -> Result<i32, TrapCode>

Implementors§