summaryrefslogtreecommitdiff
path: root/crates/types
diff options
context:
space:
mode:
Diffstat (limited to 'crates/types')
-rw-r--r--crates/types/src/value.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/crates/types/src/value.rs b/crates/types/src/value.rs
index 28ca6e2..0f127a8 100644
--- a/crates/types/src/value.rs
+++ b/crates/types/src/value.rs
@@ -17,7 +17,7 @@ pub enum WasmValue {
/// A 64-bit float.
F64(f64),
// /// A 128-bit vector
- // V128(u128),
+ V128(u128),
RefExtern(ExternAddr),
RefFunc(FuncAddr),
RefNull(ValType),
@@ -31,7 +31,6 @@ impl WasmValue {
Self::I64(i) => ConstInstruction::I64Const(*i),
Self::F32(i) => ConstInstruction::F32Const(*i),
Self::F64(i) => ConstInstruction::F64Const(*i),
-
Self::RefFunc(i) => ConstInstruction::RefFunc(*i),
Self::RefNull(ty) => ConstInstruction::RefNull(*ty),
@@ -48,7 +47,7 @@ impl WasmValue {
ValType::I64 => Self::I64(0),
ValType::F32 => Self::F32(0.0),
ValType::F64 => Self::F64(0.0),
- // ValType::V128 => Self::V128(0),
+ ValType::V128 => Self::V128(0),
ValType::RefFunc => Self::RefNull(ValType::RefFunc),
ValType::RefExtern => Self::RefNull(ValType::RefExtern),
}
@@ -91,7 +90,7 @@ impl Debug for WasmValue {
WasmValue::I64(i) => write!(f, "i64({})", i),
WasmValue::F32(i) => write!(f, "f32({})", i),
WasmValue::F64(i) => write!(f, "f64({})", i),
- // WasmValue::V128(i) => write!(f, "v128.half({:?})", i),
+ WasmValue::V128(i) => write!(f, "v128({:?})", i),
WasmValue::RefExtern(addr) => write!(f, "ref.extern({:?})", addr),
WasmValue::RefFunc(addr) => write!(f, "ref.func({:?})", addr),
WasmValue::RefNull(ty) => write!(f, "ref.null({:?})", ty),
@@ -108,7 +107,7 @@ impl WasmValue {
Self::I64(_) => ValType::I64,
Self::F32(_) => ValType::F32,
Self::F64(_) => ValType::F64,
- // Self::V128(_) => ValType::V128,
+ Self::V128(_) => ValType::V128,
Self::RefExtern(_) => ValType::RefExtern,
Self::RefFunc(_) => ValType::RefFunc,
Self::RefNull(ty) => *ty,
@@ -129,7 +128,7 @@ pub enum ValType {
/// A 64-bit float.
F64,
/// A 128-bit vector
- // V128,
+ V128,
/// A reference to a function.
RefFunc,
/// A reference to an external value.
@@ -148,6 +147,7 @@ impl ValType {
ValType::I64 => 0x7E,
ValType::F32 => 0x7D,
ValType::F64 => 0x7C,
+ ValType::V128 => 0x7B,
ValType::RefFunc => 0x70,
ValType::RefExtern => 0x6F,
}
@@ -159,6 +159,7 @@ impl ValType {
0x7E => Some(ValType::I64),
0x7D => Some(ValType::F32),
0x7C => Some(ValType::F64),
+ 0x7B => Some(ValType::V128),
0x70 => Some(ValType::RefFunc),
0x6F => Some(ValType::RefExtern),
_ => None,