diff options
author | Björn Gustavsson <[email protected]> | 2019-03-14 10:32:52 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2019-03-19 16:02:00 +0100 |
commit | f2bdb6b2741b9a2e0120418e035fb0cb15ac0589 (patch) | |
tree | 24d8c65adcd9751a08c149e741425ee649976437 /erts/emulator | |
parent | 7c1909a309a269138e682693285f109176790b9e (diff) | |
download | otp-f2bdb6b2741b9a2e0120418e035fb0cb15ac0589.tar.gz otp-f2bdb6b2741b9a2e0120418e035fb0cb15ac0589.tar.bz2 otp-f2bdb6b2741b9a2e0120418e035fb0cb15ac0589.zip |
Tune the move_jump instruction
With the new compiler, it has become less common with a
move to x(0) before a jump. Change the move_jump instruction
to take a destination as well as a source.
Diffstat (limited to 'erts/emulator')
-rw-r--r-- | erts/emulator/beam/instrs.tab | 8 | ||||
-rw-r--r-- | erts/emulator/beam/ops.tab | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/erts/emulator/beam/instrs.tab b/erts/emulator/beam/instrs.tab index 7fa1df64ff..590a55eb9d 100644 --- a/erts/emulator/beam/instrs.tab +++ b/erts/emulator/beam/instrs.tab @@ -710,9 +710,11 @@ jump(Fail) { $JUMP($Fail); } -move_jump(Fail, Src) { - x(0) = $Src; - $jump($Fail); +move_jump(Lbl, Src, Dst) { + Eterm lbl = $Lbl; + Eterm src = $Src; + $Dst = src; + $JUMP(lbl); } // diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index cc74ed215f..62c2e8ef8a 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -264,9 +264,11 @@ system_limit j # Move instructions. # -move C=cxy x==0 | jump Lbl => move_jump Lbl C +move Src=cxy Dst=xy | jump Lbl => move_jump Lbl Src Dst + +move_jump f cxy xy +move_jump f c r -move_jump f ncxy # Movement to and from the stack is common # Try to pack as much as we can into one instruction |