libTriton version 1.0 build 1592
Loading...
Searching...
No Matches
riscvSemantics.hpp
Go to the documentation of this file.
1
2/*
3** Copyright (C) - Triton
4**
5** This program is under the terms of the Apache License 2.0.
6*/
7
8#ifndef TRITON_RISCVSEMANTICS_H
9#define TRITON_RISCVSEMANTICS_H
10
11#include <triton/archEnums.hpp>
13#include <triton/dllexport.hpp>
15#include <triton/modes.hpp>
19
20
21
23namespace triton {
30 namespace arch {
38 namespace riscv {
48 private:
50 triton::arch::Architecture* architecture;
51
54
57
60
63
66
67 public:
69 TRITON_EXPORT riscvSemantics(triton::arch::Architecture* architecture,
72 const triton::modes::SharedModes& modes,
73 const triton::ast::SharedAstContext& astCtxt);
74
77
78 private:
80 void controlFlow_s(triton::arch::Instruction& inst);
81
83 void add_s(triton::arch::Instruction& inst);
84
86 void addi_s(triton::arch::Instruction& inst);
87
89 void addi_mv_s(triton::arch::Instruction& inst);
90
92 void addiw_s(triton::arch::Instruction& inst);
93
95 void addw_s(triton::arch::Instruction& inst);
96
98 void and_s(triton::arch::Instruction& inst);
99
101 void andi_s(triton::arch::Instruction& inst);
102
104 void auipc_s(triton::arch::Instruction& inst);
105
107 void beq_s(triton::arch::Instruction& inst);
108
110 void bge_s(triton::arch::Instruction& inst);
111
113 void bgeu_s(triton::arch::Instruction& inst);
114
116 void blt_s(triton::arch::Instruction& inst);
117
119 void bltu_s(triton::arch::Instruction& inst);
120
122 void bne_s(triton::arch::Instruction& inst);
123
125 void c_add_s(triton::arch::Instruction& inst);
126
128 void c_addi_s(triton::arch::Instruction& inst);
129
131 void c_addi16sp_s(triton::arch::Instruction& inst);
132
134 void c_addi4spn_s(triton::arch::Instruction& inst);
135
137 void c_addiw_s(triton::arch::Instruction& inst);
138
140 void c_addw_s(triton::arch::Instruction& inst);
141
143 void c_and_s(triton::arch::Instruction& inst);
144
146 void c_andi_s(triton::arch::Instruction& inst);
147
149 void c_beqz_s(triton::arch::Instruction& inst);
150
152 void c_bnez_s(triton::arch::Instruction& inst);
153
155 void c_jal_s(triton::arch::Instruction& inst);
156
158 void c_jalr_s(triton::arch::Instruction& inst);
159
161 void c_ld_s(triton::arch::Instruction& inst);
162
164 void c_ldsp_s(triton::arch::Instruction& inst);
165
167 void c_li_s(triton::arch::Instruction& inst);
168
170 void c_lw_s(triton::arch::Instruction& inst);
171
173 void c_lwsp_s(triton::arch::Instruction& inst);
174
176 void c_mv_s(triton::arch::Instruction& inst);
177
179 void c_nop_s(triton::arch::Instruction& inst);
180
182 void c_or_s(triton::arch::Instruction& inst);
183
185 void c_sd_s(triton::arch::Instruction& inst);
186
188 void c_sdsp_s(triton::arch::Instruction& inst);
189
191 void c_slli_s(triton::arch::Instruction& inst);
192
194 void c_srai_s(triton::arch::Instruction& inst);
195
197 void c_srli_s(triton::arch::Instruction& inst);
198
200 void c_sub_s(triton::arch::Instruction& inst);
201
203 void c_subw_s(triton::arch::Instruction& inst);
204
206 void c_sw_s(triton::arch::Instruction& inst);
207
209 void c_swsp_s(triton::arch::Instruction& inst);
210
212 void c_xor_s(triton::arch::Instruction& inst);
213
215 void div_s(triton::arch::Instruction& inst);
216
218 void divu_s(triton::arch::Instruction& inst);
219
221 void divuw_s(triton::arch::Instruction& inst);
222
224 void divw_s(triton::arch::Instruction& inst);
225
227 void jal_s(triton::arch::Instruction& inst);
228
230 void jal_j_s(triton::arch::Instruction& inst);
231
233 void jalr_s(triton::arch::Instruction& inst);
234
236 void jalr_no_link_s(triton::arch::Instruction& inst);
237
239 void lb_s(triton::arch::Instruction& inst);
240
242 void lbu_s(triton::arch::Instruction& inst);
243
245 void ld_s(triton::arch::Instruction& inst);
246
248 void lh_s(triton::arch::Instruction& inst);
249
251 void lhu_s(triton::arch::Instruction& inst);
252
254 void lui_s(triton::arch::Instruction& inst);
255
257 void lw_s(triton::arch::Instruction& inst);
258
260 void lwu_s(triton::arch::Instruction& inst);
261
263 void mul_s(triton::arch::Instruction& inst);
264
266 void mulh_s(triton::arch::Instruction& inst);
267
269 void mulhsu_s(triton::arch::Instruction& inst);
270
272 void mulhu_s(triton::arch::Instruction& inst);
273
275 void mulw_s(triton::arch::Instruction& inst);
276
278 void or_s(triton::arch::Instruction& inst);
279
281 void ori_s(triton::arch::Instruction& inst);
282
284 void rem_s(triton::arch::Instruction& inst);
285
287 void remu_s(triton::arch::Instruction& inst);
288
290 void remuw_s(triton::arch::Instruction& inst);
291
293 void remw_s(triton::arch::Instruction& inst);
294
296 void sb_s(triton::arch::Instruction& inst);
297
299 void sd_s(triton::arch::Instruction& inst);
300
302 void sh_s(triton::arch::Instruction& inst);
303
305 void sll_s(triton::arch::Instruction& inst);
306
308 void slli_s(triton::arch::Instruction& inst);
309
311 void slliw_s(triton::arch::Instruction& inst);
312
314 void sllw_s(triton::arch::Instruction& inst);
315
317 void slt_s(triton::arch::Instruction& inst);
318
320 void slt_sgtz_s(triton::arch::Instruction& inst);
321
323 void slt_sltz_s(triton::arch::Instruction& inst);
324
326 void slti_s(triton::arch::Instruction& inst);
327
329 void sltiu_s(triton::arch::Instruction& inst);
330
332 void sltiu_seqz_s(triton::arch::Instruction& inst);
333
335 void sltu_s(triton::arch::Instruction& inst);
336
338 void sltu_snez_s(triton::arch::Instruction& inst);
339
341 void sra_s(triton::arch::Instruction& inst);
342
344 void srai_s(triton::arch::Instruction& inst);
345
347 void sraiw_s(triton::arch::Instruction& inst);
348
350 void sraw_s(triton::arch::Instruction& inst);
351
353 void srl_s(triton::arch::Instruction& inst);
354
356 void srli_s(triton::arch::Instruction& inst);
357
359 void srliw_s(triton::arch::Instruction& inst);
360
362 void srlw_s(triton::arch::Instruction& inst);
363
365 void sub_s(triton::arch::Instruction& inst);
366
368 void subw_s(triton::arch::Instruction& inst);
369
371 void sw_s(triton::arch::Instruction& inst);
372
374 void xor_s(triton::arch::Instruction& inst);
375
377 void xori_s(triton::arch::Instruction& inst);
378 };
379
381 };
383 };
385};
386
387#endif /* TRITON_RISCVSEMANTICS_H */
388
The abstract architecture class.
This class is used to represent an instruction.
This interface is used as abstract semantics interface. All ISA semantics must use this interface.
TRITON_EXPORT riscvSemantics(triton::arch::Architecture *architecture, triton::engines::symbolic::SymbolicEngine *symbolicEngine, triton::engines::taint::TaintEngine *taintEngine, const triton::modes::SharedModes &modes, const triton::ast::SharedAstContext &astCtxt)
Constructor.
TRITON_EXPORT triton::arch::exception_e buildSemantics(triton::arch::Instruction &inst)
Builds the semantics of the instruction. Returns triton::arch::NO_FAULT if succeed.
std::shared_ptr< triton::ast::AstContext > SharedAstContext
Shared AST context.
Definition ast.hpp:65
std::shared_ptr< triton::modes::Modes > SharedModes
Shared Modes.
Definition modes.hpp:66
The Triton namespace.