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

Method ty

cranelift/codegen/src/data_value.rs:79–95  ·  view source on GitHub ↗

Return the Cranelift IR [Type] for this [DataValue].

(&self)

Source from the content-addressed store, hash-verified

77
78 /// Return the Cranelift IR [Type] for this [DataValue].
79 pub fn ty(&self) -> Type {
80 match self {
81 DataValue::I8(_) => types::I8,
82 DataValue::I16(_) => types::I16,
83 DataValue::I32(_) => types::I32,
84 DataValue::I64(_) => types::I64,
85 DataValue::I128(_) => types::I128,
86 DataValue::F16(_) => types::F16,
87 DataValue::F32(_) => types::F32,
88 DataValue::F64(_) => types::F64,
89 DataValue::F128(_) => types::F128,
90 DataValue::V128(_) => types::I8X16, // A default type.
91 DataValue::V64(_) => types::I8X8, // A default type.
92 DataValue::V32(_) => types::I8X4, // A default type.
93 DataValue::V16(_) => types::I8X2, // A default type.
94 }
95 }
96
97 /// Return true if the value is a vector (i.e. `DataValue::V128`).
98 pub fn is_vector(&self) -> bool {

Callers 1

write_value_toMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected