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 /vm.c | |
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 'vm.c')
-rw-r--r-- | vm.c | 4 |
1 files changed, 0 insertions, 4 deletions
@@ -343,10 +343,6 @@ static void vm_reset(struct vm *vm, struct vm_desc *vd, #define vm_insn_bigop(insn) (((insn) & 0x3FFFFFFU)) #define vm_arg_operand_lo(arg) ((arg) & 0xFFFFU) #define vm_arg_operand_hi(arg) ((arg) >> 16) -#define VM_LEV_BITS 10 -#define VM_LEV_MASK 0x3FF -#define VM_SM_LEV_BITS 6 -#define VM_SM_LEV_MASK 0x3F #define vm_lev(arg) ((arg) >> VM_LEV_BITS) #define vm_idx(arg) ((arg) & VM_LEV_MASK) #define vm_sm_lev(arg) ((arg) >> VM_SM_LEV_BITS) |