Skip to main content

MemOp

Enum MemOp 

Source
pub enum MemOp {
    Load {
        kind: LoadKind,
        addr: u64,
        dest: u8,
    },
    Store {
        kind: StoreKind,
        addr: u64,
        value: u64,
    },
    LinkedLoad {
        kind: LoadKind,
        addr: u64,
        dest: u8,
    },
    ConditionalStore {
        kind: StoreKind,
        addr: u64,
        value: u64,
        dest: u8,
    },
    Emux {
        funct: u8,
        code: u16,
        ptr: u64,
        len: u64,
        dest: u8,
    },
    Cache {
        addr: u64,
        op: u8,
    },
    Fp {
        op: Op,
        addr: u64,
        ft: u8,
    },
    Unaligned {
        op: Op,
        addr: u64,
        rt: u64,
        dest: u8,
    },
}
Expand description

A memory access EX computed and DC must perform.

EX resolves the effective address and hands the access to DC; it does not touch the bus itself. That split is the point of the pipeline — DC is the cycle the scheduler interleaves the RCP around (ADR 0007).

Variants§

§

Load

An aligned load into dest.

Fields

§kind: LoadKind

Width and signedness.

§addr: u64

Effective address.

§dest: u8

Destination register.

§

Store

An aligned store of value.

Fields

§kind: StoreKind

Width.

§addr: u64

Effective address.

§value: u64

Value from rt.

§

LinkedLoad

A load linked: an aligned load that also arms the link bit and records the physical address in LLAddr (UM §16 p. 453).

Fields

§kind: LoadKind

Width and signedness.

§addr: u64

Effective address.

§dest: u8

Destination register.

§

ConditionalStore

A store conditional: stores value only if the link bit is set, and writes the outcome (1 = stored, 0 = not) to dest either way.

Carrying dest is what makes this distinct from MemOp::Store — the flag is architecturally visible even when nothing is written to memory (UM §16 p. 487).

Fields

§kind: StoreKind

Width.

§addr: u64

Effective address.

§value: u64

Value from rt.

§dest: u8

Destination register for the success flag.

§

Emux

An EMUX emulator-extension operation (COP0 CO funct 0x20-0x3F).

Carried to DC because it needs the bus: xlog reads a string out of guest memory and hands it to the host. execute is pure and cannot.

Fields

§funct: u8

The CO funct: 0x20 xdetect, 0x25 xlog, 0x2C xioctl.

§code: u16

The 9-bit code field (bits 14:6).

§ptr: u64

GPR[rd]xlog’s string pointer.

§len: u64

GPR[rt]xlog’s length.

§dest: u8

rd, where xdetect returns its capability mask.

§

Cache

A CACHE maintenance operation.

Carries the effective address so DC translates it — the instruction can raise a TLB fault — and the 5-bit operation selector so a trace can name what was requested. No data moves.

Fields

§addr: u64

Effective address.

§op: u8

The op field (the instruction’s rt slot): bits 1..=0 select the cache, bits 4..=2 the operation.

§

Fp

An FP load or store (LWC1/LDC1/SWC1/SDC1).

Kept separate from MemOp::Load/MemOp::Store because the value moves to or from the FP register file, and DC needs to know which — a shared variant would need a “which file” flag anyway.

Fields

§op: Op

Which of the four forms.

§addr: u64

Effective address.

§ft: u8

The FPR (ft).

§

Unaligned

One half of an unaligned access. rt is needed for both directions: a partial load merges into it, and a partial store merges out of it.

Fields

§op: Op

Which of the eight forms.

§addr: u64

Effective address (deliberately not aligned down here — DC needs the low bits to know which bytes are covered).

§rt: u64

Current rt.

§dest: u8

Destination register, or 0 for the store forms.

Trait Implementations§

Source§

impl Clone for MemOp

Source§

fn clone(&self) -> MemOp

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 MemOp

Source§

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

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

impl<'de> Deserialize<'de> for MemOp

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for MemOp

Source§

fn eq(&self, other: &MemOp) -> 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 Serialize for MemOp

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for MemOp

Source§

impl Eq for MemOp

Source§

impl StructuralPartialEq for MemOp

Auto Trait Implementations§

§

impl Freeze for MemOp

§

impl RefUnwindSafe for MemOp

§

impl Send for MemOp

§

impl Sync for MemOp

§

impl Unpin for MemOp

§

impl UnsafeUnpin for MemOp

§

impl UnwindSafe for MemOp

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,