Trait isla_lib::bitvector::BV [−][src]
This trait allows us to be generic over the representation of concrete bitvectors. Specific users of isla-lib may then choose different representations depending on use case - B64 will likely be the most efficient for ordinary use, but B129 can represent CHERI compressed capabilities concretely.
Associated Constants
const BIT_ONE: Self
[src]
const BIT_ZERO: Self
[src]
const MAX_WIDTH: u32
[src]
In Isla concrete bitvectors are only represented up to a
specific maximum width/length. Beyond this they will be
promoted to symbolic variables which are equal to a concrete
value represented in the SMT solver. This makes computation
over concrete bitvectors below this max width very efficient,
as they can be represented as simple Copy types like u64
.
Required methods
fn new(value: u64, len: u32) -> Self
[src]
fn len(self) -> u32
[src]
fn lower_u64(self) -> u64
[src]
fn lower_u8(self) -> u8
[src]
fn is_zero(self) -> bool
[src]
fn zeros(len: u32) -> Self
[src]
fn ones(len: u32) -> Self
[src]
fn leading_zeros(self) -> u32
[src]
fn from_u8(value: u8) -> Self
[src]
fn from_u16(value: u16) -> Self
[src]
fn from_u32(value: u32) -> Self
[src]
fn from_u64(value: u64) -> Self
[src]
fn from_bytes(bytes: &[u8]) -> Self
[src]
Byte order is: from_bytes(&[0xAB, 0xCD, 0xEF] == 0xABCDEF
Panics
bytes.len() * 8 must be less than or equal to MAX_WIDTH
fn to_le_bytes(self) -> Vec<u8>ⓘ
[src]
fn to_be_bytes(self) -> Vec<u8>ⓘ
[src]
fn from_str(bv: &str) -> Option<Self>
[src]
Parses a bitvector from a string slice. String must be
prefixed by either #x/0x, or #b/0b (allowing both SMT style
and Sail/C style prefixes) for hexadecimal or binary. Returns
None
if the string is not parseable for any reason
fn add_i128(self, op: i128) -> Self
[src]
fn zero_extend(self, new_len: u32) -> Self
[src]
zero_extend a bitvector to a specific new length.
Panics
new_len
must be greater than the current length, but less
than MAX_WIDTH
.
fn sign_extend(self, new_len: u32) -> Self
[src]
sign_extend a bitvector to a specific new length. Sign
extending a zero-length bitvector creates a new_len
sized
bitvector containing only zeros.
Panics
new_len
must be greater than the current length, but less
than MAX_WIDTH
.