ROSE 0.11.145.192
InstructionEnumsMips.h
1/* Enum constants for MIPS architectures */
2#ifndef ROSE_BinaryAnalysis_InstructionEnumsMips_H
3#define ROSE_BinaryAnalysis_InstructionEnumsMips_H
4#include <featureTests.h>
5#ifdef ROSE_ENABLE_BINARY_ANALYSIS
6
7namespace Rose {
8namespace BinaryAnalysis {
9
10// MIPS major register numbers.
11enum MipsRegisterClass {
12 mips_regclass_gpr, // General purpose registers. Minors are 0..31.
13 mips_regclass_spr, // Special purpose registers. Minors are the MipsSpecialPurposeRegisters enum members.
14 mips_regclass_fpr, // Floating point registers. Minors are 0..31.
15 mips_regclass_fcsr, // Floating point control/status register. Minors are MipsFcsrMinor.
16 mips_regclass_cp0gpr, // General purpose registers for coprocessor 0. Minors are 0..31.
17 mips_regclass_cp2gpr, // Coprocessor 2 general purpose registers. Minors are implementation defined.
18 mips_regclass_cp2spr, // Coprocessor 2 special purpose (i.e., control) registers. Minors are implementation dfnd.
19 mips_regclass_sgpr, // Shadow general purpose registers.
20 mips_regclass_hw, // Hardware registers.
21};
22
23// Portions of the FCSR register. These are the minor numbers for mips_regclass_fcsr.
24enum MipsFcsrMinors {
25 mips_fcsr_all, // All bits of the FCSR.
26 mips_fcsr_fccr, // Bits that compose the FP condition codes register.
27 mips_fcsr_fexr, // Bits that compose the FP exceptions register.
28 mips_fcsr_fenr // Bits that compose the FP enables register.
29};
30
31// MIPS special purpose register minor numbers.
32enum MipsSpecialPurposeRegister {
33 mips_spr_hi, // Hi floating point result.
34 mips_spr_lo, // Lo floating point result.
35 mips_spr_pc, // Program counter.
36 mips_spr_fir, // Floating point implementation and revision register.
37 mips_spr_fcsr // Floating point control/status register (used to be known as FCR31)
38};
39
40// Major numbers for MIPS for RiscOperators::interrupt
41enum MipsInterruptMajor {
42 mips_signal_exception // The "SignalException" function from the MIPS ISA manual
43};
44
45// Minor interrupt numbers for RiscOperators::interrupt
46enum MipsInterruptMinor {
47 mips_breakpoint,
48 mips_integer_overflow,
49 mips_reserved_instruction
50};
51
52// MIPS data formats
53enum MipsDataFormat {
54 mips_fmt_w, // "word", 16 bit integral type
55 mips_fmt_l, // "long" (a.k.a., "double word"), 32 bit integral type
56 mips_fmt_s, // "single-precision", 32-bit floating-point type
57 mips_fmt_d, // "double-precision", 64-bit floating-point type
58 mips_fmt_ps // "paired-single", pair of 32-bit floating point types
59};
60
61// Kinds of MIPS instructions.
62enum MipsInstructionKind {
63 mips_unknown_instruction,
64 mips_abs_s, // Floating point absolute value single precision.
65 mips_abs_d, // Floating point absolute value double precision.
66 mips_abs_ps, // Floating point absolute value pair of single precision.
67 mips_add, // Add word.
68 mips_add_s, // Floating point add single precision.
69 mips_add_d, // Floating point add double precision.
70 mips_add_ps, // Floating point add pair of single precision.
71 mips_addi, // Add immediate word.
72 mips_addiu, // Add immediate unsigned word.
73 mips_addu, // Add unsigned word.
74 mips_alnv_ps, // Floating point align variable pair of single precision.
75 mips_and, // Bitwise logical AND.
76 mips_andi, // Bitwise logical AND immediate.
77 mips_b, // Unconditional branch.
78 mips_bal, // Branch and link.
79 mips_bc1f, // Branch on FP false.
80 mips_bc1fl, // Branch on FP false likely.
81 mips_bc1t, // Branch on FP true.
82 mips_bc1tl, // Branch on FP true likely.
83 mips_bc2f, // Branch on COP2 false.
84 mips_bc2fl, // Branch on COP2 false likely.
85 mips_bc2t, // Branch on COP2 true.
86 mips_bc2tl, // Branch on COP2 true likely.
87 mips_beq, // Branch on equal.
88 mips_beql, // Branch on equal likely.
89 mips_bgez, // Branch on greater than or equal to zero.
90 mips_bgezal, // Branch on greater than or equal to zero and link.
91 mips_bgezall, // Branch on greater than or equal to zero and link likely.
92 mips_bgezl, // Branch on greater than or equal to zero likely.
93 mips_bgtz, // Branch on greater than zero.
94 mips_bgtzl, // Branch on greater than zero likely.
95 mips_blez, // Branch on less than or equal to zero.
96 mips_blezl, // Branch on less than or equal to zero likely.
97 mips_bltz, // Branch on less than zero.
98 mips_bltzal, // Branch on less than zero and link.
99 mips_bltzall, // Branch on less than zero and link likely.
100 mips_bltzl, // Branch on less than zero likely.
101 mips_bne, // Branch on not equal.
102 mips_bnel, // Branch on not equal likely.
103 mips_break, // Break point.
104 mips_c_f_s, // Floating point compare false single precision.
105 mips_c_un_s, // Floating point compare unordered single precision.
106 mips_c_eq_s, // Floating point compare equal single precision.
107 mips_c_ueq_s, // Floating point compare unordered equal.
108 mips_c_olt_s, // Floating point compare ordered or less than single precision.
109 mips_c_ult_s, // Floating point compare unordered or less than single precision.
110 mips_c_ole_s, // Floating point compare ordered or less than or equal single precision.
111 mips_c_ule_s, // Floating point compare unordered or less than or equal single precision.
112 mips_c_sf_s, // Floating point compare signaling false single precision.
113 mips_c_ngle_s, // Floating point compare not greater than or less than or equal single precision.
114 mips_c_seq_s, // Floating point compare signaling equal single precision.
115 mips_c_ngl_s, // Floating point compare not greater than or less than single precision.
116 mips_c_lt_s, // Floating point compare less than single precision.
117 mips_c_nge_s, // Floating point compare not greater than or equal single precision.
118 mips_c_le_s, // Floating point compare less than or equal single precision.
119 mips_c_ngt_s, // Floating point compare not greater than single precision.
120 mips_c_f_d, // Floating point compare false double precision.
121 mips_c_un_d, // Floating point compare unordered double precision.
122 mips_c_eq_d, // Floating point compare equal double precision.
123 mips_c_ueq_d, // Floating point compare unordered equal.
124 mips_c_olt_d, // Floating point compare ordered or less than double precision.
125 mips_c_ult_d, // Floating point compare unordered or less than double precision.
126 mips_c_ole_d, // Floating point compare ordered or less than or equal double precision.
127 mips_c_ule_d, // Floating point compare unordered or less than or equal double precision.
128 mips_c_sf_d, // Floating point compare signaling false double precision.
129 mips_c_ngle_d, // Floating point compare not greater than or less than or equal double precision.
130 mips_c_seq_d, // Floating point compare signaling equal double precision.
131 mips_c_ngl_d, // Floating point compare not greater than or less than double precision.
132 mips_c_lt_d, // Floating point compare less than double precision.
133 mips_c_nge_d, // Floating point compare not greater than or equal double precision.
134 mips_c_le_d, // Floating point compare less than or equal double precision.
135 mips_c_ngt_d, // Floating point compare not greater than double precision.
136 mips_c_f_ps, // Floating point compare false pair of single precision.
137 mips_c_un_ps, // Floating point compare unordered pair of single precision.
138 mips_c_eq_ps, // Floating point compare equal pair of single precision.
139 mips_c_ueq_ps, // Floating point compare unordered equal.
140 mips_c_olt_ps, // Floating point compare ordered or less than pair of single precision.
141 mips_c_ult_ps, // Floating point compare unordered or less than pair of single precision.
142 mips_c_ole_ps, // Floating point compare ordered or less than or equal pair of single precision.
143 mips_c_ule_ps, // Floating point compare unordered or less than or equal pair of single precision.
144 mips_c_sf_ps, // Floating point compare signaling false pair of single precision.
145 mips_c_ngle_ps, // Floating point compare not greater than or less than or equal pair of single precision.
146 mips_c_seq_ps, // Floating point compare signaling equal pair of single precision.
147 mips_c_ngl_ps, // Floating point compare not greater than or less than pair of single precision.
148 mips_c_lt_ps, // Floating point compare less than pair of single precision.
149 mips_c_nge_ps, // Floating point compare not greater than or equal pair of single precision.
150 mips_c_le_ps, // Floating point compare less than or equal pair of single precision.
151 mips_c_ngt_ps, // Floating point compare not greater than pair of single precision.
152 mips_cache, // Perform cache operation.
153 mips_cachee, // Perform cache operation EVA.
154 mips_ceil_l_s, // Fixed point ceiling convert to long fixed point.
155 mips_ceil_l_d, // Fixed point ceiling convert to long fixed point.
156 mips_ceil_w_s, // Fixed point ceiling convert to word fixed point.
157 mips_ceil_w_d, // Fixed point ceiling convert to word fixed point.
158 mips_cfc1, // Move control word from floating point.
159 mips_cfc2, // Move control word from coprocessor 2.
160 mips_clo, // Count leading ones in word.
161 mips_clz, // Count leading zeros in word.
162 mips_cop2, // Coprocessor operation to coprocessor 2.
163 mips_ctc1, // Move control word to floating point.
164 mips_ctc2, // Move control word to coprocessor 2.
165 mips_cvt_d_s, // Floating point convert to double floating point.
166 mips_cvt_d_w, // Floating point convert to double floating point.
167 mips_cvt_d_l, // Floating point convert to double floating point.
168 mips_cvt_l_s, // Floating point convert to long fixed point.
169 mips_cvt_l_d, // Floating point convert to long fixed point.
170 mips_cvt_ps_s, // Floating point convert to paired single.
171 mips_cvt_s_d, // Floating point convert to single floating point.
172 mips_cvt_s_w, // Floating point convert to single floating point.
173 mips_cvt_s_l, // Floating point convert to single floating point.
174 mips_cvt_s_pl, // Floating point convert pair lower to single floating point.
175 mips_cvt_s_pu, // Floating point convert pair upper to single floating point.
176 mips_cvt_w_s, // Floating point convert to word fixed point.
177 mips_cvt_w_d, // Floating point convert to word fixed point.
178 mips_di, // Disable interrupts.
179 mips_div, // Divide word.
180 mips_div_s, // Floating point divide.
181 mips_div_d, // Floating point divide.
182 mips_divu, // Divide unsigned word.
183 mips_ehb, // Execution hazard barrier.
184 mips_ei, // Enable interrupts.
185 mips_eret, // Exception return.
186 mips_ext, // Extract bit field.
187 mips_floor_l_s, // Floating point floor convert to long fixed point.
188 mips_floor_l_d, // Floating point floor convert to long fixed point.
189 mips_floor_w_s, // Floating point floor convert to word fixed point.
190 mips_floor_w_d, // Floating point floor convert to word fixed point.
191 mips_ins, // Insert bit field.
192 mips_j, // Jump.
193 mips_jal, // Jump and link.
194 mips_jalr, // Jump and link register.
195 mips_jalr_hb, // Jump and link register with hazard barrier.
196 mips_jalx, // Jump and link exchange.
197 mips_jr, // Jump register.
198 mips_jr_hb, // Jump register with hazard barrier.
199 mips_lb, // Load byte.
200 mips_lbe, // Load byte EVA.
201 mips_lbu, // Load byte unsigned.
202 mips_lbue, // Load byte unsigned EVA.
203 mips_ldc1, // Load doubleword to floating point.
204 mips_ldc2, // Load doubleword to coprocessor 2.
205 mips_ldxc1, // Load doubleword indexed to floating point.
206 mips_lh, // Load halfword.
207 mips_lhe, // Load halfword EVA.
208 mips_lhu, // Load halfword unsigned.
209 mips_lhue, // Load halfword unsigned EVA.
210 mips_ll, // Load linked word.
211 mips_lle, // Load linked word EVA.
212 mips_lui, // Load upper immediate.
213 mips_luxc1, // Load doubleword indexed unaligned to floating point.
214 mips_lw, // Load word.
215 mips_lwc1, // Load word to floating point.
216 mips_lwc2, // Load word to coprocessor 2.
217 mips_lwe, // Load word EVA.
218 mips_lwl, // Load word left.
219 mips_lwle, // Load word left EVA.
220 mips_lwr, // Load word right.
221 mips_lwre, // Load word right EVA.
222 mips_lwu, // Load word unsigned.
223 mips_lwxc1, // Load word indexed to floating point.
224 mips_madd, // Multiply and add word to hi, lo.
225 mips_madd_s, // Floating point multiply add.
226 mips_madd_d, // Floating point multiply add.
227 mips_madd_ps, // Floating point multiply add.
228 mips_maddu, // Multiply and add unsigned word to hi, lo.
229 mips_mfc0, // Move from coprocessor 0.
230 mips_mfc1, // Move word from coprocessor 1.
231 mips_mfc2, // Move word from coprocessor 2.
232 mips_mfhc1, // Move word from high half of floating point register.
233 mips_mfhc2, // Move word from high half of coprocessor 2.
234 mips_mfhi, // Move from hi register.
235 mips_mflo, // Move from lo register.
236 mips_mov_s, // Floating point move.
237 mips_mov_d, // Floating point move.
238 mips_mov_ps, // Floating point move.
239 mips_movf, // Move conditional on floating point false.
240 mips_movf_s, // Floating point move conditional on floating point false.
241 mips_movf_d, // Floating point move conditional on floating point false.
242 mips_movf_ps, // Floating point move conditional on floating point false.
243 mips_movn, // Move conditional on not zero.
244 mips_movn_s, // Move floating point conditional on not zero.
245 mips_movn_d, // Move floating point conditional on not zero.
246 mips_movn_ps, // Move floating point conditional on not zero.
247 mips_movt, // Move conditional on floating piont true.
248 mips_movt_s, // Floating point move conditional on floating point true.
249 mips_movt_d, // Floating point move conditional on floating point true.
250 mips_movt_ps, // Floating point move conditional on floating point true.
251 mips_movz, // Move conditional on zero.
252 mips_movz_s, // Floating point move conditional on zero.
253 mips_movz_d, // Floating point move conditional on zero.
254 mips_movz_ps, // Floating point move conditional on zero.
255 mips_msub, // Multiply and subtract word.
256 mips_msub_s, // Floating point multiple and subtract.
257 mips_msub_d, // Floating point multiple and subtract.
258 mips_msub_ps, // Floating point multiple and subtract.
259 mips_msubu, // Multiply and subtract word to hi, lo.
260 mips_mtc0, // Move to coprocessor 0.
261 mips_mtc1, // Move word to floating point.
262 mips_mtc2, // Move word to coprocessor 2.
263 mips_mthc1, // Move word to high half of floating point register.
264 mips_mthc2, // Move word to high half of coprocessor 2 register.
265 mips_mthi, // Move to hi register.
266 mips_mtlo, // Move to lo register.
267 mips_mul, // Multiply word to GPR.
268 mips_mul_s, // Floating point multiply.
269 mips_mul_d, // Floating point multiply.
270 mips_mul_ps, // Floating point multiply.
271 mips_mult, // Multiply word.
272 mips_multu, // Multiply unsigned word.
273 mips_neg_s, // Floating point negate.
274 mips_neg_d, // Floating point negate.
275 mips_neg_ps, // Floating point negate.
276 mips_nmadd_s, // Floating point negative multiply add.
277 mips_nmadd_d, // Floating point negative multiply add.
278 mips_nmadd_ps, // Floating point negative multiply add.
279 mips_nmsub_s, // Floating point negative multply subtract.
280 mips_nmsub_d, // Floating point negative multply subtract.
281 mips_nmsub_ps, // Floating point negative multply subtract.
282 mips_nop, // No operation.
283 mips_nor, // Not OR.
284 mips_or, // Bitwise OR.
285 mips_ori, // Bitwise OR immediate.
286 mips_pause, // Wait for the LLBit to clear.
287 mips_pll_ps, // Pair lower lower.
288 mips_plu_ps, // Pair lower upper.
289 mips_pref, // Prefetch.
290 mips_prefe, // Prefetch EVA.
291 mips_prefx, // Prefetch indexed.
292 mips_pul_ps, // Pair upper lower.
293 mips_puu_ps, // Pair upper upper.
294 mips_rdhwr, // Read hardware register.
295 mips_rdpgpr, // Read GPR from previous shadow set.
296 mips_recip_s, // Reciprocal approximation.
297 mips_recip_d, // Reciprocal approximation.
298 mips_rotr, // Rotate word right.
299 mips_rotrv, // Rotate word right variable.
300 mips_round_l_s, // Floating point round to long fixed point.
301 mips_round_l_d, // Floating point round to long fixed point.
302 mips_round_w_s, // Floating point round to word fixed point.
303 mips_round_w_d, // Floating point round to word fixed point.
304 mips_rsqrt_s, // Reciprocal square root approximation.
305 mips_rsqrt_d, // Reciprocal square root approximation.
306 mips_sb, // Store byte.
307 mips_sbe, // Store byte EVA.
308 mips_sc, // Store conditional word.
309 mips_sce, // Store conditional word EVA.
310 mips_sdc1, // Store doubleword from floating point.
311 mips_sdc2, // Store doubleword from coprocessor 2.
312 mips_sdxc1, // Store doubleword indexed from floating point.
313 mips_seb, // Sign extend byte.
314 mips_seh, // Sign extend halfword.
315 mips_sh, // Store halfword.
316 mips_she, // Store halfword EVA.
317 mips_sll, // Shift word left logical.
318 mips_sllv, // Shift word left logical variable.
319 mips_slt, // Set on less than.
320 mips_slti, // Set on less than immediate.
321 mips_sltiu, // Set on less than immediate unsigned.
322 mips_sltu, // Set on less than unsigned.
323 mips_sqrt_s, // Floating point square root.
324 mips_sqrt_d, // Floating point square root.
325 mips_sra, // Shift word right arithmetic.
326 mips_srav, // Shift word right arithmetic variable.
327 mips_srl, // Shift right logical.
328 mips_srlv, // Shift right logical value.
329 mips_ssnop, // Superscalar no operation.
330 mips_sub, // Subtract word.
331 mips_sub_s, // Subtract floating point.
332 mips_sub_d, // Subtract floating point.
333 mips_sub_ps, // Subtract floating point.
334 mips_subu, // Subtract unsigned word.
335 mips_suxc1, // Store doubleword indexed unaligned from floating point.
336 mips_sw, // Store word.
337 mips_swc1, // Store word from floating point.
338 mips_swc2, // Store word from coprocessor 2.
339 mips_swe, // Store word EVA.
340 mips_swl, // Store word left.
341 mips_swle, // Store word left EVA.
342 mips_swr, // Store word right.
343 mips_swre, // Store word right EVA.
344 mips_swxc1, // Store word indexed from floating point.
345 mips_sync, // Synchronize.
346 mips_synci, // Synchronize caches to make instruction writes effective.
347 mips_syscall, // System call.
348 mips_teq, // Trap if equal.
349 mips_teqi, // Trap if equal immediate.
350 mips_tge, // Trap if greater or equal.
351 mips_tgei, // Trap if greater or equal immediate.
352 mips_tgeiu, // Trap if greater or equal immediate unsigned.
353 mips_tgeu, // Trap if greater or equal unsigned.
354 mips_tlbinv, // TLB invalidate.
355 mips_tlbinvf, // TLB invalidate flush.
356 mips_tlbp, // Probe TLB for matching entry.
357 mips_tlbr, // Read indexed TLB entry.
358 mips_tlbwi, // Write indexed TLB entry.
359 mips_tlbwr, // Write random TLB entry.
360 mips_tlt, // Trap if less than.
361 mips_tlti, // Trap if less than immediate.
362 mips_tltiu, // Trap if less than immediate unsigned.
363 mips_tltu, // Trap if less than unsigned.
364 mips_tne, // Trap if not equal.
365 mips_tnei, // Trap if not equal immediate.
366 mips_trunc_l_s, // Floating point truncate to long fixed point.
367 mips_trunc_l_d, // Floating point truncate to long fixed point.
368 mips_trunc_w_s, // Floating point truncate to word fixed point.
369 mips_trunc_w_d, // Floating point truncate to word fixed point.
370 mips_wait, // Enter standby mode.
371 mips_wrpgpr, // Write to GPR in previous shadow set.
372 mips_wsbh, // Word swap bytes within halfwords.
373 mips_xor, // Exclusive OR.
374 mips_xori, // Exclusive OR immediate.
375
376 mips_last_instruction // must be last enum member
377};
378
379} // namespace
380} // namespace
381
382#endif
383#endif
The ROSE library.