aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_emu.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-08-21 18:03:04 +0200
committerBjörn Gustavsson <[email protected]>2017-08-23 12:44:18 +0200
commit5bf73db9fd77bce195b7e78a8754730263068fb1 (patch)
tree56865b0805a23cf733a3af4130dba180ff720377 /erts/emulator/beam/beam_emu.c
parent8fc304e1e0c4a36dcb5abbe7a51de63ddc2cb285 (diff)
downloadotp-5bf73db9fd77bce195b7e78a8754730263068fb1.tar.gz
otp-5bf73db9fd77bce195b7e78a8754730263068fb1.tar.bz2
otp-5bf73db9fd77bce195b7e78a8754730263068fb1.zip
Add the 'S' type for a register source
The type 'd' could be used both for destination registers and source register. Restrict the 'd' type to only be used for destinations, and introduce the new 'S' type to be used when a source must be a register.
Diffstat (limited to 'erts/emulator/beam/beam_emu.c')
-rw-r--r--erts/emulator/beam/beam_emu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c
index badfe62aa9..482f99cb78 100644
--- a/erts/emulator/beam/beam_emu.c
+++ b/erts/emulator/beam/beam_emu.c
@@ -153,7 +153,7 @@ do { \
* Register target (X or Y register).
*/
-#define REG_TARGET_PTR(Target) (((Target) & 1) ? &yb(Target-1) : &xb(Target))
+#define REG_TARGET_PTR(Target) (((Target) & 1) ? &yb((Target)-1) : &xb(Target))
/*
* Special Beam instructions.
@@ -242,6 +242,7 @@ void** beam_ops;
#define tb(N) (N)
#define xb(N) (*(Eterm *) (((unsigned char *)reg) + (N)))
#define yb(N) (*(Eterm *) (((unsigned char *)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)