33 #ifndef RZ_IL_OPBUILDER_BEGIN_H
34 #define RZ_IL_OPBUILDER_BEGIN_H
38 #define ITE(c, t, f) rz_il_op_new_ite(c, t, f)
40 #define UN(l, val) rz_il_op_new_bitv_from_ut64(l, val)
41 #define U8(val) UN(8, val)
42 #define U16(val) UN(16, val)
43 #define U32(val) UN(32, val)
44 #define U64(val) UN(64, val)
46 #define SN(l, val) rz_il_op_new_bitv_from_st64(l, val)
47 #define S8(val) SN(8, val)
48 #define S16(val) SN(16, val)
49 #define S32(val) SN(32, val)
50 #define S64(val) SN(64, val)
52 #define IL_FALSE rz_il_op_new_b0()
53 #define IL_TRUE rz_il_op_new_b1()
54 #define INV(x) rz_il_op_new_bool_inv(x)
55 #define XOR(x, y) rz_il_op_new_bool_xor(x, y)
56 #define AND(x, y) rz_il_op_new_bool_and(x, y)
57 #define OR(x, y) rz_il_op_new_bool_or(x, y)
59 #define UNSIGNED(n, x) rz_il_op_new_unsigned(n, x)
60 #define SIGNED(n, x) rz_il_op_new_signed(n, x)
61 #define APPEND(high, low) rz_il_op_new_append(high, low)
62 #define DUP(op) rz_il_op_pure_dup(op)
64 #define ADD(x, y) rz_il_op_new_add(x, y)
65 #define SUB(x, y) rz_il_op_new_sub(x, y)
66 #define MUL(x, y) rz_il_op_new_mul(x, y)
67 #define DIV(x, y) rz_il_op_new_div(x, y)
68 #define SDIV(x, y) rz_il_op_new_sdiv(x, y)
69 #define SHIFTL(f, v, dist) rz_il_op_new_shiftl(f, v, dist)
70 #define SHIFTR(f, v, dist) rz_il_op_new_shiftr(f, v, dist)
71 #define SHIFTL0(v, dist) SHIFTL(IL_FALSE, v, dist)
72 #define SHIFTR0(v, dist) SHIFTR(IL_FALSE, v, dist)
73 #define SHIFTRA(v, dist) rz_il_op_new_shiftr_arith(v, dist)
74 #define LOGAND(x, y) rz_il_op_new_log_and(x, y)
75 #define LOGOR(x, y) rz_il_op_new_log_or(x, y)
76 #define LOGXOR(x, y) rz_il_op_new_log_xor(x, y)
77 #define LOGNOT(x) rz_il_op_new_log_not(x)
78 #define NEG(x) rz_il_op_new_neg(x)
80 #define NON_ZERO(x) rz_il_op_new_non_zero(x)
81 #define IS_ZERO(x) rz_il_op_new_is_zero(x)
82 #define MSB(x) rz_il_op_new_msb(x)
83 #define LSB(x) rz_il_op_new_lsb(x)
84 #define EQ(x, y) rz_il_op_new_eq(x, y)
85 #define ULT(x, y) rz_il_op_new_ult(x, y)
86 #define ULE(x, y) rz_il_op_new_ule(x, y)
87 #define UGT(x, y) rz_il_op_new_ugt(x, y)
88 #define UGE(x, y) rz_il_op_new_uge(x, y)
89 #define SLT(x, y) rz_il_op_new_slt(x, y)
90 #define SLE(x, y) rz_il_op_new_sle(x, y)
91 #define SGT(x, y) rz_il_op_new_sgt(x, y)
92 #define SGE(x, y) rz_il_op_new_sge(x, y)
94 #define LOAD(addr) rz_il_op_new_load(0, addr)
95 #define LOADW(n, addr) rz_il_op_new_loadw(0, addr, n)
96 #define STORE(addr, val) rz_il_op_new_store(0, addr, val)
97 #define STOREW(addr, val) rz_il_op_new_storew(0, addr, val)
99 #define VARG(name) rz_il_op_new_var(name, RZ_IL_VAR_KIND_GLOBAL)
100 #define VARL(name) rz_il_op_new_var(name, RZ_IL_VAR_KIND_LOCAL)
101 #define VARLP(name) rz_il_op_new_var(name, RZ_IL_VAR_KIND_LOCAL_PURE)
102 #define SETG(name, v) rz_il_op_new_set(name, false, v)
103 #define SETL(name, v) rz_il_op_new_set(name, true, v)
104 #define LET(name, v, body) rz_il_op_new_let(name, v, body)
106 #define SEQ2(e0, e1) rz_il_op_new_seq(e0, e1)
107 #define SEQ3(e0, e1, e2) rz_il_op_new_seqn(3, e0, e1, e2)
108 #define SEQ4(e0, e1, e2, e3) rz_il_op_new_seqn(4, e0, e1, e2, e3)
109 #define SEQ5(e0, e1, e2, e3, e4) rz_il_op_new_seqn(5, e0, e1, e2, e3, e4)
110 #define SEQ6(e0, e1, e2, e3, e4, e5) rz_il_op_new_seqn(6, e0, e1, e2, e3, e4, e5)
111 #define SEQ7(e0, e1, e2, e3, e4, e5, e6) rz_il_op_new_seqn(7, e0, e1, e2, e3, e4, e5, e6)
112 #define SEQ8(e0, e1, e2, e3, e4, e5, e6, e7) rz_il_op_new_seqn(8, e0, e1, e2, e3, e4, e5, e6, e7)
113 #define SEQ9(e0, e1, e2, e3, e4, e5, e6, e7, e8) rz_il_op_new_seqn(9, e0, e1, e2, e3, e4, e5, e6, e7, e8)
115 #define EMPTY() rz_il_op_new_empty()
116 #define NOP() rz_il_op_new_nop()
117 #define BRANCH(c, t, f) rz_il_op_new_branch(c, t, f)
118 #define REPEAT(c, b) rz_il_op_new_repeat(c, b)
119 #define JMP(tgt) rz_il_op_new_jmp(tgt)
120 #define GOTO(lbl) rz_il_op_new_goto(lbl)
signatures of core theory opcodes