MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / vector

Method vector

cranelift/interpreter/src/value.rs:359–368  ·  view source on GitHub ↗
(v: [u8; 16], ty: Type)

Source from the content-addressed store, hash-verified

357 }
358
359 fn vector(v: [u8; 16], ty: Type) -> ValueResult<Self> {
360 assert!(ty.is_vector() && [2, 4, 8, 16].contains(&ty.bytes()));
361 match ty.bytes() {
362 16 => Ok(DataValue::V128(v)),
363 8 => Ok(DataValue::V64(v[..8].try_into().unwrap())),
364 4 => Ok(DataValue::V32(v[..4].try_into().unwrap())),
365 2 => Ok(DataValue::V16(v[..2].try_into().unwrap())),
366 _ => unreachable!(),
367 }
368 }
369
370 fn into_array(&self) -> ValueResult<[u8; 16]> {
371 match *self {

Callers

nothing calls this directly

Calls 5

OkFunction · 0.85
V128Class · 0.50
bytesMethod · 0.45
unwrapMethod · 0.45
try_intoMethod · 0.45

Tested by

no test coverage detected