-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce instruction dispatch by tail-call elimination
We adhere to the wasm3 implementation, which separates all instruction emulations, and organize them into a funciton table. After doing performance analysis, we discovered that emulator took a long time to calculate the offset of function table. We therefore alter struct rv_insn_t so that we can directly assign instruction emulation to IR with adding member opfunc. Running coremark benchmark now produces faster results than it did previously, and the test results show below. | Microprocessor | compiler | CoreMark w/ commit f2da162 | CoreMark w/ PR #95 | Speedup | |------------------------------------------------------------------------------------------------| | Core i7-8700 | clang-15 | 836.4849530 | 971.9516670 | +13.9% | |------------------------------------------------------------------------------------------------| | Core i7-8700 | gcc-12 | 888.3423808 | 963.3369450 | +7.8% | |------------------------------------------------------------------------------------------------| | eMag 8180 | clang-15 | 286.0007652 | 335.396515 | +20.5% | |------------------------------------------------------------------------------------------------| | eMag 8180 | gcc-12 | 259.6389222 | 332.561175 | +14.0% | Previously, we had to calculate the jumping address using a method such as switch-case, computed-goto, or function table, but this is no longer necessary.
- Loading branch information
Showing
4 changed files
with
1,083 additions
and
1,122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.