diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-01-11 07:47:42 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-01-11 07:47:42 -0800 |
commit | e9b3403ca46b64153914695cc3ab3eb6a0e057ac (patch) | |
tree | 321f27d7fc72ab524efe4fc33b1b2124c67f728a /vmop.h | |
parent | baa34c7282046e70dd6c3ca4c63ef865c1b351a0 (diff) | |
download | txr-e9b3403ca46b64153914695cc3ab3eb6a0e057ac.tar.gz txr-e9b3403ca46b64153914695cc3ab3eb6a0e057ac.tar.bz2 txr-e9b3403ca46b64153914695cc3ab3eb6a0e057ac.zip |
vm: derive duplicated constants from Lisp origin.
Some constnats in vm.c are hand-duplicates of ones in
vm-param.tl. Let's put them in vmop.h instead, where they can
be generated by the genvmop.txr script.
The two new constants are anticipated for some upcoming
VM work.
* genvmop.txr: Generate the existing VM_LEV_BITS,
VM_LEV_MASK, VM_SM_LEV_BITS and VM_SM_LEV_MASK from the
Lisp constants. Also, let's add two new ones.
* vm.c (VM_LEV_BITS, VM_LEV_MASK, VM_SM_LEV_BITS,
VM_SM_LEV_MASK): Preprocessor symbols removed.
* vmop.h (VM_LEV_BITS, VM_LEV_MASK, VM_SM_LEV_BITS,
VM_SM_LEV_MASK): Preprocessor symbols generated here with
identical values.
(VM_MAX_LEV, VM_MAX_V_LEV): New constants.
Diffstat (limited to 'vmop.h')
-rw-r--r-- | vmop.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -70,3 +70,10 @@ typedef enum vm_op { SETLX = 41, GETF = 42, } vm_op_t; + +#define VM_LEV_BITS 10 +#define VM_LEV_MASK 0x3FF +#define VM_SM_LEV_BITS 6 +#define VM_SM_LEV_MASK 0x3F +#define VM_MAX_LEV 63 +#define VM_MAX_V_LEV 61 |