InstructionValue

Struct InstructionValue 

Source
#[repr(transparent)]
pub struct InstructionValue { pub value: u32, }
Expand description

InstructionValue contains the 32-bit instruction value and also provides access into the desired field.

Fields§

§value: u32

Implementations§

Source§

impl InstructionValue

Source

pub const fn new(value: u32) -> Self

Source

pub const fn field<const FIELD_START: usize, const FIELD_SIZE: usize>( self, ) -> u32

Source

pub const fn rd(self) -> u32

Source

pub const fn set_rd(self, value: u32) -> Self

Source

pub const fn rt(self) -> u32

Source

pub const fn set_rt(self, value: u32) -> Self

Source

pub const fn rs1(self) -> u32

Source

pub const fn set_rs1(self, value: u32) -> Self

Source

pub const fn rs2(self) -> u32

Source

pub const fn set_rs2(self, value: u32) -> Self

Source

pub const fn rs3(self) -> u32

Source

pub const fn set_rs3(self, value: u32) -> Self

Source

pub const fn aqrl(self) -> u32

Source

pub const fn set_aqrl(self, value: u32) -> Self

Source

pub const fn aq(self) -> u32

Source

pub const fn set_aq(self, value: u32) -> Self

Source

pub const fn rl(self) -> u32

Source

pub const fn set_rl(self, value: u32) -> Self

Source

pub const fn fm(self) -> u32

Source

pub const fn set_fm(self, value: u32) -> Self

Source

pub const fn pred(self) -> u32

Source

pub const fn set_pred(self, value: u32) -> Self

Source

pub const fn succ(self) -> u32

Source

pub const fn set_succ(self, value: u32) -> Self

Source

pub const fn rm(self) -> u32

Source

pub const fn set_rm(self, value: u32) -> Self

Source

pub const fn funct3(self) -> u32

Source

pub const fn set_funct3(self, value: u32) -> Self

Source

pub const fn funct2(self) -> u32

Source

pub const fn set_funct2(self, value: u32) -> Self

Source

pub const fn imm20_raw(self) -> u32

Source

pub const fn set_imm20_raw(self, value: u32) -> Self

Source

pub const fn jimm20_raw(self) -> u32

Source

pub const fn set_jimm20_raw(self, value: u32) -> Self

Source

pub const fn imm12_raw(self) -> u32

Source

pub const fn set_imm12_raw(self, value: u32) -> Self

Source

pub const fn csr(self) -> u32

Source

pub const fn set_csr(self, value: u32) -> Self

Source

pub const fn imm12hi_raw(self) -> u32

Source

pub const fn set_imm12hi_raw(self, value: u32) -> Self

Source

pub const fn bimm12hi_raw(self) -> u32

Source

pub const fn set_bimm12hi_raw(self, value: u32) -> Self

Source

pub const fn imm12lo_raw(self) -> u32

Source

pub const fn set_imm12lo_raw(self, value: u32) -> Self

Source

pub const fn bimm12lo_raw(self) -> u32

Source

pub const fn set_bimm12lo_raw(self, value: u32) -> Self

Source

pub const fn shamtq(self) -> u32

Source

pub const fn set_shamtq(self, value: u32) -> Self

Source

pub const fn shamtw(self) -> u32

Source

pub const fn set_shamtw(self, value: u32) -> Self

Source

pub const fn shamtw4(self) -> u32

Source

pub const fn set_shamtw4(self, value: u32) -> Self

Source

pub const fn shamtd(self) -> u32

Source

pub const fn set_shamtd(self, value: u32) -> Self

Source

pub const fn bs(self) -> u32

Source

pub const fn set_bs(self, value: u32) -> Self

Source

pub const fn rnum(self) -> u32

Source

pub const fn set_rnum(self, value: u32) -> Self

Source

pub const fn rc(self) -> u32

Source

pub const fn set_rc(self, value: u32) -> Self

Source

pub const fn imm2_raw(self) -> u32

Source

pub const fn set_imm2_raw(self, value: u32) -> Self

Source

pub const fn imm3_raw(self) -> u32

Source

pub const fn set_imm3_raw(self, value: u32) -> Self

Source

pub const fn imm4_raw(self) -> u32

Source

pub const fn set_imm4_raw(self, value: u32) -> Self

