From 5667ab7dcd2e367f3e1ac337eabadd64d9d850ad Mon Sep 17 00:00:00 2001 From: Luuk de Gram Date: Fri, 30 Jul 2021 20:35:30 +0200 Subject: wasm: Implement wrapping operands, add opcodes to wasm.zig - Some opcodes have the incorrect value set in std. - Some opcodes were missing and have now been added to std. - Adding wrapping operands for add,sub and mul. - Implement intCast which either extends or shortens the type. --- lib/std/wasm.zig | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/std') diff --git a/lib/std/wasm.zig b/lib/std/wasm.zig index 8922b3c83e..aebbb3b163 100644 --- a/lib/std/wasm.zig +++ b/lib/std/wasm.zig @@ -162,8 +162,14 @@ pub const Opcode = enum(u8) { i32_wrap_i64 = 0xA7, i32_trunc_f32_s = 0xA8, i32_trunc_f32_u = 0xA9, - i32_trunc_f64_s = 0xB0, - i32_trunc_f64_u = 0xB1, + i32_trunc_f64_s = 0xAA, + i32_trunc_f64_u = 0xAB, + i64_extend_i32_s = 0xAC, + i64_extend_i32_u = 0xAD, + i64_trunc_f32_s = 0xAE, + i64_trunc_f32_u = 0xAF, + i64_trunc_f64_s = 0xB0, + i64_trunc_f64_u = 0xB1, f32_convert_i32_s = 0xB2, f32_convert_i32_u = 0xB3, f32_convert_i64_s = 0xB4, -- cgit v1.2.3