Skip to content

Commit

Permalink
feat: optimize instruction decoding primary switch into jump tables
Browse files Browse the repository at this point in the history
  • Loading branch information
edubart committed Apr 24, 2024
1 parent 0281f00 commit f2e6334
Show file tree
Hide file tree
Showing 3 changed files with 338 additions and 308 deletions.
5 changes: 2 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,8 @@ ifneq (,$(filter gcc,$(CC)))
# but we don't use -O3 because it enables some other flags that are not worth for the interpreter.
OPTFLAGS+=-fgcse-after-reload -fpredictive-commoning -fsplit-paths -ftree-partial-pre
endif
# Disable jump tables, because it degrades the instruction decoding performance in the interpret loop,
# since it generates a memory indirection that has a high cost in opcode switches.
OPTFLAGS+=-fno-jump-tables
# Enable large jump tables to improve performance of instruction decoding in interpret.cpp
OPTFLAGS+=-fjump-tables --param jump-table-max-growth-ratio-for-speed=4096
endif

# Link time optimizations
Expand Down
Loading

0 comments on commit f2e6334

Please sign in to comment.