diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2024-02-27 00:17:09 +0100 |
|---|---|---|
| committer | Henry Gressmann <mail@henrygressmann.de> | 2024-02-27 00:17:09 +0100 |
| commit | 5e573f0765570e0aaf6c9415b652b25d5bddebd9 (patch) | |
| tree | 5027b5c53413db89d40e6e87d30e09d07d5c2cc4 /crates/types/src | |
| parent | 0fa1bca956229fa49509524aa7edd087439ea39a (diff) | |
no more simd
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'crates/types/src')
| -rw-r--r-- | crates/types/src/instructions.rs | 26 | ||||
| -rw-r--r-- | crates/types/src/value.rs | 15 |
2 files changed, 33 insertions, 8 deletions
diff --git a/crates/types/src/instructions.rs b/crates/types/src/instructions.rs index fc12b54..dd941b3 100644 --- a/crates/types/src/instructions.rs +++ b/crates/types/src/instructions.rs @@ -54,6 +54,32 @@ pub enum Instruction { // Custom Instructions BrLabel(LabelAddr), + //== Not implemented yet, to be determined + + // LocalGet + I32Const + I32Add + // One of the most common patterns in the Rust compiler output + I32LocalGetConstAdd(LocalAddr, i32), + + // LocalGet + I32Const + I32Store + // Also common, helps us skip the stack entirely + I32LocalGetConstStore(LocalAddr, i32, MemoryArg), // I32Store + LocalGet + I32Const + + // I64Xor + I64Const + I64RotL + // Commonly used by a few crypto libraries + I64XorConstRotl(i64), + + // LocalTee + LocalGet + LocalTeeGet(LocalAddr, LocalAddr), + LocalGet2(LocalAddr, LocalAddr), + LocalGet3(LocalAddr, LocalAddr, LocalAddr), + LocalGet4(LocalAddr, LocalAddr, LocalAddr, LocalAddr), + LocalGetSet(LocalAddr, LocalAddr), + + I32AddConst(i32), + I32SubConst(i32), + I64AddConst(i64), + I64SubConst(i64), + // Control Instructions // See <https://webassembly.github.io/spec/core/binary/instructions.html#control-instructions> Unreachable, diff --git a/crates/types/src/value.rs b/crates/types/src/value.rs index 3c02e55..8fd72fb 100644 --- a/crates/types/src/value.rs +++ b/crates/types/src/value.rs @@ -16,9 +16,8 @@ pub enum WasmValue { F32(f32), /// A 64-bit float. F64(f64), - /// A half of a 128-bit vector. Allways used in pairs. - V128(u128), - + // /// A 128-bit vector + // V128(u128), RefExtern(ExternAddr), RefFunc(FuncAddr), RefNull(ValType), @@ -49,7 +48,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), } @@ -92,7 +91,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.half({:?})", 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), @@ -109,7 +108,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,8 +128,8 @@ pub enum ValType { F32, /// A 64-bit float. F64, - /// A half of a 128-bit vector. Allways used in pairs. - V128, + /// A 128-bit vector + // V128, /// A reference to a function. RefFunc, /// A reference to an external value. |
