aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_emu.c
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-04-23 19:21:34 +0200
committerBjörn-Egil Dahlberg <[email protected]>2015-04-24 10:06:17 +0200
commitb58b4718012cfb848dad3106b2ab22c08997c639 (patch)
tree7b1acc46855ccebddd452f315a2cb3d0fc8f5d76 /erts/emulator/beam/beam_emu.c
parent699ad918545ac7e716b77ea05a6a943434616020 (diff)
downloadotp-b58b4718012cfb848dad3106b2ab22c08997c639.tar.gz
otp-b58b4718012cfb848dad3106b2ab22c08997c639.tar.bz2
otp-b58b4718012cfb848dad3106b2ab22c08997c639.zip
erts: Specialize rem instruction for common case
* i_rem specialization on x registers
Diffstat (limited to 'erts/emulator/beam/beam_emu.c')
-rw-r--r--erts/emulator/beam/beam_emu.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c
index aca340db6b..f369d7b632 100644
--- a/erts/emulator/beam/beam_emu.c
+++ b/erts/emulator/beam/beam_emu.c
@@ -2902,6 +2902,19 @@ do { \
goto lb_Cl_error; \
} while(0)
+ OpCase(i_rem_jIxxd):
+ {
+ Eterm result;
+
+ if (xb(Arg(3)) == SMALL_ZERO) {
+ goto badarith;
+ } else if (is_both_small(xb(Arg(2)), xb(Arg(3)))) {
+ result = make_small(signed_val(xb(Arg(2))) % signed_val(xb(Arg(3))));
+ StoreBifResult(4, result);
+ }
+ DO_BIG_ARITH(ARITH_FUNC(int_rem),xb(Arg(2)),xb(Arg(3)));
+ }
+
OpCase(i_rem_jId):
{
Eterm result;