-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YJIT: Fuse
opt_eq
, opt_lt
, and branchunless
for fixnums
This targets the instruction pair that usually result from code like `if a == b` or `if a < b`. Fusing the two makes it so we don't need to use csel and then test the result: ```diff -# Insn: 0007 opt_eq +# Insn: 0007 opt_eq (stack_size: 3) cmp x9, x10 -mov x11, #0x14 -mov x12, #0 -csel x11, x11, x12, eq -mov x9, x11 -# Insn: 0009 branchunless -tst x9, #-5 -b.eq #0x1092ee174 +b.ne #0x10457a174 nop -b #0x1092ee1a8 +# gen_direct_jmp: fallthrough ``` By using gen_direct_jmp() for when the branch is not taken, the fusion also reduces one stub for each fused branch, saving some code size.
- Loading branch information
Showing
4 changed files
with
101 additions
and
2 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
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