feature: implement all float, conversion, table & bulk memory opcodes with IEEE 754 hardening
Complete implementation of remaining WASM MVP and post-MVP opcodes: Float arithmetic (f32/f64): - abs, neg (purely bitwise), ceil, floor, trunc, nearest, sqrt - add, sub, mul, div with indeterminate form handling (Inf+(-Inf), Inf-Inf, Inf*0, 0/0, Inf/Inf -> NaN; x/0 -> ±Inf) - min, max with signed-zero fix (OR for min, AND for max) - copysign (bitwise sign transfer) Float comparisons (f64 eq/ne/lt/gt/le/ge): - Added bitwise NaN detection before comparisons to prevent EInvalidOp on x64 FPC Conversion opcodes: - i32.wrap_i64, i64.extend_i32_s/u - i32/i64.trunc_f32/f64_s/u with NaN + overflow traps - f32/f64.convert_i32/i64_s/u - f32.demote_f64, f64.promote_f32 - i32/i64.reinterpret_f32/f64, f32/f64.reinterpret_i32/i64 - i32.extend8_s, i32.extend16_s, i64.extend8_s/16_s/32_s 0xFC prefix dispatch + saturating truncation (FC 00-07): - i32/i64.trunc_sat_f32/f64_s/u with NaN->0, clamp to min/max Bulk memory (FC 08-0B): - memory.init, data.drop, memory.copy (overlap-safe), memory.fill Table operations (FC 0C-11 + opcodes 0x25/0x26): - table.get, table.set, table.init, elem.drop - table.copy (overlap-safe), table.grow, table.size, table.fill Control flow & infrastructure: - select t* (typed select, 0x1C) with LEB128 type vector - block/loop/if blocktype now parsed as LEB128 s33 (multi-byte support) - Control flow scanner updated for all new opcodes (0xFC sub-opcodes, table.get/set, typed select) - VM init: jump tables heap-allocated via kalloc, FC table initialized All float ops use bitwise NaN detection to avoid FPC x64 EInvalidOp.
This commit is contained in:
1 parent
255ad4806e
commit
b937e60838
218 files changed
+9999
-211
No files matched your search
@@ -1,3 +1,4 @@
|
||||
bin
|
||||
lib
|
||||
AGENTS.md
|
||||
GAP_ANALYSIS.md
|
||||
Reference in new issue
Block a user