ReXGlue SDK
Loading...
Searching...
No Matches
rex::ppc::FPSCRRegister Struct Reference

#include <rex/ppc/context.h>

Public Types

using Platform = FPSCRPlatform

Public Member Functions

u32 GetCSR () noexcept
void SetCSR (u32 value) noexcept
void RestoreGuestBits (u32 saved) noexcept
u32 LoadFromHost () noexcept
void StoreToHost (u32 value) noexcept
void EnableFlushModeUnconditional () noexcept
void DisableFlushModeUnconditional () noexcept
void EnableFlushMode () noexcept
void DisableFlushMode () noexcept
void SetFlushMode (bool enable) noexcept
void InitHost () noexcept

Public Attributes

u32 csr

Static Public Attributes

static constexpr size_t kRoundShift = Platform::kRoundShift
static constexpr size_t kRoundMaskVal = Platform::kRoundMaskVal
static constexpr size_t kFlushMask = Platform::kFlushMask
static constexpr u32 kGuestMask = static_cast<u32>(kRoundMaskVal) | static_cast<u32>(kFlushMask)

Detailed Description

Floating point status and control register (FPSCR).

Member Typedef Documentation

◆ Platform

using rex::ppc::FPSCRRegister::Platform = FPSCRPlatform

Host access to the floating point control word.

Member Function Documentation

◆ DisableFlushMode()

void rex::ppc::FPSCRRegister::DisableFlushMode ( )
inlinenoexcept

Turns off flush to zero mode, writing csr to the host only when the mode was on.

◆ DisableFlushModeUnconditional()

void rex::ppc::FPSCRRegister::DisableFlushModeUnconditional ( )
inlinenoexcept

Turns off flush to zero mode and writes csr to the host without checking its current state.

◆ EnableFlushMode()

void rex::ppc::FPSCRRegister::EnableFlushMode ( )
inlinenoexcept

Turns on flush to zero mode, writing csr to the host only when the mode was off.

◆ EnableFlushModeUnconditional()

void rex::ppc::FPSCRRegister::EnableFlushModeUnconditional ( )
inlinenoexcept

Turns on flush to zero mode and writes csr to the host without checking its current state.

◆ GetCSR()

u32 rex::ppc::FPSCRRegister::GetCSR ( )
inlinenoexcept

Returns the host floating point control register. It is the MXCSR on x86 and the FPCR on ARM.

◆ InitHost()

void rex::ppc::FPSCRRegister::InitHost ( )
inlinenoexcept

Reads the host control word, applies the host exception policy and writes it back.

◆ LoadFromHost()

u32 rex::ppc::FPSCRRegister::LoadFromHost ( )
inlinenoexcept

Reads the host control word into csr.

Returns
The guest rounding mode matching the host rounding mode.

◆ RestoreGuestBits()

void rex::ppc::FPSCRRegister::RestoreGuestBits ( u32 saved)
inlinenoexcept

Restores the guest owned bits of csr from a saved word.

◆ SetCSR()

void rex::ppc::FPSCRRegister::SetCSR ( u32 value)
inlinenoexcept

Writes the host floating point control register.

Parameters
valueThe MXCSR on x86 and the FPCR on ARM.

◆ SetFlushMode()

void rex::ppc::FPSCRRegister::SetFlushMode ( bool enable)
inlinenoexcept

Sets flush to zero mode, writing csr to the host only when the mode changes.

Parameters
enableTrue to turn flush to zero on, false to turn it off.

◆ StoreToHost()

void rex::ppc::FPSCRRegister::StoreToHost ( u32 value)
inlinenoexcept

Sets the host rounding mode from a guest rounding mode and writes csr to the host.

Parameters
valueThe guest rounding mode, one of the kRound constants.

Member Data Documentation

◆ csr

u32 rex::ppc::FPSCRRegister::csr

Host floating point control word as last read or written.

◆ kFlushMask

size_t rex::ppc::FPSCRRegister::kFlushMask = Platform::kFlushMask
staticconstexpr

Mask of the host flush to zero and denormals are zero bits in csr.

◆ kGuestMask

u32 rex::ppc::FPSCRRegister::kGuestMask = static_cast<u32>(kRoundMaskVal) | static_cast<u32>(kFlushMask)
staticconstexpr

Bits the guest owns, the rest is host policy set by InitHost.

◆ kRoundMaskVal

size_t rex::ppc::FPSCRRegister::kRoundMaskVal = Platform::kRoundMaskVal
staticconstexpr

Mask of the host rounding field in csr.

◆ kRoundShift

size_t rex::ppc::FPSCRRegister::kRoundShift = Platform::kRoundShift
staticconstexpr

Bit position of the host rounding field in csr.


The documentation for this struct was generated from the following file: