pub struct ExtendedControlRegister0(/* private fields */);
Available on x86 or x86-64 only.
Expand description

XCR0: System control flags that indicate OS support for context management for various registers with the XSAVE feature.

Getters and setters for this structure only access a value in memory, not the register itself. Use the get and set methods to work with the actual register.

Requires BasicFeatures::extended_state_save.

Implementations§

source§

impl ExtendedControlRegister0

source

pub fn fpu(&self) -> bool

XCR0.X87: Hardcoded to 1.

source

pub fn sse(&self) -> bool

XCR0.SSE: Manage SSE state with XSAVE, including the XMM registers.

source

pub fn avx_256(&self) -> bool

XCR0.AVX: Manage 256-bit AVX state in upper halves of the YMM registers with XSAVE.

Requires sse. The lower halves of these registers are equivalent to XMM and are covered by that flag.

source

pub fn mpx_bounds(&self) -> bool

XCR0.BNDREG: Manage MPX bounds registers with XSAVE.

Requires mpx_bound_config_status.

source

pub fn mpx_bound_config_status(&self) -> bool

XCR0.BNDCSR: Manage MPX config and status registers with XSAVE.

Requires mpx_bounds.

source

pub fn avx_512_opmask(&self) -> bool

XCR0.OPMASK: Manage AVX-512 opmask registers with XSAVE.

Requires the other avx_512_* flags.

source

pub fn avx_512(&self) -> bool

XCR0.ZMM_Hi256: Manage 512-bit AVX state in the upper halves of the ZMM registers up to ZMM15 with XSAVE.

Registers ZMM8ZMM15 are available in 64-bit mode only, so this only applies up to ZMM7 in 32-bit mode.

Requires avx_256 and the other avx_512_* flags. The lower halves of these registers are equivalent to YMM and are covered by avx_256(Self::avx_256).

source

pub fn avx_512_extended(&self) -> bool

Available on x86-64 only.

XCR0.Hi16_ZMM: Manage AVX-512 state in ZMM16ZMM31 with XSAVE.

These registers are only available in 64-bit mode.

Requires the other avx_512_* flags.

source

pub fn protection_key_rights(&self) -> bool

XCR0.PKRU: Manage protection key rights registers with XSAVE.

source

pub fn set_fpu(&mut self, value: bool)

XCR0.X87: Hardcoded to 1.

source

pub fn with_fpu(&mut self, value: bool) -> Self

XCR0.X87: Hardcoded to 1.

source

pub fn set_sse(&mut self, value: bool)

XCR0.SSE: Manage SSE state with XSAVE, including the XMM registers.

source

pub fn with_sse(&mut self, value: bool) -> Self

XCR0.SSE: Manage SSE state with XSAVE, including the XMM registers.

source

pub fn set_avx_256(&mut self, value: bool)

XCR0.AVX: Manage 256-bit AVX state in upper halves of the YMM registers with XSAVE.

Requires sse. The lower halves of these registers are equivalent to XMM and are covered by that flag.

source

pub fn with_avx_256(&mut self, value: bool) -> Self

XCR0.AVX: Manage 256-bit AVX state in upper halves of the YMM registers with XSAVE.

Requires sse. The lower halves of these registers are equivalent to XMM and are covered by that flag.

source

pub fn set_mpx_bounds(&mut self, value: bool)

XCR0.BNDREG: Manage MPX bounds registers with XSAVE.

Requires mpx_bound_config_status.

source

pub fn with_mpx_bounds(&mut self, value: bool) -> Self

XCR0.BNDREG: Manage MPX bounds registers with XSAVE.

Requires mpx_bound_config_status.

source

pub fn set_mpx_bound_config_status(&mut self, value: bool)

XCR0.BNDCSR: Manage MPX config and status registers with XSAVE.

Requires mpx_bounds.

source

pub fn with_mpx_bound_config_status(&mut self, value: bool) -> Self

XCR0.BNDCSR: Manage MPX config and status registers with XSAVE.

Requires mpx_bounds.

source

pub fn set_avx_512_opmask(&mut self, value: bool)

XCR0.OPMASK: Manage AVX-512 opmask registers with XSAVE.

Requires the other avx_512_* flags.

source

pub fn with_avx_512_opmask(&mut self, value: bool) -> Self

XCR0.OPMASK: Manage AVX-512 opmask registers with XSAVE.

Requires the other avx_512_* flags.

source

pub fn set_avx_512(&mut self, value: bool)

XCR0.ZMM_Hi256: Manage 512-bit AVX state in the upper halves of the ZMM registers up to ZMM15 with XSAVE.

Registers ZMM8ZMM15 are available in 64-bit mode only, so this only applies up to ZMM7 in 32-bit mode.

Requires avx_256 and the other avx_512_* flags. The lower halves of these registers are equivalent to YMM and are covered by avx_256(Self::avx_256).

source

pub fn with_avx_512(&mut self, value: bool) -> Self

XCR0.ZMM_Hi256: Manage 512-bit AVX state in the upper halves of the ZMM registers up to ZMM15 with XSAVE.

Registers ZMM8ZMM15 are available in 64-bit mode only, so this only applies up to ZMM7 in 32-bit mode.

Requires avx_256 and the other avx_512_* flags. The lower halves of these registers are equivalent to YMM and are covered by avx_256(Self::avx_256).

source

pub fn set_avx_512_extended(&mut self, value: bool)

Available on x86-64 only.

XCR0.Hi16_ZMM: Manage AVX-512 state in ZMM16ZMM31 with XSAVE.

These registers are only available in 64-bit mode.

Requires the other avx_512_* flags.

source

pub fn with_avx_512_extended(&mut self, value: bool) -> Self

Available on x86-64 only.

XCR0.Hi16_ZMM: Manage AVX-512 state in ZMM16ZMM31 with XSAVE.

These registers are only available in 64-bit mode.

Requires the other avx_512_* flags.

source

pub fn set_protection_key_rights(&mut self, value: bool)

XCR0.PKRU: Manage protection key rights registers with XSAVE.

source

pub fn with_protection_key_rights(&mut self, value: bool) -> Self

XCR0.PKRU: Manage protection key rights registers with XSAVE.

source§

impl ExtendedControlRegister0

source

pub fn get() -> Self

Retrieve the current value of this register

source

pub unsafe fn set(value: Self)

Update the register to the given value.

§Safety

Altering certain system flags can have dramatic effects on the execution of this and other programs, including memory safety.

Trait Implementations§

source§

impl Bitfield<u64> for ExtendedControlRegister0

§

fn new(value: T) -> Self

Construct a new bitfield type from its underlying representation
§

fn value(self) -> T

Unwrap the bitfield into its underlying representation
source§

impl Clone for ExtendedControlRegister0

source§

fn clone(&self) -> ExtendedControlRegister0

Returns a copy 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 ExtendedControlRegister0

source§

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

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

impl Default for ExtendedControlRegister0

source§

fn default() -> ExtendedControlRegister0

Returns the “default value” for a type. Read more
source§

impl From<ExtendedControlRegister0> for u64

source§

fn from(val: ExtendedControlRegister0) -> Self

Converts to this type from the input type.
source§

impl From<u64> for ExtendedControlRegister0

source§

fn from(val: u64) -> Self

Converts to this type from the input type.
source§

impl PartialEq for ExtendedControlRegister0

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for ExtendedControlRegister0

source§

impl Eq for ExtendedControlRegister0

source§

impl StructuralPartialEq for ExtendedControlRegister0

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.