core::arch::wasm32

Function v128_load

1.54.0 · Source
pub unsafe fn v128_load(m: *const v128) -> v128
Available on target_family="wasm" and target feature simd128 and WebAssembly only.
Expand description

Loads a v128 vector from the given heap address.

This intrinsic will emit a load with an alignment of 1. While this is provided for completeness it is not strictly necessary, you can also load the pointer directly:

let a: &v128 = ...;
let value = unsafe { v128_load(a) };
// .. is the same as ..
let value = *a;

The alignment of the load can be configured by doing a manual load without this intrinsic.

§Unsafety

This intrinsic is unsafe because it takes a raw pointer as an argument, and the pointer must be valid to load 16 bytes from. Note that there is no alignment requirement on this pointer since this intrinsic performs a 1-aligned load.