Source

pub const fn imm5_raw(self) -> u32

Source

pub const fn set_imm5_raw(self, value: u32) -> Self

Source

pub const fn imm6_raw(self) -> u32

Source

pub const fn set_imm6_raw(self, value: u32) -> Self

Source

pub const fn zimm_raw(self) -> u32

Source

pub const fn set_zimm_raw(self, value: u32) -> Self

Source

pub const fn opcode(self) -> u32

Source

pub const fn set_opcode(self, value: u32) -> Self

Source

pub const fn funct7(self) -> u32

Source

pub const fn set_funct7(self, value: u32) -> Self

Source

pub const fn vd(self) -> u32

Source

pub const fn set_vd(self, value: u32) -> Self

Source

pub const fn vs3(self) -> u32

Source

pub const fn set_vs3(self, value: u32) -> Self

Source

pub const fn vs1(self) -> u32

Source

pub const fn set_vs1(self, value: u32) -> Self

Source

pub const fn vs2(self) -> u32

Source

pub const fn set_vs2(self, value: u32) -> Self

Source

pub const fn vm(self) -> u32

Source

pub const fn set_vm(self, value: u32) -> Self

Source

pub const fn wd(self) -> u32

Source

pub const fn set_wd(self, value: u32) -> Self

Source

pub const fn amoop(self) -> u32

Source

pub const fn set_amoop(self, value: u32) -> Self

Source

pub const fn nf(self) -> u32

Source

pub const fn set_nf(self, value: u32) -> Self

Source

pub const fn simm5_raw(self) -> u32

Source

pub const fn set_simm5_raw(self, value: u32) -> Self

Source

pub const fn zimm5_raw(self) -> u32

Source

pub const fn set_zimm5_raw(self, value: u32) -> Self

Source

pub const fn zimm10_raw(self) -> u32

Source

pub const fn set_zimm10_raw(self, value: u32) -> Self

Source

pub const fn zimm11_raw(self) -> u32

Source

pub const fn set_zimm11_raw(self, value: u32) -> Self

Source

pub const fn zimm6hi_raw(self) -> u32

Source

pub const fn set_zimm6hi_raw(self, value: u32) -> Self

Source

pub const fn zimm6lo_raw(self) -> u32

Source

pub const fn set_zimm6lo_raw(self, value: u32) -> Self

Source

pub const fn c_nzuimm10_raw(self) -> u32

Source

pub const fn set_c_nzuimm10_raw(self, value: u32) -> Self

Source

pub const fn c_uimm7lo_raw(self) -> u32

Source

pub const fn set_c_uimm7lo_raw(self, value: u32) -> Self

Source

pub const fn c_uimm7hi_raw(self) -> u32

Source

pub const fn set_c_uimm7hi_raw(self, value: u32) -> Self

Source

pub const fn c_uimm8lo_raw(self) -> u32

Source

pub const fn set_c_uimm8lo_raw(self, value: u32) -> Self

Source

pub const fn c_uimm8hi_raw(self) -> u32

Source

pub const fn set_c_uimm8hi_raw(self, value: u32) -> Self

Source

pub const fn c_uimm9lo_raw(self) -> u32

Source

pub const fn set_c_uimm9lo_raw(self, value: u32) -> Self

Source

pub const fn c_uimm9hi_raw(self) -> u32

Source

pub const fn set_c_uimm9hi_raw(self, value: u32) -> Self

Source

pub const fn c_nzimm6lo_raw(self) -> u32

Source

pub const fn set_c_nzimm6lo_raw(self, value: u32) -> Self

Source

pub const fn c_nzimm6hi_raw(self) -> u32

Source

pub const fn set_c_nzimm6hi_raw(self, value: u32) -> Self

Source

pub const fn c_imm6lo_raw(self) -> u32

Source

pub const fn set_c_imm6lo_raw(self, value: u32) -> Self

Source

pub const fn c_imm6hi_raw(self) -> u32

Source

pub const fn set_c_imm6hi_raw(self, value: u32) -> Self

Source

pub const fn c_nzimm10hi_raw(self) -> u32

Source

pub const fn set_c_nzimm10hi_raw(self, value: u32) -> Self

Source

pub const fn c_nzimm10lo_raw(self) -> u32

Source

pub const fn set_c_nzimm10lo_raw(self, value: u32) -> Self

Source

pub const fn c_nzimm18hi_raw(self) -> u32

Source

pub const fn set_c_nzimm18hi_raw(self, value: u32) -> Self

Source

pub const fn c_nzimm18lo_raw(self) -> u32

Source

pub const fn set_c_nzimm18lo_raw(self, value: u32) -> Self

Source

pub const fn c_imm12_raw(self) -> u32

Source

pub const fn set_c_imm12_raw(self, value: u32) -> Self

Source

pub const fn c_bimm9lo_raw(self) -> u32

Source

pub const fn set_c_bimm9lo_raw(self, value: u32) -> Self

Source

pub const fn c_bimm9hi_raw(self) -> u32

Source

pub const fn set_c_bimm9hi_raw(self, value: u32) -> Self

Source

pub const fn c_nzuimm5_raw(self) -> u32

Source

pub const fn set_c_nzuimm5_raw(self, value: u32) -> Self

Source

pub const fn c_nzuimm6lo_raw(self) -> u32

Source

pub const fn set_c_nzuimm6lo_raw(self, value: u32) -> Self

Source

pub const fn c_nzuimm6hi_raw(self) -> u32

Source

pub const fn set_c_nzuimm6hi_raw(self, value: u32) -> Self

Source

pub const fn c_uimm8splo_raw(self) -> u32

Source

pub const fn set_c_uimm8splo_raw(self, value: u32) -> Self

Source

pub const fn c_uimm8sphi_raw(self) -> u32

Source

pub const fn set_c_uimm8sphi_raw(self, value: u32) -> Self

Source

pub const fn c_uimm8sp_s_raw(self) -> u32

Source

pub const fn set_c_uimm8sp_s_raw(self, value: u32) -> Self

Source

pub const fn c_uimm10splo_raw(self) -> u32

Source

pub const fn set_c_uimm10splo_raw(self, value: u32) -> Self

Source

pub const fn c_uimm10sphi_raw(self) -> u32

Source

pub const fn set_c_uimm10sphi_raw(self, value: u32) -> Self

Source

pub const fn c_uimm9splo_raw(self) -> u32

Source

pub const fn set_c_uimm9splo_raw(self, value: u32) -> Self

Source

pub const fn c_uimm9sphi_raw(self) -> u32

Source

pub const fn set_c_uimm9sphi_raw(self, value: u32) -> Self

Source

pub const fn c_uimm10sp_s_raw(self) -> u32

Source

pub const fn set_c_uimm10sp_s_raw(self, value: u32) -> Self

Source

pub const fn c_uimm9sp_s_raw(self) -> u32

Source

pub const fn set_c_uimm9sp_s_raw(self, value: u32) -> Self

Source

pub const fn c_uimm2_raw(self) -> u32

Source

pub const fn set_c_uimm2_raw(self, value: u32) -> Self

Source

pub const fn c_uimm1_raw(self) -> u32

Source

pub const fn set_c_uimm1_raw(self, value: u32) -> Self

Source

pub const fn c_rlist(self) -> u32

Source

pub const fn set_c_rlist(self, value: u32) -> Self

Source

pub const fn c_spimm_raw(self) -> u32

Source

pub const fn set_c_spimm_raw(self, value: u32) -> Self

Source

pub const fn c_index(self) -> u32

Source

pub const fn set_c_index(self, value: u32) -> Self

Source

pub const fn rs1_p(self) -> u32

Source

pub const fn set_rs1_p(self, value: u32) -> Self

Source

pub const fn rs2_p(self) -> u32

Source

pub const fn set_rs2_p(self, value: u32) -> Self

Source

pub const fn rd_p(self) -> u32

Source

pub const fn set_rd_p(self, value: u32) -> Self

Source

pub const fn rd_rs1_n0(self) -> u32

Source

pub const fn set_rd_rs1_n0(self, value: u32) -> Self

Source

pub const fn rd_rs1_p(self) -> u32

Source

pub const fn set_rd_rs1_p(self, value: u32) -> Self

Source

pub const fn rd_rs1(self) -> u32

Source

pub const fn set_rd_rs1(self, value: u32) -> Self

Source

