Tor 0.4.9.2-alpha-dev
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
instruction.h
1/* Copyright (c) 2020 tevador <tevador@gmail.com> */
2/* See LICENSE for licensing information */
3
4#ifndef INSTRUCTION_H
5#define INSTRUCTION_H
6
7#include <stdint.h>
8
9typedef enum instr_type {
10 INSTR_UMULH_R, /* unsigned high multiplication by a register */
11 INSTR_SMULH_R, /* signed high multiplication by a register */
12 INSTR_MUL_R, /* multiplication by a register */
13 INSTR_SUB_R, /* subtraction of a register */
14 INSTR_XOR_R, /* xor with a register */
15 INSTR_ADD_RS, /* addition of a shifted register */
16 INSTR_ROR_C, /* rotation by a constant */
17 INSTR_ADD_C, /* addition of a constant */
18 INSTR_XOR_C, /* xor with a constant */
19 INSTR_TARGET, /* branch instruction target */
20 INSTR_BRANCH, /* conditional branch */
21} instr_type;
22
23typedef struct instruction {
24 instr_type opcode;
25 int src;
26 int dst;
27 uint32_t imm32;
28 uint32_t op_par;
30
31#endif