Commit | Line | Data |
---|---|---|
b0ca878c | 1 | /* Copyright (C) 2001, 2009, 2012, 2013 Free Software Foundation, Inc. |
17e90c5e | 2 | * |
560b9c25 | 3 | * This library is free software; you can redistribute it and/or |
53befeb7 NJ |
4 | * modify it under the terms of the GNU Lesser General Public License |
5 | * as published by the Free Software Foundation; either version 3 of | |
6 | * the License, or (at your option) any later version. | |
17e90c5e | 7 | * |
53befeb7 NJ |
8 | * This library is distributed in the hope that it will be useful, but |
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
560b9c25 AW |
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
11 | * Lesser General Public License for more details. | |
17e90c5e | 12 | * |
560b9c25 AW |
13 | * You should have received a copy of the GNU Lesser General Public |
14 | * License along with this library; if not, write to the Free Software | |
53befeb7 NJ |
15 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
16 | * 02110-1301 USA | |
560b9c25 | 17 | */ |
17e90c5e | 18 | |
8f5cfc81 KN |
19 | #ifndef _SCM_INSTRUCTIONS_H_ |
20 | #define _SCM_INSTRUCTIONS_H_ | |
17e90c5e KN |
21 | |
22 | #include <libguile.h> | |
510ca126 AW |
23 | #include <libguile/vm-operations.h> |
24 | ||
095100bb AW |
25 | #ifdef BUILDING_LIBGUILE |
26 | ||
3fe96dd8 | 27 | enum scm_opcode |
510ca126 | 28 | { |
3fe96dd8 | 29 | #define ENUM(opcode, tag, name, meta) scm_op_##tag = opcode, |
510ca126 AW |
30 | FOR_EACH_VM_OPERATION(ENUM) |
31 | #undef ENUM | |
32 | }; | |
33 | ||
095100bb AW |
34 | #define SCM_PACK_OP_24(op,arg) (scm_op_##op | (arg) << 8) |
35 | #define SCM_PACK_OP_8_8_8(op,a,b,c) SCM_PACK_OP_24 (op, (a) | ((b) << 8) | ((c) << 16)) | |
36 | #define SCM_PACK_OP_8_16(op,a,b) SCM_PACK_OP_24 (op, (a) | (b) << 8) | |
37 | #define SCM_PACK_OP_16_8(op,a,b) SCM_PACK_OP_24 (op, (a) | (b) << 16) | |
38 | #define SCM_PACK_OP_12_12(op,a,b) SCM_PACK_OP_24 (op, (a) | (b) << 12) | |
39 | #define SCM_PACK_OP_ARG_8_24(a,b) ((a) | ((b) << 8)) | |
510ca126 | 40 | |
e6eb2467 | 41 | #define SCM_VM_NUM_INSTRUCTIONS (1<<8) |
53e28ed9 AW |
42 | #define SCM_VM_INSTRUCTION_MASK (SCM_VM_NUM_INSTRUCTIONS-1) |
43 | ||
095100bb AW |
44 | #endif /* BUILDING_LIBGUILE */ |
45 | ||
1b780c13 | 46 | SCM_INTERNAL SCM scm_instruction_list (void); |
510ca126 | 47 | |
560b9c25 AW |
48 | SCM_INTERNAL void scm_bootstrap_instructions (void); |
49 | SCM_INTERNAL void scm_init_instructions (void); | |
17e90c5e | 50 | |
8f5cfc81 | 51 | #endif /* _SCM_INSTRUCTIONS_H_ */ |
17e90c5e KN |
52 | |
53 | /* | |
54 | Local Variables: | |
55 | c-file-style: "gnu" | |
56 | End: | |
57 | */ |