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

Function vectorizelanes

cranelift/interpreter/src/step.rs:1510–1517  ·  view source on GitHub ↗

Convert a Rust array of [Value] back into a `Value::vector`. Supplying a single-element array will simply return its contained value.

(x: &[DataValue], vector_type: types::Type)

Source from the content-addressed store, hash-verified

1508/// Convert a Rust array of [Value] back into a `Value::vector`.
1509/// Supplying a single-element array will simply return its contained value.
1510fn vectorizelanes(x: &[DataValue], vector_type: types::Type) -> ValueResult<DataValue> {
1511 // If the array is only one element, return it as a scalar.
1512 if x.len() == 1 {
1513 Ok(x[0].clone())
1514 } else {
1515 vectorizelanes_all(x, vector_type)
1516 }
1517}
1518
1519/// Convert a Rust array of [Value] back into a `Value::vector`.
1520fn vectorizelanes_all(x: &[DataValue], vector_type: types::Type) -> ValueResult<DataValue> {

Callers 6

stepFunction · 0.85
icmpFunction · 0.85
unary_arithFunction · 0.85
binary_arithFunction · 0.85
binary_pairwiseFunction · 0.85
splatFunction · 0.85

Calls 4

OkFunction · 0.85
vectorizelanes_allFunction · 0.85
lenMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected