aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_emu.c
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-04-22 20:44:43 +0200
committerBjörn-Egil Dahlberg <[email protected]>2015-04-23 14:37:32 +0200
commitd1321eaf9bd1e417561e3d70fd85749fe589143b (patch)
tree496c17fc81c8f98aa8ef6abfc9c068cb9934adf0 /erts/emulator/beam/beam_emu.c
parent63949dcd13e24bdc73336b0f5e88d4f06cce56c1 (diff)
downloadotp-d1321eaf9bd1e417561e3d70fd85749fe589143b.tar.gz
otp-d1321eaf9bd1e417561e3d70fd85749fe589143b.tar.bz2
otp-d1321eaf9bd1e417561e3d70fd85749fe589143b.zip
erts: Add move window instruction
Move an entire region of x registers to the stack. This reduces the dispatch pressure of move instructions. Also introduce a move2 specialization for some common move patterns: move r y | move x y -> move2 : As above, moving regions to the stack move x r | move x y -> move2 : A seemingly common pattern
Diffstat (limited to 'erts/emulator/beam/beam_emu.c')
-rw-r--r--erts/emulator/beam/beam_emu.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c
index 8b9e271068..b9b2094e6c 100644
--- a/erts/emulator/beam/beam_emu.c
+++ b/erts/emulator/beam/beam_emu.c
@@ -1503,6 +1503,40 @@ void process_main(void)
Next(2);
}
+ OpCase(move_window3_xxxy): {
+ BeamInstr *next;
+ Eterm *y;
+ PreFetch(4, next);
+ y = (Eterm *)(((unsigned char *)E) + (Arg(3)));
+ y[0] = xb(Arg(0));
+ y[1] = xb(Arg(1));
+ y[2] = xb(Arg(2));
+ NextPF(4, next);
+ }
+ OpCase(move_window4_xxxxy): {
+ BeamInstr *next;
+ Eterm *y;
+ PreFetch(5, next);
+ y = (Eterm *)(((unsigned char *)E) + (Arg(4)));
+ y[0] = xb(Arg(0));
+ y[1] = xb(Arg(1));
+ y[2] = xb(Arg(2));
+ y[3] = xb(Arg(3));
+ NextPF(5, next);
+ }
+ OpCase(move_window5_xxxxxy): {
+ BeamInstr *next;
+ Eterm *y;
+ PreFetch(6, next);
+ y = (Eterm *)(((unsigned char *)E) + (Arg(5)));
+ y[0] = xb(Arg(0));
+ y[1] = xb(Arg(1));
+ y[2] = xb(Arg(2));
+ y[3] = xb(Arg(3));
+ y[4] = xb(Arg(4));
+ NextPF(6, next);
+ }
+
OpCase(i_move_call_only_fcr): {
r(0) = Arg(1);
}