#[non_exhaustive]pub enum ImmRange {
None,
I8,
U8,
I16,
I32,
I64,
}Expand description
The values an immediate operand may take.
Immediates are signed values of the operation’s width, as isa-lang takes
them (TARGET-DESC §3.1): for a 32-bit operation, all ones is -1.
§Examples
use backend_lang::target::ImmRange;
assert!(ImmRange::I8.fits(-128));
assert!(!ImmRange::I8.fits(128));
assert!(ImmRange::U8.fits(255));
assert!(!ImmRange::None.fits(0));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
None
No immediate is accepted.
I8
-128..=127.
U8
0..=255.
I16
-32768..=32767.
I32
-2^31..=2^31-1.
I64
Any 64-bit value.
Implementations§
Trait Implementations§
impl Copy for ImmRange
impl Eq for ImmRange
impl StructuralPartialEq for ImmRange
Auto Trait Implementations§
impl Freeze for ImmRange
impl RefUnwindSafe for ImmRange
impl Send for ImmRange
impl Sync for ImmRange
impl Unpin for ImmRange
impl UnsafeUnpin for ImmRange
impl UnwindSafe for ImmRange
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more