native 0.0.1
Vectors, masks and wide register packs for C++26
Loading...
Searching...
No Matches
Feature detection
Collaboration diagram for Feature detection:

Classes

struct  native::wasm_capabilities

Functions

constexpr std::span< std::uint8_t const > native::wasm_feature_probe (wasm_feature feature) noexcept
constexpr wasm_capabilities native::decode_wasm_capabilities (wasm_capabilities::raw_observations raw) noexcept
template<class V>
requires requires(V & validate,std::span<std::uint8_t const> bytes) { { validate(bytes) } noexcept -> std::same_as<std::optional
<bool>>; }
constexpr wasm_capabilities native::observe_wasm_capabilities (V &&validate) noexcept
constexpr wasm_capabilities native::observe_wasm_capabilities () noexcept

Detailed Description

Runtime validation observations, independent of CPU features and SIMD types.

Function Documentation

◆ decode_wasm_capabilities()

wasm_capabilities native::decode_wasm_capabilities ( wasm_capabilities::raw_observations raw)
constexprnoexcept

Normalize independent observations without inferring missing answers. classify_isa separately requires SIMD128 when relaxed SIMD is requested.

Definition at line 65 of file features.h.

Here is the caller graph for this function:

◆ observe_wasm_capabilities() [1/2]

wasm_capabilities native::observe_wasm_capabilities ( )
constexprnoexcept

Return unknown observations: portable C++ has no WebAssembly engine query. Use decode_wasm_capabilities with observations from the embedder or the optional JavaScript bridge. No compiler-macro inference or probing occurs.

Definition at line 97 of file features.h.

◆ observe_wasm_capabilities() [2/2]

template<class V>
requires requires(V & validate,std::span<std::uint8_t const> bytes) { { validate(bytes) } noexcept -> std::same_as<std::optional
<bool>>; }
wasm_capabilities native::observe_wasm_capabilities ( V && validate)
constexprnoexcept

Query an embedder's validator without executing probe instructions. The nonthrowing callback accepts a byte span and returns optional<bool>: nullopt means unavailable/failed, false means observed absent. A valid empty module must first be accepted. Feature queries then proceed independently. The callback translates engine errors into nullopt; no loader is selected.

Definition at line 84 of file features.h.

Here is the caller graph for this function:

◆ wasm_feature_probe()

std::span< std::uint8_t const > native::wasm_feature_probe ( wasm_feature feature)
constexprnoexcept

A complete module for validating one feature, without executing it. The returned immutable bytes have static lifetime; unknown enums give an empty span. Validation must use the settings of the intended runtime.

Definition at line 31 of file features.h.

Here is the caller graph for this function: