66 {
"r0",
"r1",
"pc",
"ps",
"sp",
"fp",
"r6",
"r7",
67 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
68 "r16",
"r17",
"r18",
"r19",
"r20",
"r21",
"r22",
"r23",
69 "r24",
"r25",
"r26",
"r27",
"r28",
"r29",
"r30",
"r31",
73 {
"add",
"addc",
"sub",
"subb",
"and",
"or",
"xor",
"sh" };
87 if ((opcode->
match & insn) == opcode->
match && (opcode->
lose & insn) == 0) {
135 info->insn_info_valid = 1;
137 info->branch_delay_insns = 0;
144 && (opcode->
lose & insn) == 0)
148 int imm_added_to_rs1 = 0;
153 if (((!(opcode->
match & 0x80000000)
154 && ( !(opcode->
match & 0x70000000)
155 || (opcode->
match & 0x70000000) == 0x50000000
157 || ((opcode->
match & 0xf0000000) == 0xc0000000
158 && ( !(opcode->
match & 0x00000700)
159 || (opcode->
match & 0x00000700) == 0x00000500 )))
162 imm_added_to_rs1 = 1;
167 && strchr (opcode->
args,
'r') != 0)
178 for (
s = opcode->
args; *
s !=
'\0'; ++
s)
190 #define reg(n) (*info->fprintf_func) (stream, "%s", reg_names[n])
225 goto print_immediate;
228 goto print_immediate;
231 goto print_immediate;
234 goto print_immediate;
237 (*
info->fprintf_func) (
stream,
"***ERROR***");
241 if (
X_RS1 (insn) == 0) {
244 goto print_immediate;
247 goto print_immediate;
250 if (
X_RS1 (insn) == 0) {
253 goto print_immediate;
319 if (imm_added_to_rs1)
321 unsigned long prev_insn;
325 (*
info->read_memory_func)
342 errcode = (*
info->read_memory_func)
353 if (((prev_insn & 0xf07c0000) == 0x00000000
354 || (prev_insn & 0xf07c0000) == 0x50000000 )
356 &&
X_RD (prev_insn) )
361 if((prev_insn & 0xf07c0000) == 0x50000000 ){
387 info->branch_delay_insns = 1;
408 unsigned long int match0 = op0->
match, match1 = op1->
match;
409 unsigned long int lose0 = op0->
lose, lose1 = op1->
lose;
410 register unsigned int i;
416 fprintf (stderr,
"Internal error: bad lanai-opcode.h: \"%s\", %#.8lx, %#.8lx\n",
417 op0->
name, match0, lose0);
424 fprintf (stderr,
"Internal error: bad lanai-opcode.h: \"%s\", %#.8lx, %#.8lx\n",
425 op1->
name, match1, lose1);
432 for (
i = 0;
i < 32; ++
i)
434 unsigned long int x = 1 <<
i;
435 int x0 = (match0 &
x) != 0;
436 int x1 = (match1 &
x) != 0;
443 for (
i = 0;
i < 32; ++
i)
445 unsigned long int x = 1 <<
i;
446 int x0 = (lose0 &
x) != 0;
447 int x1 = (lose1 &
x) != 0;
460 if (alias_diff != 0) {
478 "Internal error: bad lanai-opcode.h: \"%s\" == \"%s\"\n",
485 int length_diff = strlen (op0->
args) - strlen (op1->
args);
486 if (length_diff != 0) {
494 char *p0 = (
char *) strchr(op0->
args,
'+');
495 char *p1 = (
char *) strchr(op1->
args,
'+');
502 if (p0[-1] ==
'i' && p1[1] ==
'i') {
506 if (p0[1] ==
'i' && p1[-1] ==
'i') {
RzBinInfo * info(RzBinFile *bf)
int print_insn_lanai(bfd_vma memaddr, disassemble_info *info)
static int is_delayed_branch(unsigned long insn)
static int compare_opcodes(char *a, char *b)
static int opcodes_sorted
static char * reg_names[]
#define SIGN_EXT(value, bits)
static const char struct stat static buf struct stat static buf static vhangup int status
BFD_HOST_U_64_BIT bfd_vma
static bfd_vma bfd_getb32(const void *p)
void qsort(void *a, size_t n, size_t es, int(*cmp)(const void *, const void *))