pub const fn rd_n2(self) -> u32

Source

pub const fn set_rd_n2(self, value: u32) -> Self

Source

pub const fn rd_n0(self) -> u32

Source

pub const fn set_rd_n0(self, value: u32) -> Self

Source

pub const fn rs1_n0(self) -> u32

Source

pub const fn set_rs1_n0(self, value: u32) -> Self

Source

pub const fn c_rs2_n0(self) -> u32

Source

pub const fn set_c_rs2_n0(self, value: u32) -> Self

Source

pub const fn c_rs1_n0(self) -> u32

Source

pub const fn set_c_rs1_n0(self, value: u32) -> Self

Source

pub const fn c_rs2(self) -> u32

Source

pub const fn set_c_rs2(self, value: u32) -> Self

Source

pub const fn c_sreg1(self) -> u32

Source

pub const fn set_c_sreg1(self, value: u32) -> Self

Source

pub const fn c_sreg2(self) -> u32

Source

pub const fn set_c_sreg2(self, value: u32) -> Self

Source

pub const fn mop_r_t_30(self) -> u32

Source

pub const fn set_mop_r_t_30(self, value: u32) -> Self

Source

pub const fn mop_r_t_27_26(self) -> u32

Source

pub const fn set_mop_r_t_27_26(self, value: u32) -> Self

Source

pub const fn mop_r_t_21_20(self) -> u32

Source

pub const fn set_mop_r_t_21_20(self, value: u32) -> Self

Source

pub const fn mop_rr_t_30(self) -> u32

Source

pub const fn set_mop_rr_t_30(self, value: u32) -> Self

Source

pub const fn mop_rr_t_27_26(self) -> u32

Source

pub const fn set_mop_rr_t_27_26(self, value: u32) -> Self

Source

pub const fn c_mop_t(self) -> u32

Source

pub const fn set_c_mop_t(self, value: u32) -> Self

Source

pub const fn rs2_eq_rs1(self) -> u32

Source

pub const fn set_rs2_eq_rs1(self, value: u32) -> Self

Source

pub const fn imm20(self) -> i32

imm20

Source

pub const fn set_imm20(self, imm20: i32) -> Self

Source

pub const fn jimm20(self) -> i32

jimm20

Source

pub const fn set_jimm20(self, jimm20: i32) -> Self

Source

pub const fn imm12(self) -> i32

imm12

Source

pub const fn set_imm12(self, imm12: i32) -> Self

Source

pub const fn imm12lohi(self) -> i32

imm12lohi

Source

pub const fn set_imm12lohi(self, imm12lohi: i32) -> Self

Source

pub const fn bimm12lohi(self) -> i32

bimm12lohi

Source

pub const fn set_bimm12lohi(self, bimm12lohi: i32) -> Self

Source

pub const fn imm2(self) -> i32

imm2

Source

pub const fn set_imm2(self, imm2: i32) -> Self

Source

pub const fn imm3(self) -> i32

imm3

Source

pub const fn set_imm3(self, imm3: i32) -> Self

Source

pub const fn imm4(self) -> i32

imm4

Source

pub const fn set_imm4(self, imm4: i32) -> Self

Source

pub const fn imm5(self) -> i32

imm5

Source

pub const fn set_imm5(self, imm5: i32) -> Self

Source

pub const fn imm6(self) -> i32

imm6

Source

pub const fn set_imm6(self, imm6: i32) -> Self

Source

pub const fn zimm(self) -> i32

zimm

Source

pub const fn set_zimm(self, zimm: i32) -> Self

Source

pub const fn simm5(self) -> i32

simm5

Source

pub const fn set_simm5(self, simm5: i32) -> Self

Source

pub const fn zimm5(self) -> i32

zimm5

Source

pub const fn set_zimm5(self, zimm5: i32) -> Self

Source

pub const fn zimm10(self) -> i32

zimm10

Source

pub const fn set_zimm10(self, zimm10: i32) -> Self

Source

pub const fn zimm11(self) -> i32

zimm11

Source

pub const fn set_zimm11(self, zimm11: i32) -> Self

Source

pub const fn zimm6lohi(self) -> i32

zimm6lohi

Source

pub const fn set_zimm6lohi(self, zimm6lohi: i32) -> Self

