|
Reduct
v4.1.3-1-gd06c383
A functional and immutable language.
|
Bytecode opcodes and properties. More...
Go to the source code of this file.
Data Structures | |
| struct | reduct_opcode_info_t |
| Opcode information structure. More... | |
Macros | |
| #define | REDUCT_OPCODE_BASE(_op) ((_op) & ~REDUCT_OPCODE_MODE_CONST) |
| Get the base form of the opcode without the constant bit set. | |
| #define | REDUCT_OPCODE_GET_NAME(_op) (reductOpcodeTable[REDUCT_OPCODE_BASE(_op)].name) |
| Get the name of an opcode. | |
| #define | REDUCT_OPCODE_GET_LAYOUT(_op) (reductOpcodeTable[REDUCT_OPCODE_BASE(_op)].layout) |
| Get the layout of an opcode. | |
| #define | REDUCT_OPCODE_IS_COMPARE(_op) (REDUCT_OPCODE_BASE(_op) >= REDUCT_OPCODE_EQ && REDUCT_OPCODE_BASE(_op) <= REDUCT_OPCODE_GE) |
| Check if an opcode is a comparison instruction. | |
| #define | REDUCT_OPCODE_TO_SKIP(_op) |
| Get the skip version of a comparison opcode. | |
| #define | REDUCT_OPCODE_INVERT_SKIP(_op) |
| Invert a skip comparison opcode (e.g. JEQ <-> JNEQ). | |
| #define | REDUCT_OPCODE_TO_RECUR(_op) |
| Get the recursive version of a call opcode. | |
| #define | REDUCT_OPCODE_TO_TAIL(_op) |
| Get the tail version of a call or return opcode. | |
| #define | REDUCT_OPCODE_HAS_TARGET(_op) (reductOpcodeTable[REDUCT_OPCODE_BASE(_op)].flags & REDUCT_OPCODE_FLAG_HAS_TARGET) |
| Check if an opcode modifies its target register (A). | |
| #define | REDUCT_OPCODE_IS_RECUR(_op) (reductOpcodeTable[REDUCT_OPCODE_BASE(_op)].flags & REDUCT_OPCODE_FLAG_IS_RECUR) |
| Check if an opcode is a recursive call. | |
| #define | REDUCT_OPCODE_IS_JUMP(_op) (reductOpcodeTable[REDUCT_OPCODE_BASE(_op)].flags & REDUCT_OPCODE_FLAG_IS_JUMP) |
| Check if an opcode is a jump instruction. | |
| #define | REDUCT_OPCODE_HAS_CONST(_op) (reductOpcodeTable[REDUCT_OPCODE_BASE(_op)].flags & REDUCT_OPCODE_FLAG_HAS_CONST) |
| Check if an opcode uses the C operand and has both a constant and register version. | |
| #define | REDUCT_OPCODE_READS_A(_op) (reductOpcodeTable[REDUCT_OPCODE_BASE(_op)].flags & REDUCT_OPCODE_FLAG_READ_A) |
| Check if an opcode reads from register A. | |
| #define | REDUCT_OPCODE_READS_B(_op) (reductOpcodeTable[REDUCT_OPCODE_BASE(_op)].flags & REDUCT_OPCODE_FLAG_READ_B) |
| Check if an opcode reads from register B. | |
| #define | REDUCT_OPCODE_READS_C(_op) (reductOpcodeTable[REDUCT_OPCODE_BASE(_op)].flags & REDUCT_OPCODE_FLAG_READ_C) |
| Check if an opcode reads from register/constant C. | |
| #define | REDUCT_OPCODE_READS_RANGE(_op) (reductOpcodeTable[REDUCT_OPCODE_BASE(_op)].flags & REDUCT_OPCODE_FLAG_READ_RANGE) |
| Check if an opcode reads a range of registers starting at A. | |
| #define | REDUCT_OPCODE_IS_COMMUTATIVE(_op) (reductOpcodeTable[REDUCT_OPCODE_BASE(_op)].flags & REDUCT_OPCODE_FLAG_IS_COMMUTATIVE) |
| Check if an opcode is commutative. | |
| #define | REDUCT_OPCODE_IS_SKIP(_op) (reductOpcodeTable[REDUCT_OPCODE_BASE(_op)].flags & REDUCT_OPCODE_FLAG_IS_SKIP) |
| Check if an opcode is a skip instruction. | |
| #define | REDUCT_OPCODE_IS_BRANCH(_op) (reductOpcodeTable[REDUCT_OPCODE_BASE(_op)].flags & (REDUCT_OPCODE_FLAG_IS_SKIP | REDUCT_OPCODE_FLAG_IS_JUMP)) |
| Check if an opcode is a skip or jump instruction. | |
| #define | REDUCT_OPCODE_IS_CALL(_op) (reductOpcodeTable[REDUCT_OPCODE_BASE(_op)].flags & REDUCT_OPCODE_FLAG_IS_CALL) |
| Check if an opcode is a function call. | |
| #define | REDUCT_OPCODE_IS_TERMINATOR(_op) (reductOpcodeTable[REDUCT_OPCODE_BASE(_op)].flags & REDUCT_OPCODE_FLAG_IS_TERMINATOR) |
| Check if an opcode is a terminator. | |
| #define | REDUCT_OPCODE_IS_BINARY(_op) |
| Check if an opcode is a binary operation (reads B and C). | |
| #define | REDUCT_OPCODE_IS_TERNARY(_op) |
| Check if an opcode is a ternary operation (reads A, B and C). | |
| #define | REDUCT_OPCODE_IS_UNARY(_op) |
| Check if an opcode is a unary operation (reads C only). | |
| #define | REDUCT_OPCODE_IS_FORK(_op) (reductOpcodeTable[REDUCT_OPCODE_BASE(_op)].flags & REDUCT_OPCODE_FLAG_IS_FORK) |
| Check if an opcode is a fork instruction. | |
Variables | |
| REDUCT_API const reduct_opcode_info_t | reductOpcodeTable [128] |
| Opcode information and flags table. | |
Bytecode opcodes and properties.
Definition in file opcode.h.