Skip to content

Wasm32 opts#2

Merged
FrancescAlted merged 6 commits intomainfrom
wasm32-opts
Feb 12, 2026
Merged

Wasm32 opts#2
FrancescAlted merged 6 commits intomainfrom
wasm32-opts

Conversation

@FrancescAlted
Copy link
Copy Markdown
Member

This adds optimizations to the wasm32 backend. With that, computational kernels like mandelbrot (see attached) can go from 0.8x to 3.8x speedups.

example-mandel-kernel.c

- add import-function tracking (WasmImportFunc) with signature/type checks
- pre-collect call metadata, assign type indices, and register unresolved direct calls as imports
- emit wasm import section (id=2) for imported functions
- update call emission/indexing: defined calls are offset by import count; imported calls use import indices
- adjust table/elem and export indices to account for imported functions
- allow function-pointer resolution for imported symbols
- add proper import-state cleanup on success and early error paths
@FrancescAlted FrancescAlted merged commit 517ef1f into main Feb 12, 2026
8 checks passed
@FrancescAlted FrancescAlted deleted the wasm32-opts branch February 12, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant