Fix markdown formatting (dprint)
This commit is contained in:
@@ -13,7 +13,7 @@ This document describes every optimization that makes sense for WAFER, why it ma
|
||||
## Status Summary
|
||||
|
||||
| # | Optimization | Level | Status | Impact |
|
||||
| -- | ------------------------- | ------------ | ----------- | ------- |
|
||||
| -- | -------------------------- | ------------ | ----------- | ------- |
|
||||
| 1 | Stack-to-Local Promotion | Codegen | Phase 2 | Highest |
|
||||
| 2 | Peephole Optimization | IR pass | Done | High |
|
||||
| 3 | Constant Folding | IR pass | Done | High |
|
||||
@@ -394,6 +394,7 @@ i32.add ;; result on wasm stack
|
||||
### Loop Index in Local
|
||||
|
||||
**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.
|
||||
- **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
|
||||
|
||||
Fibonacci(25) with ~243K recursive calls:
|
||||
|
||||
- `call_indirect`: ~21ns/call → 5.0ms total
|
||||
- Direct `call`: ~7ns/call → 1.6ms total (3x faster)
|
||||
- gforth: ~14ns/call → 3.4ms total
|
||||
@@ -474,7 +476,7 @@ Times in microseconds. WAFER/gf < 1.0 means WAFER is faster.
|
||||
## Remaining Opportunities
|
||||
|
||||
| Optimization | Status | Potential Impact |
|
||||
| --- | --- | --- |
|
||||
| -------------------------------- | ------------------- | ----------------------------------------------------- |
|
||||
| BEGIN loop promotion | Not started | Would speed up GCD-style tight loops further |
|
||||
| BeginDoubleWhileRepeat promotion | Not started | Rare pattern, low priority |
|
||||
| LEAVE as IR primitive | Not started | Would enable fast-path for loops with LEAVE |
|
||||
|
||||
Reference in New Issue
Block a user