Fix markdown formatting (dprint)

This commit is contained in:
2026-04-09 20:11:03 +02:00
parent adc4d59caa
commit 9834c52248
+5 -3
View File
@@ -13,7 +13,7 @@ This document describes every optimization that makes sense for WAFER, why it ma
## Status Summary ## Status Summary
| # | Optimization | Level | Status | Impact | | # | Optimization | Level | Status | Impact |
| -- | ------------------------- | ------------ | ----------- | ------- | | -- | -------------------------- | ------------ | ----------- | ------- |
| 1 | Stack-to-Local Promotion | Codegen | Phase 2 | Highest | | 1 | Stack-to-Local Promotion | Codegen | Phase 2 | Highest |
| 2 | Peephole Optimization | IR pass | Done | High | | 2 | Peephole Optimization | IR pass | Done | High |
| 3 | Constant Folding | IR pass | Done | High | | 3 | Constant Folding | IR pass | Done | High |
@@ -27,7 +27,7 @@ This document describes every optimization that makes sense for WAFER, why it ma
| 11 | wasmtime Configuration | Runtime | Done | Low | | 11 | wasmtime Configuration | Runtime | Done | Low |
| 12 | Dictionary Hash Index | Runtime | Done | Low | | 12 | Dictionary Hash Index | Runtime | Done | Low |
| 13 | Startup Batching | Architecture | Done | Low | | 13 | Startup Batching | Architecture | Done | Low |
| 14 | Self-Recursive Direct Call| Codegen | Done | High | | 14 | Self-Recursive Direct Call | Codegen | Done | High |
| 15 | Float / Double-Cell | Codegen | Not started | Future | | 15 | Float / Double-Cell | Codegen | Not started | Future |
## 1. Stack-to-Local Promotion ## 1. Stack-to-Local Promotion
@@ -394,6 +394,7 @@ i32.add ;; result on wasm stack
### Loop Index in Local ### Loop Index in Local
**Status: Done.** DO/LOOP index and limit are kept in WASM locals. Two codegen paths: **Status: Done.** DO/LOOP index and limit are kept in WASM locals. Two codegen paths:
- **Fast path** (body has no calls, no `>R`/`R>`): pure locals, zero return stack traffic. `I` reads from `local.get`. `J` also reads from outer loop's local. - **Fast path** (body has no calls, no `>R`/`R>`): pure locals, zero return stack traffic. `I` reads from `local.get`. `J` also reads from outer loop's local.
- **Slow path** (body has calls or explicit RS ops): locals used for loop control but synced to return stack for LEAVE/UNLOOP compatibility. - **Slow path** (body has calls or explicit RS ops): locals used for loop control but synced to return stack for LEAVE/UNLOOP compatibility.
@@ -444,6 +445,7 @@ Batch all IR-based primitives into a single WASM module with multiple exported f
### Impact ### Impact
Fibonacci(25) with ~243K recursive calls: Fibonacci(25) with ~243K recursive calls:
- `call_indirect`: ~21ns/call → 5.0ms total - `call_indirect`: ~21ns/call → 5.0ms total
- Direct `call`: ~7ns/call → 1.6ms total (3x faster) - Direct `call`: ~7ns/call → 1.6ms total (3x faster)
- gforth: ~14ns/call → 3.4ms total - gforth: ~14ns/call → 3.4ms total
@@ -474,7 +476,7 @@ Times in microseconds. WAFER/gf < 1.0 means WAFER is faster.
## Remaining Opportunities ## Remaining Opportunities
| Optimization | Status | Potential Impact | | Optimization | Status | Potential Impact |
| --- | --- | --- | | -------------------------------- | ------------------- | ----------------------------------------------------- |
| BEGIN loop promotion | Not started | Would speed up GCD-style tight loops further | | BEGIN loop promotion | Not started | Would speed up GCD-style tight loops further |
| BeginDoubleWhileRepeat promotion | Not started | Rare pattern, low priority | | BeginDoubleWhileRepeat promotion | Not started | Rare pattern, low priority |
| LEAVE as IR primitive | Not started | Would enable fast-path for loops with LEAVE | | LEAVE as IR primitive | Not started | Would enable fast-path for loops with LEAVE |