Rizin
unix-like reverse engineering framework and cli tools
rsp_idec.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2016 bobby.smiles32 <bobby.smiles32@gmail.com>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 #ifndef RZ_ASM_ARCH_RSP_RSP_IDEC_H
4 #define RZ_ASM_ARCH_RSP_RSP_IDEC_H
5 
6 #include <rz_types.h>
7 
8 extern const char *rsp_gp_reg_soft_names[];
9 extern const char *rsp_c0_reg_soft_names[];
10 extern const char *rsp_gp_reg_names[];
11 extern const char *rsp_c0_reg_names[];
12 extern const char *rsp_c2_creg_names[];
13 extern const char *rsp_c2_accu_names[];
14 extern const char *rsp_c2_vreg_names[];
15 extern const char *rsp_c2_vreg_element_names[];
16 
17 enum {
18  RSP_DMEM_OFFSET = 0x0000,
19  RSP_IMEM_OFFSET = 0x1000
20 };
21 
22 /* restrict address inside rsp MEM */
23 static inline ut64 rsp_mem_addr(ut64 addr, ut64 base) {
24  addr &= 0xfff;
25  addr |= base;
26  return addr;
27 }
28 
29 typedef enum {
144  RSP_OP_SW
146 
147 typedef enum {
148  RSP_OPND_GP_REG, /* u=reg_num */
149  RSP_OPND_TARGET, /* u=imem_address */
150  RSP_OPND_OFFSET, /* u=imem_address, s=offset */
151  RSP_OPND_ZIMM, /* u=zero-extended imm */
152  RSP_OPND_SIMM, /* s=sign extended imm */
153  RSP_OPND_SHIFT_AMOUNT, /* u=shift amount */
154  RSP_OPND_BASE_OFFSET, /* u=reg_numm, s=offset */
155  RSP_OPND_C0_REG, /* u=reg_num */
156  RSP_OPND_C2_CREG, /* u=reg_num */
157  RSP_OPND_C2_ACCU, /* u=reg_num */
158  RSP_OPND_C2_VREG, /* u=reg_num */
159  RSP_OPND_C2_VREG_BYTE, /* u=reg_num, s=byte element (0-15) */
160  RSP_OPND_C2_VREG_SCALAR, /* u=reg_num, s=scalar element (0-7) */
161  RSP_OPND_C2_VREG_ELEMENT /* u=reg_num, s=element (0-15) */
163 
164 typedef struct {
168 } rsp_operand;
169 
170 enum { RSP_MAX_OPNDS = 3 };
171 
172 typedef struct {
173  const char *mnemonic;
178 
180 
181 #endif
uint32_t ut32
static ut64 rsp_mem_addr(ut64 addr, ut64 base)
Definition: rsp_idec.h:23
@ RSP_MAX_OPNDS
Definition: rsp_idec.h:170
rsp_instruction rsp_instruction_decode(ut64 pc, ut32 iw)
Definition: rsp_idec.c:587
const char * rsp_c0_reg_soft_names[]
Definition: rsp_idec.c:13
const char * rsp_gp_reg_soft_names[]
Definition: rsp_idec.c:6
const char * rsp_c0_reg_names[]
Definition: rsp_idec.c:55
@ RSP_IMEM_OFFSET
Definition: rsp_idec.h:19
@ RSP_DMEM_OFFSET
Definition: rsp_idec.h:18
rsp_operand_type
Definition: rsp_idec.h:147
@ RSP_OPND_OFFSET
Definition: rsp_idec.h:150
@ RSP_OPND_BASE_OFFSET
Definition: rsp_idec.h:154
@ RSP_OPND_C2_ACCU
Definition: rsp_idec.h:157
@ RSP_OPND_C2_CREG
Definition: rsp_idec.h:156
@ RSP_OPND_SIMM
Definition: rsp_idec.h:152
@ RSP_OPND_C0_REG
Definition: rsp_idec.h:155
@ RSP_OPND_SHIFT_AMOUNT
Definition: rsp_idec.h:153
@ RSP_OPND_ZIMM
Definition: rsp_idec.h:151
@ RSP_OPND_C2_VREG_ELEMENT
Definition: rsp_idec.h:161
@ RSP_OPND_C2_VREG
Definition: rsp_idec.h:158
@ RSP_OPND_C2_VREG_BYTE
Definition: rsp_idec.h:159
@ RSP_OPND_C2_VREG_SCALAR
Definition: rsp_idec.h:160
@ RSP_OPND_TARGET
Definition: rsp_idec.h:149
@ RSP_OPND_GP_REG
Definition: rsp_idec.h:148
const char * rsp_c2_vreg_names[]
Definition: rsp_idec.c:68
const char * rsp_c2_accu_names[]
Definition: rsp_idec.c:64
const char * rsp_gp_reg_names[]
Definition: rsp_idec.c:20
const char * rsp_c2_creg_names[]
Definition: rsp_idec.c:60
const char * rsp_c2_vreg_element_names[]
Definition: rsp_idec.c:75
rsp_opcode
Definition: rsp_idec.h:29
@ RSP_OP_VMUDM
Definition: rsp_idec.h:63
@ RSP_OP_LPV
Definition: rsp_idec.h:106
@ RSP_OP_STV
Definition: rsp_idec.h:122
@ RSP_OP_SUV
Definition: rsp_idec.h:118
@ RSP_OP_VMADN
Definition: rsp_idec.h:70
@ RSP_OP_LB
Definition: rsp_idec.h:137
@ RSP_OP_JR
Definition: rsp_idec.h:38
@ RSP_OP_VCR
Definition: rsp_idec.h:84
@ RSP_OP_XORI
Definition: rsp_idec.h:135
@ RSP_OP_SUB
Definition: rsp_idec.h:42
@ RSP_OP_LHU
Definition: rsp_idec.h:141
@ RSP_OP_VRSQH
Definition: rsp_idec.h:98
@ RSP_OP_VOR
Definition: rsp_idec.h:88
@ RSP_OP_SDV
Definition: rsp_idec.h:114
@ RSP_OP_VNXOR
Definition: rsp_idec.h:91
@ RSP_OP_ADDIU
Definition: rsp_idec.h:130
@ RSP_OP_LBU
Definition: rsp_idec.h:140
@ RSP_OP_SRLV
Definition: rsp_idec.h:36
@ RSP_OP_VNOP
Definition: rsp_idec.h:99
@ RSP_OP_VMRG
Definition: rsp_idec.h:85
@ RSP_OP_LBV
Definition: rsp_idec.h:100
@ RSP_OP_VAND
Definition: rsp_idec.h:86
@ RSP_OP_MFC2
Definition: rsp_idec.h:56
@ RSP_OP_INVALID
Definition: rsp_idec.h:30
@ RSP_OP_SPV
Definition: rsp_idec.h:117
@ RSP_OP_OR
Definition: rsp_idec.h:45
@ RSP_OP_LH
Definition: rsp_idec.h:138
@ RSP_OP_VRSQL
Definition: rsp_idec.h:97
@ RSP_OP_VADD
Definition: rsp_idec.h:72
@ RSP_OP_LLV
Definition: rsp_idec.h:102
@ RSP_OP_VRSQ
Definition: rsp_idec.h:96
@ RSP_OP_LSV
Definition: rsp_idec.h:101
@ RSP_OP_BLTZAL
Definition: rsp_idec.h:52
@ RSP_OP_BEQ
Definition: rsp_idec.h:125
@ RSP_OP_VMADH
Definition: rsp_idec.h:71
@ RSP_OP_VRCPH
Definition: rsp_idec.h:94
@ RSP_OP_SUBU
Definition: rsp_idec.h:43
@ RSP_OP_VGE
Definition: rsp_idec.h:81
@ RSP_OP_SFV
Definition: rsp_idec.h:120
@ RSP_OP_SB
Definition: rsp_idec.h:142
@ RSP_OP_BLEZ
Definition: rsp_idec.h:127
@ RSP_OP_BGEZAL
Definition: rsp_idec.h:53
@ RSP_OP_SRA
Definition: rsp_idec.h:34
@ RSP_OP_LUV
Definition: rsp_idec.h:107
@ RSP_OP_VMADL
Definition: rsp_idec.h:68
@ RSP_OP_SLTI
Definition: rsp_idec.h:131
@ RSP_OP_LHV
Definition: rsp_idec.h:108
@ RSP_OP_BGEZ
Definition: rsp_idec.h:51
@ RSP_OP_BNE
Definition: rsp_idec.h:126
@ RSP_OP_VABS
Definition: rsp_idec.h:74
@ RSP_OP_ADDU
Definition: rsp_idec.h:41
@ RSP_OP_J
Definition: rsp_idec.h:123
@ RSP_OP_SLL
Definition: rsp_idec.h:32
@ RSP_OP_VMACF
Definition: rsp_idec.h:66
@ RSP_OP_LUI
Definition: rsp_idec.h:136
@ RSP_OP_MFC0
Definition: rsp_idec.h:54
@ RSP_OP_VMOV
Definition: rsp_idec.h:95
@ RSP_OP_VMULU
Definition: rsp_idec.h:61
@ RSP_OP_VMUDL
Definition: rsp_idec.h:62
@ RSP_OP_SRAV
Definition: rsp_idec.h:37
@ RSP_OP_SLV
Definition: rsp_idec.h:113
@ RSP_OP_LQV
Definition: rsp_idec.h:104
@ RSP_OP_MTC0
Definition: rsp_idec.h:55
@ RSP_OP_SLTU
Definition: rsp_idec.h:49
@ RSP_OP_CTC2
Definition: rsp_idec.h:59
@ RSP_OP_VCL
Definition: rsp_idec.h:82
@ RSP_OP_XOR
Definition: rsp_idec.h:46
@ RSP_OP_ADDI
Definition: rsp_idec.h:129
@ RSP_OP_MTC2
Definition: rsp_idec.h:57
@ RSP_OP_SWV
Definition: rsp_idec.h:121
@ RSP_OP_ANDI
Definition: rsp_idec.h:133
@ RSP_OP_BREAK
Definition: rsp_idec.h:39
@ RSP_OP_LW
Definition: rsp_idec.h:139
@ RSP_OP_SBV
Definition: rsp_idec.h:111
@ RSP_OP_SSV
Definition: rsp_idec.h:112
@ RSP_OP_VNAND
Definition: rsp_idec.h:87
@ RSP_OP_VRCP
Definition: rsp_idec.h:92
@ RSP_OP_JAL
Definition: rsp_idec.h:124
@ RSP_OP_SLTIU
Definition: rsp_idec.h:132
@ RSP_OP_VCH
Definition: rsp_idec.h:83
@ RSP_OP_NOR
Definition: rsp_idec.h:47
@ RSP_OP_VMUDN
Definition: rsp_idec.h:64
@ RSP_OP_VMACU
Definition: rsp_idec.h:67
@ RSP_OP_VSUB
Definition: rsp_idec.h:73
@ RSP_OP_VSAR
Definition: rsp_idec.h:77
@ RSP_OP_VXOR
Definition: rsp_idec.h:90
@ RSP_OP_SW
Definition: rsp_idec.h:144
@ RSP_OP_SLLV
Definition: rsp_idec.h:35
@ RSP_OP_BGTZ
Definition: rsp_idec.h:128
@ RSP_OP_VLT
Definition: rsp_idec.h:78
@ RSP_OP_SQV
Definition: rsp_idec.h:115
@ RSP_OP_ORI
Definition: rsp_idec.h:134
@ RSP_OP_VNOR
Definition: rsp_idec.h:89
@ RSP_OP_NOP
Definition: rsp_idec.h:31
@ RSP_OP_SLT
Definition: rsp_idec.h:48
@ RSP_OP_SHV
Definition: rsp_idec.h:119
@ RSP_OP_ADD
Definition: rsp_idec.h:40
@ RSP_OP_VMADM
Definition: rsp_idec.h:69
@ RSP_OP_AND
Definition: rsp_idec.h:44
@ RSP_OP_VSUBC
Definition: rsp_idec.h:76
@ RSP_OP_CFC2
Definition: rsp_idec.h:58
@ RSP_OP_VRCPL
Definition: rsp_idec.h:93
@ RSP_OP_VMUDH
Definition: rsp_idec.h:65
@ RSP_OP_BLTZ
Definition: rsp_idec.h:50
@ RSP_OP_VMULF
Definition: rsp_idec.h:60
@ RSP_OP_SRL
Definition: rsp_idec.h:33
@ RSP_OP_VADDC
Definition: rsp_idec.h:75
@ RSP_OP_VEQ
Definition: rsp_idec.h:79
@ RSP_OP_SH
Definition: rsp_idec.h:143
@ RSP_OP_LRV
Definition: rsp_idec.h:105
@ RSP_OP_LTV
Definition: rsp_idec.h:110
@ RSP_OP_LFV
Definition: rsp_idec.h:109
@ RSP_OP_VNE
Definition: rsp_idec.h:80
@ RSP_OP_LDV
Definition: rsp_idec.h:103
@ RSP_OP_SRV
Definition: rsp_idec.h:116
#define st64
Definition: rz_types_base.h:10
rsp_opcode opcode
Definition: rsp_idec.h:174
const char * mnemonic
Definition: rsp_idec.h:173
rsp_operand_type type
Definition: rsp_idec.h:165
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static int addr
Definition: z80asm.c:58