From f2bdb6b2741b9a2e0120418e035fb0cb15ac0589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 14 Mar 2019 10:32:52 +0100 Subject: 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. --- erts/emulator/beam/instrs.tab | 8 +++++--- erts/emulator/beam/ops.tab | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'erts') 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 -- cgit v1.2.3