Struct csx64::exec::fpu::FPU [−][src]
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: Control
status: Status
tag: 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
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]
T: 'static + ?Sized,
impl<T> Az for T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CheckedAs for T
[src]
pub fn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
[src]
T: CheckedCast<Dst>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> OverflowingAs for T
[src]
pub fn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
[src]
T: OverflowingCast<Dst>,
impl<T> SaturatingAs for T
[src]
pub fn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
[src]
T: SaturatingCast<Dst>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> UnwrappedAs for T
[src]
pub fn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
[src]
T: UnwrappedCast<Dst>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WrappingAs for T
[src]
pub fn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
[src]
T: WrappingCast<Dst>,