pub struct wasmer_cpu_features_t { /* private fields */ }
Expand description
Unstable non-standard Wasmer-specific API to represent a set of CPU features.
CPU features are identified by their stringified names. The reference is the GCC options:
- https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html,
- https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html,
- https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html.
At the time of writing this documentation (it might be outdated in the future), the supported features are the following:
sse2
,sse3
,ssse3
,sse4.1
,sse4.2
,popcnt
,avx
,bmi
,bmi2
,avx2
,avx512dq
,avx512vl
,lzcnt
.
Example
int main() {
// Create a new CPU feature set.
wasmer_cpu_features_t* cpu_features = wasmer_cpu_features_new();
// Create a new feature name, here `sse2`, and add it to the set.
{
wasm_name_t cpu_feature_name;
wasm_name_new_from_string(&cpu_feature_name, "sse2");
wasmer_cpu_features_add(cpu_features, &cpu_feature_name);
wasm_name_delete(&cpu_feature_name);
}
wasmer_cpu_features_delete(cpu_features);
return 0;
}
Auto Trait Implementations§
impl RefUnwindSafe for wasmer_cpu_features_t
impl Send for wasmer_cpu_features_t
impl Sync for wasmer_cpu_features_t
impl Unpin for wasmer_cpu_features_t
impl UnwindSafe for wasmer_cpu_features_t
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.