aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_emu.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-09-19 11:56:45 +0200
committerBjörn Gustavsson <[email protected]>2017-10-05 12:37:57 +0200
commitf88bd45a2c76f84a16b004922945579898cc35ac (patch)
tree22ffd02d93cd1d0f7b03780e84f3c5ada3a86139 /erts/emulator/beam/beam_emu.c
parent22d2a00aebf0eef878af95d8b7598adbfca06e7e (diff)
downloadotp-f88bd45a2c76f84a16b004922945579898cc35ac.tar.gz
otp-f88bd45a2c76f84a16b004922945579898cc35ac.tar.bz2
otp-f88bd45a2c76f84a16b004922945579898cc35ac.zip
Pack operands into the instruction word
On 64-bit machines where the C code is always at address below 4Gb, pack one or more operands into the instruction word.
Diffstat (limited to 'erts/emulator/beam/beam_emu.c')
-rw-r--r--erts/emulator/beam/beam_emu.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c
index 6a45087a34..73c4e3532b 100644
--- a/erts/emulator/beam/beam_emu.c
+++ b/erts/emulator/beam/beam_emu.c
@@ -234,15 +234,18 @@ void** beam_ops;
#define fb(N) ((Sint)(Sint32)(N))
#define jb(N) ((Sint)(Sint32)(N))
#define tb(N) (N)
-#define xb(N) (*(Eterm *) (((unsigned char *)reg) + (N)))
-#define yb(N) (*(Eterm *) (((unsigned char *)E) + (N)))
+#define xb(N) (*ADD_BYTE_OFFSET(reg, N))
+#define yb(N) (*ADD_BYTE_OFFSET(E, N))
#define Sb(N) (*REG_TARGET_PTR(N))
#define lb(N) (*(double *) (((unsigned char *)&(freg[0].fd)) + (N)))
#define Qb(N) (N)
#define Ib(N) (N)
+
#define x(N) reg[N]
#define y(N) E[N]
#define r(N) x(N)
+#define Q(N) (N*sizeof(Eterm *))
+#define l(N) (freg[N].fd)
/*
* Check that we haven't used the reductions and jump to function pointed to by