diff options
author | Björn Gustavsson <[email protected]> | 2015-06-16 10:06:20 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-07-03 14:34:56 +0200 |
commit | c76b297463feee133adad510128d312536150392 (patch) | |
tree | 5ca47639c97b7bfccb82cfccfce4f3bec90cfa99 /erts/emulator/beam/beam_debug.c | |
parent | 135c9821e8806defa455a47208fb897fff1a3ff8 (diff) | |
download | otp-c76b297463feee133adad510128d312536150392.tar.gz otp-c76b297463feee133adad510128d312536150392.tar.bz2 otp-c76b297463feee133adad510128d312536150392.zip |
Eliminate the use of i_fetch in arithmetic instructions
The i_fetch instruction fetches two operands and places them
in the tmp_arg1 and tmp_arg2 variables. The next instruction
(such as i_plus) does not have to handle different types of
operands, but can get get them simply from the tmp_arg*
variables. Thus, i_fetch was introduced as a way to temper
a potentail combinatorial explosion.
Unfortunately, clang will generate terrible code because of
the tmp_arg1 and tmp_arg2 variables being live across multiple
instructions. Note that Clang has no way to predict the control
flow from one instruction to another. Clang must assume that
any instruction can jump to any other instruction. Somehow GCC
manages to cope with this situation much better.
Therefore, to improve the quality of the code generated by clang, we
must eliminate all uses of the tmp_arg1 and tmp_arg2 variables. This
commit eliminates the use of i_fetch in combination with the
arithmetic and logical instructions.
While we are touching the code for the bsr and bsl instructions,
also move the tmp_big[] array from top scope of process main into
the block that encloses the bsr and bsl instructions.
Diffstat (limited to 'erts/emulator/beam/beam_debug.c')
0 files changed, 0 insertions, 0 deletions