Commit c8527a1
committed
fix(runtime): add missing store instructions (0x3A-0x3E)
This commit adds support for partial-width store instructions that were
missing from the instruction parser, causing "Unknown instruction opcode"
errors when executing real-world WASM modules.
Added instructions:
- 0x3A: i32.store8 - Store 8-bit value from i32
- 0x3B: i32.store16 - Store 16-bit value from i32
- 0x3C: i64.store8 - Store 8-bit value from i64
- 0x3D: i64.store16 - Store 16-bit value from i64
- 0x3E: i64.store32 - Store 32-bit value from i64
These instructions are commonly used for:
- Byte-level memory manipulation
- String operations (UTF-8 encoding)
- Packed data structures
- WASI syscall buffers
Test results:
- ✓ simple_inference.wasm (WASI-NN) now executes successfully
- ✓ Fuel consumed: 60, Peak memory: 1202 bytes
The Instruction enum already had these variants defined; this commit
only adds the missing parser cases for the opcodes.
Impact: Unlocks execution of WASI modules and real-world applications1 parent 543e3c1 commit c8527a1
1 file changed
+55
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
286 | 341 | | |
287 | 342 | | |
288 | 343 | | |
| |||
0 commit comments