summaryrefslogtreecommitdiff
path: root/libguile/instructions.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2018-07-03 11:13:27 +0200
committerAndy Wingo <wingo@pobox.com>2018-07-03 11:13:27 +0200
commitd6b8f6a658a4870a83d1f5c2d315ff7b43e1228c (patch)
tree47ab454127cffb5932e1253172348396fe83e4e0 /libguile/instructions.c
parent5b68bd7778daa6c3495d18c9d91914192577c689 (diff)
downloadguile-d6b8f6a658a4870a83d1f5c2d315ff7b43e1228c.tar.gz
Minor change to VM DSL
* libguile/instructions.c (DOP1, DOP2, DOP3, DOP4, DOP5): New parts of the DSL, equivalent to e.g. OP1(x) | OP_DST. Will allow other definitions of OP* that use token pasting. * libguile/vm-engine.c: Adapt to use new DOP descriptors.
Diffstat (limited to 'libguile/instructions.c')
-rw-r--r--libguile/instructions.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libguile/instructions.c b/libguile/instructions.c
index d93b6d06b..a9fdc0c19 100644
--- a/libguile/instructions.c
+++ b/libguile/instructions.c
@@ -117,6 +117,12 @@ static SCM word_type_symbols[] =
#define OP_DST (1 << (TYPE_WIDTH * 5))
+#define DOP1(t0) (OP1(t0) | OP_DST)
+#define DOP2(t0, t1) (OP2(t0, t1) | OP_DST)
+#define DOP3(t0, t1, t2) (OP3(t0, t1, t2) | OP_DST)
+#define DOP4(t0, t1, t2, t3) (OP4(t0, t1, t2, t3) | OP_DST)
+#define DOP5(t0, t1, t2, t3, t4) (OP5(t0, t1, t2, t3, t4) | OP_DST)
+
#define WORD_TYPE_AND_FLAG(n, word) \
(((word) >> ((n) * TYPE_WIDTH)) & ((1 << TYPE_WIDTH) - 1))
#define WORD_TYPE(n, word) \