diff options
author | Björn Gustavsson <[email protected]> | 2019-02-25 11:48:14 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2019-02-28 12:18:24 +0100 |
commit | cb2eb1766b5db1d5462a63025e99496ec8c6969b (patch) | |
tree | 3c0a5061f4bb9c5c1a66a615e237711424976572 /erts/emulator/beam/beam_load.c | |
parent | 72b503485b0d029f615c80c3e64680419cd690d9 (diff) | |
download | otp-cb2eb1766b5db1d5462a63025e99496ec8c6969b.tar.gz otp-cb2eb1766b5db1d5462a63025e99496ec8c6969b.tar.bz2 otp-cb2eb1766b5db1d5462a63025e99496ec8c6969b.zip |
Tune move instructions
Of the `move_dup` instructions, only `move_dup x x x` was
frequently used. Remove the other register combinations.
With those instruction `move_dup` instructions removed, it
is necessary to add new predicates to avoid unsafe translation
to `move_shift` and `move2_par`.
Also add additional transformations to transform more `move`
instructions into `move2_par`. The existing transformation
would require the `move` instructions to be in the "right"
order in order to be transformed.
Remove `move3 x y x y x y` because it turns out to be rarely
executed.
Diffstat (limited to 'erts/emulator/beam/beam_load.c')
-rw-r--r-- | erts/emulator/beam/beam_load.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index e9e294cd59..c8618121ea 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -2986,6 +2986,35 @@ compiled_with_otp_20_or_higher(LoaderState* stp) } /* + * Predicate that tests whether the following two moves are independent: + * + * move Src1 Dst1 + * move Src2 Dst2 + * + */ +static int +independent_moves(LoaderState* stp, GenOpArg Src1, GenOpArg Dst1, + GenOpArg Src2, GenOpArg Dst2) +{ + return (Src1.type != Dst2.type || Src1.val != Dst2.val) && + (Src2.type != Dst1.type || Src2.val != Dst1.val) && + (Dst1.type != Dst2.type ||Dst1.val != Dst2.val); +} + +/* + * Predicate that tests that two registers are distinct. + * + * move Src1 Dst1 + * move Src2 Dst2 + * + */ +static int +distinct(LoaderState* stp, GenOpArg Reg1, GenOpArg Reg2) +{ + return Reg1.type != Reg2.type || Reg1.val != Reg2.val; +} + +/* * Predicate that tests whether a jump table can be used. */ |