pub struct OpaqueThreadedExecutionResult<I> { /* private fields */ }Expand description
ThreadedExecutionResult in the shape tail-called handlers return it in.
Threaded handler internally returns this rather than ThreadedExecutionResult so that the
outcome travels in registers instead of through a hidden out-pointer where possible for
performance reasons (primarily on x86-64 due to a limited number of usable GPRs in the ABI).
On x86-64 the lanes are a 256-bit vector, so producing one of these executes AVX instructions -
see Self::platform_supported() and Self::new().
Implementations§
Source§impl<I> OpaqueThreadedExecutionResult<I>where
I: Instruction,
impl<I> OpaqueThreadedExecutionResult<I>where
I: Instruction,
Sourcepub fn platform_supported() -> bool
pub fn platform_supported() -> bool
Whether this platform can carry an outcome the way Self::new() does.
It cannot on an x86-64 CPU without AVX, where the lanes are a 256-bit vector: Rust targets x86-64-v1 by default, so a runtime check is necessary.
This is called once within ThreadedExecutableInstruction::execute_threaded().
Sourcepub unsafe fn new(result: ThreadedExecutionResult<I>) -> Self
pub unsafe fn new(result: ThreadedExecutionResult<I>) -> Self
Serialize an outcome into the shape handlers return.
§Safety
Self::platform_supported() must return true.
Sourcepub fn into_result(self) -> ThreadedExecutionResult<I>
pub fn into_result(self) -> ThreadedExecutionResult<I>
Deserialize what Self::new() produced.
The lanes only ever come from there, in this very crate, which is what makes the unknown-tag arm unreachable.
Trait Implementations§
Source§impl<I: Clone> Clone for OpaqueThreadedExecutionResult<I>
impl<I: Clone> Clone for OpaqueThreadedExecutionResult<I>
Source§fn clone(&self) -> OpaqueThreadedExecutionResult<I>
fn clone(&self) -> OpaqueThreadedExecutionResult<I>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more