| e4fd50d1 | 14-Jan-2025 |
Alex Crichton <[email protected]> |
pulley: Shrink frame save/restore instructions (#9999)
* pulley: Shrink frame save/restore instructions
This commit shrinks the size of the `PushFrameSave` and `PopFrameRestore` functions which are
pulley: Shrink frame save/restore instructions (#9999)
* pulley: Shrink frame save/restore instructions
This commit shrinks the size of the `PushFrameSave` and `PopFrameRestore` functions which are used in almost all wasm functions. Previously these instructions allowed for 32-bits of stack space in addition to saving/restoring all 32 X-registers. In reality though it's quite uncommon to need more than 16-bits of stack space and ABI-wise the most commonly saved registers are the upper 16 registers of the X register set.
This commit therefore shrinks the frame size to 16 bits and only has the ability to save/restore the upper 16 X-registers. Note that any clobbered registers and frame sizes are still supported, they'll just use more pessimal encodings which aren't a single opcode. If a function uses >64KiB of stack space though it's probably not too important what the dispatch cost is at the beginning.
The overall result of this change is that each instruction shaves of 4 bytes (2 from the frame size and 2 from the registers being saved/restored). This results in a 4% faster execution time on the bz2 Sightglass benchmark, ~1% on pulldown-cmark, and while it shrinks `spidermonkey.cwasm` slightly it's not significant.
* Remove no-longer-applicable test
* Fix clippy error
* Update test expectations
show more ...
|