Skip to content

Commit

Permalink
add missing saturating truncation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
xtuc committed Nov 11, 2024
1 parent 25d52b1 commit af8e766
Show file tree
Hide file tree
Showing 3 changed files with 498 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/helper-wasm-bytecode/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,17 @@ const symbolsByByte = {
0xfc_10: createSymbol("table.size", 1),
0xfc_11: createSymbol("table.fill", 1),

// https://webassembly.github.io/spec/core/binary/instructions.html#numeric-instructions
// saturating truncation instructions
0xfc_00: createSymbol("i32.trunc_sat_f32_s"),
0xfc_01: createSymbol("i32.trunc_sat_f32_u"),
0xfc_02: createSymbol("i32.trunc_sat_f64_s"),
0xfc_03: createSymbol("i32.trunc_sat_f64_u"),
0xfc_04: createSymbol("i64.trunc_sat_f32_s"),
0xfc_05: createSymbol("i64.trunc_sat_f32_u"),
0xfc_06: createSymbol("i64.trunc_sat_f64_s"),
0xfc_07: createSymbol("i64.trunc_sat_f64_u"),

// Atomic Memory Instructions
0xfe00: createSymbol("memory.atomic.notify", 1),
0xfe01: createSymbol("memory.atomic.wait32", 1),
Expand Down
Binary file not shown.
Loading

0 comments on commit af8e766

Please sign in to comment.