Struct csx64::exec::fpu::FPU[][src]

pub struct FPU {
    pub vals: [F80; 8],
    pub control: Control,
    pub status: Status,
    pub tag: Tag,
}

The complete FPU unit.

FPU value registers are not exposed on their own because they have interactions among one another and other internal FPU state registers that would make the separation pointless.

Fields

vals: [F80; 8]

The physical value registers. These are exposed so that they can be used in external calculations, however care should be taken when mutating them directly, as this would not take into account the other registers.

control: Controlstatus: Statustag: Tag

Implementations

impl FPU[src]

pub fn new() -> Self[src]

Creates a new FPU in the initialized state.

pub fn reset(&mut self)[src]

Clears the fpu back to the initialized state.

pub fn clear_exceptions(&mut self)[src]

Clears the exception bits from the status register.

pub fn st_to_physical(&self, st: u8) -> u8[src]

Converts a stack-top (ST) relative index to a physical index. A physical index is needed to directly use the stored register values or get a specific value from the tag register. Note that this will change if the top field is changed in the status register.

pub fn set_st(&mut self, st: u8, val: F80)[src]

Assigns a value to the specified ST register. Updates the tag register accordingly.

pub fn get_st(&self, st: u8) -> Option<F80>[src]

Gets the value in the specified ST register. If the tag for that register is marked Empty, returns None.

pub fn free_st(&mut self, st: u8)[src]

Frees the specified ST register. This sets its tag to empty, but does not modify the value register.

pub fn push(&mut self, val: F80) -> Result<(), ()>[src]

Pushes a value onto the fpu stack. Updates the status and tag registers accordingly. Fails if the push location is non-empty, in which case this operation is no-op.

pub fn pop(&mut self) -> Result<(), ()>[src]

Pops a value off the fpu stack. Updates the status and tag registers accordingly, but the (logically) removed value is not modified. Fails if the pop location is empty, in which case this operation is no-op.

Trait Implementations

impl Default for FPU[src]

Auto Trait Implementations

impl RefUnwindSafe for FPU

impl Send for FPU

impl Sync for FPU

impl Unpin for FPU

impl UnwindSafe for FPU

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Az for T[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CheckedAs for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> OverflowingAs for T[src]

impl<T> SaturatingAs for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> UnwrappedAs for T[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WrappingAs for T[src]