aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2019-03-12 07:20:43 +0100
committerBjörn Gustavsson <[email protected]>2019-03-19 16:01:59 +0100
commit7e44a4b8eaad7d7d6fadf933794d3a0d05790b23 (patch)
tree4b47c8a8d88ee6f9bd515ff79c0265af7b6c31e4 /erts
parenta0a3f3c1891bf74d35b84855891caa5928cc14c1 (diff)
downloadotp-7e44a4b8eaad7d7d6fadf933794d3a0d05790b23.tar.gz
otp-7e44a4b8eaad7d7d6fadf933794d3a0d05790b23.tar.bz2
otp-7e44a4b8eaad7d7d6fadf933794d3a0d05790b23.zip
Combine move with trim
It is relatively common to move something from a Y register to an X register before trimming.
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/instrs.tab7
-rw-r--r--erts/emulator/beam/ops.tab3
2 files changed, 10 insertions, 0 deletions
diff --git a/erts/emulator/beam/instrs.tab b/erts/emulator/beam/instrs.tab
index aeb47c3b0f..7fa1df64ff 100644
--- a/erts/emulator/beam/instrs.tab
+++ b/erts/emulator/beam/instrs.tab
@@ -477,6 +477,13 @@ i_make_fun(FunP, NumFree) {
HEAVY_SWAPIN;
}
+move_trim(Src, Dst, Words) {
+ Uint cp = E[0];
+ $Dst = $Src;
+ E += $Words;
+ E[0] = cp;
+}
+
i_trim(Words) {
Uint cp = E[0];
E += $Words;
diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab
index a6f5ba347c..4f57e8d9d5 100644
--- a/erts/emulator/beam/ops.tab
+++ b/erts/emulator/beam/ops.tab
@@ -106,7 +106,10 @@ init y
allocate_zero t t?
allocate_heap_zero t I t?
+move Src=y Dst=x | trim N Remaining => move_trim Src Dst N
trim N Remaining => i_trim N
+
+move_trim y x t
i_trim t
test_heap I t?