Source

pub const fn c_nzuimm10(self) -> u32

c_nzuimm10

Source

pub const fn set_c_nzuimm10(self, c_nzuimm10: u32) -> Self

Source

pub const fn c_uimm7lohi(self) -> u32

c_uimm7lohi

Source

pub const fn set_c_uimm7lohi(self, c_uimm7lohi: u32) -> Self

Source

pub const fn c_uimm8lohi(self) -> u32

c_uimm8lohi

Source

pub const fn set_c_uimm8lohi(self, c_uimm8lohi: u32) -> Self

Source

pub const fn c_uimm9lohi(self) -> u32

c_uimm9lohi

Source

pub const fn set_c_uimm9lohi(self, c_uimm9lohi: u32) -> Self

Source

pub const fn c_nzimm6lohi(self) -> i32

c_nzimm6lohi

Source

pub const fn set_c_nzimm6lohi(self, c_nzimm6lohi: i32) -> Self

Source

pub const fn c_imm6lohi(self) -> i32

c_imm6lohi

Source

pub const fn set_c_imm6lohi(self, c_imm6lohi: i32) -> Self

Source

pub const fn c_nzimm10lohi(self) -> i32

c_nzimm10lohi

Source

pub const fn set_c_nzimm10lohi(self, c_nzimm10lohi: i32) -> Self

Source

pub const fn c_nzimm18lohi(self) -> i32

c_nzimm18lohi

Source

pub const fn set_c_nzimm18lohi(self, c_nzimm18lohi: i32) -> Self

Source

pub const fn c_imm12(self) -> i32

c_imm12

Source

pub const fn set_c_imm12(self, c_imm12: i32) -> Self

Source

pub const fn c_bimm9lohi(self) -> i32

c_bimm9lohi

Source

pub const fn set_c_bimm9lohi(self, c_bimm9lohi: i32) -> Self

Source

pub const fn c_nzuimm5(self) -> u32

c_nzuimm5

Source

pub const fn set_c_nzuimm5(self, c_nzuimm5: u32) -> Self

Source

pub const fn c_nzuimm6lohi(self) -> u32

c_nzuimm6lohi

Source

pub const fn set_c_nzuimm6lohi(self, c_nzuimm6lohi: u32) -> Self

Source

pub const fn c_uimm8splohi(self) -> u32

c_uimm8splohi

Source

pub const fn set_c_uimm8splohi(self, c_uimm8splohi: u32) -> Self

Source

pub const fn c_uimm8sp_s(self) -> u32

c_uimm8sp_s

Source

pub const fn set_c_uimm8sp_s(self, c_uimm8sp_s: u32) -> Self

Source

pub const fn c_uimm10splohi(self) -> u32

c_uimm10splohi

Source

pub const fn set_c_uimm10splohi(self, c_uimm10splohi: u32) -> Self

Source

pub const fn c_uimm9splohi(self) -> u32

c_uimm9splohi

Source

pub const fn set_c_uimm9splohi(self, c_uimm9splohi: u32) -> Self

Source

pub const fn c_uimm10sp_s(self) -> u32

c_uimm10sp_s

Source

pub const fn set_c_uimm10sp_s(self, c_uimm10sp_s: u32) -> Self

Source

pub const fn c_uimm9sp_s(self) -> u32

c_uimm9sp_s

Source

pub const fn set_c_uimm9sp_s(self, c_uimm9sp_s: u32) -> Self

Source

pub const fn c_uimm2(self) -> u32

c_uimm2

Source

pub const fn set_c_uimm2(self, c_uimm2: u32) -> Self

Source

pub const fn c_uimm1(self) -> u32

c_uimm1

Source

pub const fn set_c_uimm1(self, c_uimm1: u32) -> Self

Source

pub const fn c_spimm(self) -> i32

c_spimm

Source

pub const fn set_c_spimm(self, c_spimm: i32) -> Self

Trait Implementations§

Source§

impl Clone for InstructionValue

Source§

fn clone(&self) -> InstructionValue

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InstructionValue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for InstructionValue

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for InstructionValue

Source§

fn eq(&self, other: &InstructionValue) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for InstructionValue

Source§

impl Eq for InstructionValue

Source§

impl StructuralPartialEq for InstructionValue

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.