summaryrefslogtreecommitdiffstats
path: root/genvmop.txr
blob: 7cc097e6963764ae3eeb559e52ba71b5e93f8c2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
@(in-package :sys)
@(mdo (find-struct-type 'assembler))
@(bind oc @(keep-if .code %oc-list-builder%.(get)))
@(next "vm.h")
@(collect)
@{copyright}
@(until)

@(end)
@(output "vmop.h")
@{copyright "\n"}

typedef enum vm_op {
@  (repeat)
  @{oc.symbol :filter :upcase} = @{oc.code},@(if oc.deprecated
                                               " /* deprecated */")
@  (end)
} vm_op_t;

#define VM_LEV_BITS @{sys:%lev-bits%}
#define VM_LEV_MASK @(fmt "0x~X" (pred (ash 1  sys:%lev-bits%)))
#define VM_SM_LEV_BITS @{sys:%sm-lev-bits%}
#define VM_SM_LEV_MASK @(fmt "0x~X" (pred (ash 1  sys:%sm-lev-bits%)))
#define VM_MAX_LEV @{sys:%max-lev%}
#define VM_MAX_V_LEV @{sys:%max-v-lev%}
#define VM_LEV_SIZE @{sys:%lev-size%}
@(end)