aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-07-06 11:27:45 +0200
committerBjörn Gustavsson <[email protected]>2015-07-06 13:38:18 +0200
commit1ffb2647ffcc29170b461c31c018c5d2b046beae (patch)
treef053f4c1b74d73b67d61e16bcc8ddef5923e3040
parentc5755ae5ded3ba27dc5d884303ead232abc77a40 (diff)
downloadotp-1ffb2647ffcc29170b461c31c018c5d2b046beae.tar.gz
otp-1ffb2647ffcc29170b461c31c018c5d2b046beae.tar.bz2
otp-1ffb2647ffcc29170b461c31c018c5d2b046beae.zip
Improve unpacking performance on x86_64
When unpacking operands on 64-bit CPUs, use a smarter mask to help the compiler optimize the code. It turns out that on x86_64, if we use the mask 0xFFFFUL (selecting the 16 least significant bits), the compiler can combine a move and a mask operation into the single insruction 'movzwl', which will eliminate one instruction.
-rwxr-xr-xerts/emulator/utils/beam_makeops4
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops
index 06515c6346..f805e7cc64 100755
--- a/erts/emulator/utils/beam_makeops
+++ b/erts/emulator/utils/beam_makeops
@@ -629,8 +629,8 @@ sub emulator_output {
print "\n";
print "#ifdef ARCH_64\n";
print "# define BEAM_WIDE_MASK 0xFFFFUL\n";
- print "# define BEAM_LOOSE_MASK 0x1FFFUL\n";
- print "# define BEAM_TIGHT_MASK 0x1FF8UL\n";
+ print "# define BEAM_LOOSE_MASK 0xFFFFUL\n";
+ print "# define BEAM_TIGHT_MASK 0xFFFFUL\n";
print "# define BEAM_WIDE_SHIFT 32\n";
print "# define BEAM_LOOSE_SHIFT 16\n";
print "# define BEAM_TIGHT_SHIFT 16\n";