binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

[WIP][multibyte] Add multibyte array store instructions.

Open brendandahl opened this issue 3 months ago • 0 comments

Prototype implementation of the new multibyte array proposal that reuses the existing memory instructions. The syntax for the new instructions is as follows: <i32|i64|f32|f64>.store type=array

Some spec related TODOs:

  • Decide on new instructions vs existing memory instructions with memarg flag.
  • If using existing instructions:
    • What does the wat syntax look like? e.g. i32.store type=array x y or i32.store array x y or ???
    • Do we support immediate offsets? - Do we support i32.store8? (effectively the same as array.set on i8)
  • Do we support atomic instructions?

Some implementation TODOs:

  • Add feature flag.
  • Add v128.store.
  • Go through the various visitArrayStore functions and implement them or make sure the copied versions makes sense.
  • Add fuzzing support.
  • Make it so there's only one WasmBinaryReader::getMemarg
  • Add JS API

brendandahl avatar Nov 18 '25 22:11 brendandahl