aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog4
-rw-r--r--opcodes/bfin-dis.c2260
2 files changed, 501 insertions, 1763 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 915105d..4a55a28 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,7 @@
+2005-10-21 Nick Clifton <nickc@redhat.com>
+
+ * bfin-dis.c: Tidy up code, removing redundant constructs.
+
2005-10-19 Martin Schwidefsky <schwidefsky@de.ibm.com>
* s390-opc.txt: Add unnormalized hfp multiply and multiply-and-add
diff --git a/opcodes/bfin-dis.c b/opcodes/bfin-dis.c
index 08f9d23..adeb7d0 100644
--- a/opcodes/bfin-dis.c
+++ b/opcodes/bfin-dis.c
@@ -42,15 +42,13 @@
typedef long TIword;
-#define HOST_LONG_WORD_SIZE (sizeof(long)*8)
-
-#define XFIELD(w,p,s) (((w)&((1<<(s))-1)<<(p))>>(p))
-
-#define SIGNEXTEND(v, n) ((v << (HOST_LONG_WORD_SIZE - (n))) >> (HOST_LONG_WORD_SIZE - (n)))
-#define MASKBITS(val, bits) (val & (( 1 << bits)-1))
-
+#define HOST_LONG_WORD_SIZE (sizeof (long) * 8)
+#define XFIELD(w,p,s) (((w) & ((1 << (s)) - 1) << (p)) >> (p))
+#define SIGNEXTEND(v, n) ((v << (HOST_LONG_WORD_SIZE - (n))) >> (HOST_LONG_WORD_SIZE - (n)))
+#define MASKBITS(val, bits) (val & ((1 << bits) - 1))
#include "dis-asm.h"
+
typedef enum
{
c_0, c_1, c_4, c_2, c_uimm2, c_uimm3, c_imm3, c_pcrel4,
@@ -132,6 +130,7 @@ fmtconst (const_forms_t cf, TIword x, bfd_vma pc, disassemble_info * outf)
if (constant_formats[cf].negative)
{
int nb = constant_formats[cf].nbits + 1;
+
x = x | (1 << constant_formats[cf].nbits);
x = SIGNEXTEND (x, nb);
}
@@ -152,13 +151,6 @@ fmtconst (const_forms_t cf, TIword x, bfd_vma pc, disassemble_info * outf)
return buf;
}
-#undef SIGNEXTEND
-#undef MASKBITS
-#undef HOST_LONG_WORD_SIZE
-#define HOST_LONG_WORD_SIZE (sizeof(long)*8)
-#define SIGNEXTEND(v, n) (((long)(v) << (HOST_LONG_WORD_SIZE - (n))) >> (HOST_LONG_WORD_SIZE - (n)))
-#define MASKBITS(val, bits) (val & (( 1 << bits)-1))
-
enum machine_registers
{
REG_RL0, REG_RL1, REG_RL2, REG_RL3, REG_RL4, REG_RL5, REG_RL6, REG_RL7,
@@ -228,7 +220,7 @@ static enum machine_registers decode_dregs_lo[] =
REG_RL0, REG_RL1, REG_RL2, REG_RL3, REG_RL4, REG_RL5, REG_RL6, REG_RL7,
};
-#define dregs_lo(x) REGNAME(decode_dregs_lo[(x) & 7])
+#define dregs_lo(x) REGNAME (decode_dregs_lo[(x) & 7])
/* RH(0..7). */
static enum machine_registers decode_dregs_hi[] =
@@ -236,7 +228,7 @@ static enum machine_registers decode_dregs_hi[] =
REG_RH0, REG_RH1, REG_RH2, REG_RH3, REG_RH4, REG_RH5, REG_RH6, REG_RH7,
};
-#define dregs_hi(x) REGNAME(decode_dregs_hi[(x) & 7])
+#define dregs_hi(x) REGNAME (decode_dregs_hi[(x) & 7])
/* R(0..7). */
static enum machine_registers decode_dregs[] =
@@ -244,7 +236,7 @@ static enum machine_registers decode_dregs[] =
REG_R0, REG_R1, REG_R2, REG_R3, REG_R4, REG_R5, REG_R6, REG_R7,
};
-#define dregs(x) REGNAME(decode_dregs[(x) & 7])
+#define dregs(x) REGNAME (decode_dregs[(x) & 7])
/* R BYTE(0..7). */
static enum machine_registers decode_dregs_byte[] =
@@ -252,8 +244,8 @@ static enum machine_registers decode_dregs_byte[] =
REG_BR0, REG_BR1, REG_BR2, REG_BR3, REG_BR4, REG_BR5, REG_BR6, REG_BR7,
};
-#define dregs_byte(x) REGNAME(decode_dregs_byte[(x) & 7])
-#define dregs_pair(x) REGNAME(decode_dregs_pair[(x) & 7])
+#define dregs_byte(x) REGNAME (decode_dregs_byte[(x) & 7])
+#define dregs_pair(x) REGNAME (decode_dregs_pair[(x) & 7])
/* P(0..5) SP FP. */
static enum machine_registers decode_pregs[] =
@@ -261,12 +253,12 @@ static enum machine_registers decode_pregs[] =
REG_P0, REG_P1, REG_P2, REG_P3, REG_P4, REG_P5, REG_SP, REG_FP,
};
-#define pregs(x) REGNAME(decode_pregs[(x) & 7])
-#define spfp(x) REGNAME(decode_spfp[(x) & 1])
-#define dregs_hilo(x,i) REGNAME(decode_dregs_hilo[((i)<<3)|x])
-#define accum_ext(x) REGNAME(decode_accum_ext[(x) & 1])
-#define accum_word(x) REGNAME(decode_accum_word[(x) & 1])
-#define accum(x) REGNAME(decode_accum[(x) & 1])
+#define pregs(x) REGNAME (decode_pregs[(x) & 7])
+#define spfp(x) REGNAME (decode_spfp[(x) & 1])
+#define dregs_hilo(x,i) REGNAME (decode_dregs_hilo[((i) << 3)|x])
+#define accum_ext(x) REGNAME (decode_accum_ext[(x) & 1])
+#define accum_word(x) REGNAME (decode_accum_word[(x) & 1])
+#define accum(x) REGNAME (decode_accum[(x) & 1])
/* I(0..3). */
static enum machine_registers decode_iregs[] =
@@ -274,7 +266,7 @@ static enum machine_registers decode_iregs[] =
REG_I0, REG_I1, REG_I2, REG_I3,
};
-#define iregs(x) REGNAME(decode_iregs[(x) & 3])
+#define iregs(x) REGNAME (decode_iregs[(x) & 3])
/* M(0..3). */
static enum machine_registers decode_mregs[] =
@@ -282,9 +274,9 @@ static enum machine_registers decode_mregs[] =
REG_M0, REG_M1, REG_M2, REG_M3,
};
-#define mregs(x) REGNAME(decode_mregs[(x) & 3])
-#define bregs(x) REGNAME(decode_bregs[(x) & 3])
-#define lregs(x) REGNAME(decode_lregs[(x) & 3])
+#define mregs(x) REGNAME (decode_mregs[(x) & 3])
+#define bregs(x) REGNAME (decode_bregs[(x) & 3])
+#define lregs(x) REGNAME (decode_lregs[(x) & 3])
/* dregs pregs. */
static enum machine_registers decode_dpregs[] =
@@ -293,7 +285,7 @@ static enum machine_registers decode_dpregs[] =
REG_P0, REG_P1, REG_P2, REG_P3, REG_P4, REG_P5, REG_SP, REG_FP,
};
-#define dpregs(x) REGNAME(decode_dpregs[(x) & 15])
+#define dpregs(x) REGNAME (decode_dpregs[(x) & 15])
/* [dregs pregs]. */
static enum machine_registers decode_gregs[] =
@@ -302,7 +294,7 @@ static enum machine_registers decode_gregs[] =
REG_P0, REG_P1, REG_P2, REG_P3, REG_P4, REG_P5, REG_SP, REG_FP,
};
-#define gregs(x,i) REGNAME(decode_gregs[((i)<<3)|x])
+#define gregs(x,i) REGNAME (decode_gregs[((i) << 3)|x])
/* [dregs pregs (iregs mregs) (bregs lregs)]. */
static enum machine_registers decode_regs[] =
@@ -313,7 +305,7 @@ static enum machine_registers decode_regs[] =
REG_B0, REG_B1, REG_B2, REG_B3, REG_L0, REG_L1, REG_L2, REG_L3,
};
-#define regs(x,i) REGNAME(decode_regs[((i)<<3)|x])
+#define regs(x,i) REGNAME (decode_regs[((i) << 3)|x])
/* [dregs pregs (iregs mregs) (bregs lregs) Low Half]. */
static enum machine_registers decode_regs_lo[] =
@@ -324,7 +316,7 @@ static enum machine_registers decode_regs_lo[] =
REG_BL0, REG_BL1, REG_BL2, REG_BL3, REG_LL0, REG_LL1, REG_LL2, REG_LL3,
};
-#define regs_lo(x,i) REGNAME(decode_regs_lo[((i)<<3)|x])
+#define regs_lo(x,i) REGNAME (decode_regs_lo[((i) << 3)|x])
/* [dregs pregs (iregs mregs) (bregs lregs) High Half]. */
static enum machine_registers decode_regs_hi[] =
{
@@ -334,7 +326,7 @@ static enum machine_registers decode_regs_hi[] =
REG_BH0, REG_BH1, REG_BH2, REG_BH3, REG_LH0, REG_LH1, REG_LH2, REG_LH3,
};
-#define regs_hi(x,i) REGNAME(decode_regs_hi[((i)<<3)|x])
+#define regs_hi(x,i) REGNAME (decode_regs_hi[((i) << 3)|x])
static enum machine_registers decode_statbits[] =
{
@@ -344,9 +336,9 @@ static enum machine_registers decode_statbits[] =
REG_V, REG_VS, REG_LASTREG, REG_LASTREG, REG_LASTREG, REG_LASTREG, REG_LASTREG, REG_LASTREG,
};
-#define statbits(x) REGNAME(decode_statbits[(x) & 31])
-#define ignore_bits(x) REGNAME(decode_ignore_bits[(x) & 7])
-#define ccstat(x) REGNAME(decode_ccstat[(x) & 0])
+#define statbits(x) REGNAME (decode_statbits[(x) & 31])
+#define ignore_bits(x) REGNAME (decode_ignore_bits[(x) & 7])
+#define ccstat(x) REGNAME (decode_ccstat[(x) & 0])
/* LC0 LC1. */
static enum machine_registers decode_counters[] =
@@ -354,8 +346,8 @@ static enum machine_registers decode_counters[] =
REG_LC0, REG_LC1,
};
-#define counters(x) REGNAME(decode_counters[(x) & 1])
-#define dregs2_sysregs1(x) REGNAME(decode_dregs2_sysregs1[(x) & 7])
+#define counters(x) REGNAME (decode_counters[(x) & 1])
+#define dregs2_sysregs1(x) REGNAME (decode_dregs2_sysregs1[(x) & 7])
/* [dregs pregs (iregs mregs) (bregs lregs)
dregs2_sysregs1 open sysregs2 sysregs3]. */
@@ -371,230 +363,108 @@ static enum machine_registers decode_allregs[] =
REG_USP, REG_SEQSTAT, REG_SYSCFG, REG_RETI, REG_RETX, REG_RETN, REG_RETE, REG_EMUDAT, REG_LASTREG,
};
-#define allregs(x,i) REGNAME(decode_allregs[((i) << 3) | x])
-#define uimm16s4(x) fmtconst(c_uimm16s4, x, 0, outf)
-#define pcrel4(x) fmtconst(c_pcrel4, x, pc, outf)
-#define pcrel8(x) fmtconst(c_pcrel8, x, pc, outf)
-#define pcrel8s4(x) fmtconst(c_pcrel8s4, x, pc, outf)
-#define pcrel10(x) fmtconst(c_pcrel10, x, pc, outf)
-#define pcrel12(x) fmtconst(c_pcrel12, x, pc, outf)
-#define negimm5s4(x) fmtconst(c_negimm5s4, x, 0, outf)
-#define rimm16(x) fmtconst(c_rimm16, x, 0, outf)
-#define huimm16(x) fmtconst(c_huimm16, x, 0, outf)
-#define imm16(x) fmtconst(c_imm16, x, 0, outf)
-#define uimm2(x) fmtconst(c_uimm2, x, 0, outf)
-#define uimm3(x) fmtconst(c_uimm3, x, 0, outf)
-#define luimm16(x) fmtconst(c_luimm16, x, 0, outf)
-#define uimm4(x) fmtconst(c_uimm4, x, 0, outf)
-#define uimm5(x) fmtconst(c_uimm5, x, 0, outf)
-#define imm16s2(x) fmtconst(c_imm16s2, x, 0, outf)
-#define uimm8(x) fmtconst(c_uimm8, x, 0, outf)
-#define imm16s4(x) fmtconst(c_imm16s4, x, 0, outf)
-#define uimm4s2(x) fmtconst(c_uimm4s2, x, 0, outf)
-#define uimm4s4(x) fmtconst(c_uimm4s4, x, 0, outf)
-#define lppcrel10(x) fmtconst(c_lppcrel10, x, pc, outf)
-#define imm3(x) fmtconst(c_imm3, x, 0, outf)
-#define imm4(x) fmtconst(c_imm4, x, 0, outf)
-#define uimm8s4(x) fmtconst(c_uimm8s4, x, 0, outf)
-#define imm5(x) fmtconst(c_imm5, x, 0, outf)
-#define imm6(x) fmtconst(c_imm6, x, 0, outf)
-#define imm7(x) fmtconst(c_imm7, x, 0, outf)
-#define imm8(x) fmtconst(c_imm8, x, 0, outf)
-#define pcrel24(x) fmtconst(c_pcrel24, x, pc, outf)
-#define uimm16(x) fmtconst(c_uimm16, x, 0, outf)
+#define allregs(x,i) REGNAME (decode_allregs[((i) << 3) | x])
+#define uimm16s4(x) fmtconst (c_uimm16s4, x, 0, outf)
+#define pcrel4(x) fmtconst (c_pcrel4, x, pc, outf)
+#define pcrel8(x) fmtconst (c_pcrel8, x, pc, outf)
+#define pcrel8s4(x) fmtconst (c_pcrel8s4, x, pc, outf)
+#define pcrel10(x) fmtconst (c_pcrel10, x, pc, outf)
+#define pcrel12(x) fmtconst (c_pcrel12, x, pc, outf)
+#define negimm5s4(x) fmtconst (c_negimm5s4, x, 0, outf)
+#define rimm16(x) fmtconst (c_rimm16, x, 0, outf)
+#define huimm16(x) fmtconst (c_huimm16, x, 0, outf)
+#define imm16(x) fmtconst (c_imm16, x, 0, outf)
+#define uimm2(x) fmtconst (c_uimm2, x, 0, outf)
+#define uimm3(x) fmtconst (c_uimm3, x, 0, outf)
+#define luimm16(x) fmtconst (c_luimm16, x, 0, outf)
+#define uimm4(x) fmtconst (c_uimm4, x, 0, outf)
+#define uimm5(x) fmtconst (c_uimm5, x, 0, outf)
+#define imm16s2(x) fmtconst (c_imm16s2, x, 0, outf)
+#define uimm8(x) fmtconst (c_uimm8, x, 0, outf)
+#define imm16s4(x) fmtconst (c_imm16s4, x, 0, outf)
+#define uimm4s2(x) fmtconst (c_uimm4s2, x, 0, outf)
+#define uimm4s4(x) fmtconst (c_uimm4s4, x, 0, outf)
+#define lppcrel10(x) fmtconst (c_lppcrel10, x, pc, outf)
+#define imm3(x) fmtconst (c_imm3, x, 0, outf)
+#define imm4(x) fmtconst (c_imm4, x, 0, outf)
+#define uimm8s4(x) fmtconst (c_uimm8s4, x, 0, outf)
+#define imm5(x) fmtconst (c_imm5, x, 0, outf)
+#define imm6(x) fmtconst (c_imm6, x, 0, outf)
+#define imm7(x) fmtconst (c_imm7, x, 0, outf)
+#define imm8(x) fmtconst (c_imm8, x, 0, outf)
+#define pcrel24(x) fmtconst (c_pcrel24, x, pc, outf)
+#define uimm16(x) fmtconst (c_uimm16, x, 0, outf)
/* (arch.pm)arch_disassembler_functions. */
-#define notethat(x)
-
#ifndef OUTS
-#define OUTS(p,txt) ((p) ? (((txt)[0]) ? (p->fprintf_func)(p->stream, txt) :0) :0)
+#define OUTS(p, txt) ((p) ? (((txt)[0]) ? (p->fprintf_func)(p->stream, txt) :0) :0)
#endif
-
static void
amod0 (int s0, int x0, disassemble_info *outf)
{
- if (s0 == 0 && x0 == 0)
- {
- notethat ("(NS)");
- return;
- }
- else if (s0 == 1 && x0 == 0)
- {
- notethat ("(S)");
- OUTS (outf, "(S)");
- return;
- }
+ if (s0 == 1 && x0 == 0)
+ OUTS (outf, "(S)");
else if (s0 == 0 && x0 == 1)
- {
- notethat ("(CO)");
- OUTS (outf, "(CO)");
- return;
- }
+ OUTS (outf, "(CO)");
else if (s0 == 1 && x0 == 1)
- {
- notethat ("(SCO)");
- OUTS (outf, "(SCO)");
- return;
- }
- else
- goto illegal_instruction;
-illegal_instruction:
- return;
+ OUTS (outf, "(SCO)");
}
static void
amod1 (int s0, int x0, disassemble_info *outf)
{
if (s0 == 0 && x0 == 0)
- {
- notethat ("(NS)");
- OUTS (outf, "(NS)");
- return;
- }
+ OUTS (outf, "(NS)");
else if (s0 == 1 && x0 == 0)
- {
- notethat ("(S)");
- OUTS (outf, "(S)");
- return;
- }
- else
- goto illegal_instruction;
-illegal_instruction:
- return;
+ OUTS (outf, "(S)");
}
static void
amod0amod2 (int s0, int x0, int aop0, disassemble_info *outf)
{
- if (s0 == 0 && x0 == 0 && aop0 == 0)
- {
- notethat ("(NS)");
- return;
- }
- else if (s0 == 1 && x0 == 0 && aop0 == 0)
- {
- notethat ("(S)");
- OUTS (outf, "(S)");
- return;
- }
+ if (s0 == 1 && x0 == 0 && aop0 == 0)
+ OUTS (outf, "(S)");
else if (s0 == 0 && x0 == 1 && aop0 == 0)
- {
- notethat ("(CO)");
- OUTS (outf, "(CO)");
- return;
- }
+ OUTS (outf, "(CO)");
else if (s0 == 1 && x0 == 1 && aop0 == 0)
- {
- notethat ("(SCO)");
- OUTS (outf, "(SCO)");
- return;
- }
+ OUTS (outf, "(SCO)");
else if (s0 == 0 && x0 == 0 && aop0 == 2)
- {
- notethat ("(ASR)");
- OUTS (outf, "(ASR)");
- return;
- }
+ OUTS (outf, "(ASR)");
else if (s0 == 1 && x0 == 0 && aop0 == 2)
- {
- notethat ("(S,ASR)");
- OUTS (outf, "(S,ASR)");
- return;
- }
+ OUTS (outf, "(S,ASR)");
else if (s0 == 0 && x0 == 1 && aop0 == 2)
- {
- notethat ("(CO,ASR)");
- OUTS (outf, "(CO,ASR)");
- return;
- }
+ OUTS (outf, "(CO,ASR)");
else if (s0 == 1 && x0 == 1 && aop0 == 2)
- {
- notethat ("(SCO,ASR)");
- OUTS (outf, "(SCO,ASR)");
- return;
- }
+ OUTS (outf, "(SCO,ASR)");
else if (s0 == 0 && x0 == 0 && aop0 == 3)
- {
- notethat ("(ASL)");
- OUTS (outf, "(ASL)");
- return;
- }
+ OUTS (outf, "(ASL)");
else if (s0 == 1 && x0 == 0 && aop0 == 3)
- {
- notethat ("(S,ASL)");
- OUTS (outf, "(S,ASL)");
- return;
- }
+ OUTS (outf, "(S,ASL)");
else if (s0 == 0 && x0 == 1 && aop0 == 3)
- {
- notethat ("(CO,ASL)");
- OUTS (outf, "(CO,ASL)");
- return;
- }
+ OUTS (outf, "(CO,ASL)");
else if (s0 == 1 && x0 == 1 && aop0 == 3)
- {
- notethat ("(SCO,ASL)");
- OUTS (outf, "(SCO,ASL)");
- return;
- }
- else
- goto illegal_instruction;
-illegal_instruction:
- return;
+ OUTS (outf, "(SCO,ASL)");
}
static void
searchmod (int r0, disassemble_info *outf)
{
- if ((r0 == 0))
- {
- notethat ("GT");
- OUTS (outf, "GT");
- return;
- }
- else if ((r0 == 1))
- {
- notethat ("GE");
- OUTS (outf, "GE");
- return;
- }
- else if ((r0 == 2))
- {
- notethat ("LT");
- OUTS (outf, "LT");
- return;
- }
- else if ((r0 == 3))
- {
- notethat ("LE");
- OUTS (outf, "LE");
- return;
- }
- else
- goto illegal_instruction;
-illegal_instruction:
- return;
+ if (r0 == 0)
+ OUTS (outf, "GT");
+ else if (r0 == 1)
+ OUTS (outf, "GE");
+ else if (r0 == 2)
+ OUTS (outf, "LT");
+ else if (r0 == 3)
+ OUTS (outf, "LE");
}
static void
aligndir (int r0, disassemble_info *outf)
{
- if ((r0 == 0))
- {
- notethat ("");
- return;
- }
- else if ((r0 == 1))
- {
- notethat ("(R)");
- OUTS (outf, "(R)");
- return;
- }
- else
- goto illegal_instruction;
-illegal_instruction:
- return;
+ if (r0 == 1)
+ OUTS (outf, "(R)");
}
static int
@@ -637,15 +507,10 @@ decode_macfunc (int which, int op, int h0, int h1, int src0, int src1, disassemb
switch (op)
{
- case 0:
- sop = "=";
- break;
- case 1:
- sop = "+=";
- break;
- case 2:
- sop = "-=";
- break;
+ case 0: sop = "="; break;
+ case 1: sop = "+="; break;
+ case 2: sop = "-="; break;
+ default: break;
}
OUTS (outf, a);
@@ -673,7 +538,7 @@ decode_optmode (int mod, int MM, disassemble_info *outf)
if (MM)
OUTS (outf, "M, ");
-
+
if (mod == M_S2RND)
OUTS (outf, "S2RND");
else if (mod == M_T)
@@ -697,350 +562,251 @@ decode_optmode (int mod, int MM, disassemble_info *outf)
OUTS (outf, ")");
}
+
static int
decode_ProgCtrl_0 (TIword iw0, disassemble_info *outf)
{
-/* ProgCtrl
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |.prgfunc.......|.poprnd........|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* ProgCtrl
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |.prgfunc.......|.poprnd........|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int poprnd = ((iw0 >> ProgCtrl_poprnd_bits) & ProgCtrl_poprnd_mask);
int prgfunc = ((iw0 >> ProgCtrl_prgfunc_bits) & ProgCtrl_prgfunc_mask);
if (prgfunc == 0 && poprnd == 0)
- {
- notethat ("NOP");
- OUTS (outf, "NOP");
- return 1 * 2;
- }
+ OUTS (outf, "NOP");
else if (prgfunc == 1 && poprnd == 0)
- {
- notethat ("RTS");
- OUTS (outf, "RTS");
- return 1 * 2;
- }
+ OUTS (outf, "RTS");
else if (prgfunc == 1 && poprnd == 1)
- {
- notethat ("RTI");
- OUTS (outf, "RTI");
- return 1 * 2;
- }
+ OUTS (outf, "RTI");
else if (prgfunc == 1 && poprnd == 2)
- {
- notethat ("RTX");
- OUTS (outf, "RTX");
- return 1 * 2;
- }
+ OUTS (outf, "RTX");
else if (prgfunc == 1 && poprnd == 3)
- {
- notethat ("RTN");
- OUTS (outf, "RTN");
- return 1 * 2;
- }
+ OUTS (outf, "RTN");
else if (prgfunc == 1 && poprnd == 4)
- {
- notethat ("RTE");
- OUTS (outf, "RTE");
- return 1 * 2;
- }
+ OUTS (outf, "RTE");
else if (prgfunc == 2 && poprnd == 0)
- {
- notethat ("IDLE");
- OUTS (outf, "IDLE");
- return 1 * 2;
- }
+ OUTS (outf, "IDLE");
else if (prgfunc == 2 && poprnd == 3)
- {
- notethat ("CSYNC");
- OUTS (outf, "CSYNC");
- return 1 * 2;
- }
+ OUTS (outf, "CSYNC");
else if (prgfunc == 2 && poprnd == 4)
- {
- notethat ("SSYNC");
- OUTS (outf, "SSYNC");
- return 1 * 2;
- }
+ OUTS (outf, "SSYNC");
else if (prgfunc == 2 && poprnd == 5)
- {
- notethat ("EMUEXCPT");
- OUTS (outf, "EMUEXCPT");
- return 1 * 2;
- }
+ OUTS (outf, "EMUEXCPT");
else if (prgfunc == 3)
{
- notethat ("CLI dregs");
OUTS (outf, "CLI ");
OUTS (outf, dregs (poprnd));
- return 1 * 2;
}
else if (prgfunc == 4)
{
- notethat ("STI dregs");
OUTS (outf, "STI ");
OUTS (outf, dregs (poprnd));
- return 1 * 2;
}
else if (prgfunc == 5)
{
- notethat ("JUMP ( pregs )");
OUTS (outf, "JUMP (");
OUTS (outf, pregs (poprnd));
OUTS (outf, ")");
- return 1 * 2;
}
else if (prgfunc == 6)
{
- notethat ("CALL ( pregs )");
OUTS (outf, "CALL (");
OUTS (outf, pregs (poprnd));
OUTS (outf, ")");
- return 1 * 2;
}
else if (prgfunc == 7)
{
- notethat ("CALL ( PC + pregs )");
OUTS (outf, "CALL (PC+");
OUTS (outf, pregs (poprnd));
OUTS (outf, ")");
- return 1 * 2;
}
else if (prgfunc == 8)
{
- notethat ("JUMP ( PC + pregs )");
OUTS (outf, "JUMP (PC+");
OUTS (outf, pregs (poprnd));
OUTS (outf, ")");
- return 1 * 2;
}
else if (prgfunc == 9)
{
- notethat ("RAISE uimm4");
OUTS (outf, "RAISE ");
OUTS (outf, uimm4 (poprnd));
- return 1 * 2;
}
else if (prgfunc == 10)
{
- notethat ("EXCPT uimm4");
OUTS (outf, "EXCPT ");
OUTS (outf, uimm4 (poprnd));
- return 1 * 2;
}
else if (prgfunc == 11)
{
- notethat ("TESTSET ( pregs )");
OUTS (outf, "TESTSET (");
OUTS (outf, pregs (poprnd));
OUTS (outf, ")");
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+ return 2;
}
static int
decode_CaCTRL_0 (TIword iw0, disassemble_info *outf)
{
-/* CaCTRL
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 |.a.|.op....|.reg.......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* CaCTRL
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 |.a.|.op....|.reg.......|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int a = ((iw0 >> CaCTRL_a_bits) & CaCTRL_a_mask);
int op = ((iw0 >> CaCTRL_op_bits) & CaCTRL_op_mask);
int reg = ((iw0 >> CaCTRL_reg_bits) & CaCTRL_reg_mask);
if (a == 0 && op == 0)
{
- notethat ("PREFETCH [ pregs ]");
OUTS (outf, "PREFETCH[");
OUTS (outf, pregs (reg));
OUTS (outf, "]");
- return 1 * 2;
}
else if (a == 0 && op == 1)
{
- notethat ("FLUSHINV [ pregs ]");
OUTS (outf, "FLUSHINV[");
OUTS (outf, pregs (reg));
OUTS (outf, "]");
- return 1 * 2;
}
else if (a == 0 && op == 2)
{
- notethat ("FLUSH [ pregs ]");
OUTS (outf, "FLUSH[");
OUTS (outf, pregs (reg));
OUTS (outf, "]");
- return 1 * 2;
}
else if (a == 0 && op == 3)
{
- notethat ("IFLUSH [ pregs ]");
OUTS (outf, "IFLUSH[");
OUTS (outf, pregs (reg));
OUTS (outf, "]");
- return 1 * 2;
}
else if (a == 1 && op == 0)
{
- notethat ("PREFETCH [ pregs ++ ]");
OUTS (outf, "PREFETCH[");
OUTS (outf, pregs (reg));
OUTS (outf, "++]");
- return 1 * 2;
}
else if (a == 1 && op == 1)
{
- notethat ("FLUSHINV [ pregs ++ ]");
OUTS (outf, "FLUSHINV[");
OUTS (outf, pregs (reg));
OUTS (outf, "++]");
- return 1 * 2;
}
else if (a == 1 && op == 2)
{
- notethat ("FLUSH [ pregs ++ ]");
OUTS (outf, "FLUSH[");
OUTS (outf, pregs (reg));
OUTS (outf, "++]");
- return 1 * 2;
}
else if (a == 1 && op == 3)
{
- notethat ("IFLUSH [ pregs ++ ]");
OUTS (outf, "IFLUSH[");
OUTS (outf, pregs (reg));
OUTS (outf, "++]");
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+ return 2;
}
static int
decode_PushPopReg_0 (TIword iw0, disassemble_info *outf)
{
-
-/* PushPopReg
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |.W.|.grp.......|.reg.......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* PushPopReg
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |.W.|.grp.......|.reg.......|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int W = ((iw0 >> PushPopReg_W_bits) & PushPopReg_W_mask);
int grp = ((iw0 >> PushPopReg_grp_bits) & PushPopReg_grp_mask);
int reg = ((iw0 >> PushPopReg_reg_bits) & PushPopReg_reg_mask);
if (W == 0)
{
- notethat ("allregs = [ SP ++ ]");
OUTS (outf, allregs (reg, grp));
OUTS (outf, " = [SP++]");
- return 1 * 2;
}
else if (W == 1)
{
- notethat ("[ -- SP ] = allregs");
OUTS (outf, "[--SP] = ");
OUTS (outf, allregs (reg, grp));
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+ return 2;
}
static int
decode_PushPopMultiple_0 (TIword iw0, disassemble_info *outf)
{
-/* PushPopMultiple
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 0 | 0 | 0 | 0 | 0 | 1 | 0 |.d.|.p.|.W.|.dr........|.pr........|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* PushPopMultiple
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 0 | 0 | 0 | 0 | 0 | 1 | 0 |.d.|.p.|.W.|.dr........|.pr........|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int p = ((iw0 >> PushPopMultiple_p_bits) & PushPopMultiple_p_mask);
int d = ((iw0 >> PushPopMultiple_d_bits) & PushPopMultiple_d_mask);
int W = ((iw0 >> PushPopMultiple_W_bits) & PushPopMultiple_W_mask);
int dr = ((iw0 >> PushPopMultiple_dr_bits) & PushPopMultiple_dr_mask);
int pr = ((iw0 >> PushPopMultiple_pr_bits) & PushPopMultiple_pr_mask);
-
char ps[5], ds[5];
+
sprintf (ps, "%d", pr);
sprintf (ds, "%d", dr);
if (W == 1 && d == 1 && p == 1)
{
- notethat ("[ -- SP ] = ( R7 : reglim , P5 : reglim )");
OUTS (outf, "[--SP] = (R7:");
OUTS (outf, ds);
OUTS (outf, ", P5:");
OUTS (outf, ps);
OUTS (outf, ")");
- return 1 * 2;
}
else if (W == 1 && d == 1 && p == 0)
{
- notethat ("[ -- SP ] = ( R7 : reglim )");
OUTS (outf, "[--SP] = (R7:");
OUTS (outf, ds);
OUTS (outf, ")");
- return 1 * 2;
}
else if (W == 1 && d == 0 && p == 1)
{
- notethat ("[ -- SP ] = ( P5 : reglim )");
OUTS (outf, "[--SP] = (P5:");
OUTS (outf, ps);
OUTS (outf, ")");
- return 1 * 2;
}
else if (W == 0 && d == 1 && p == 1)
{
- notethat ("( R7 : reglim , P5 : reglim ) = [ SP ++ ]");
OUTS (outf, "(R7:");
OUTS (outf, ds);
OUTS (outf, ", P5:");
OUTS (outf, ps);
OUTS (outf, ") = [SP++]");
- return 1 * 2;
}
else if (W == 0 && d == 1 && p == 0)
{
- notethat ("( R7 : reglim ) = [ SP ++ ]");
OUTS (outf, "(R7:");
OUTS (outf, ds);
OUTS (outf, ") = [SP++]");
- return 1 * 2;
}
else if (W == 0 && d == 0 && p == 1)
{
- notethat ("( P5 : reglim ) = [ SP ++ ]");
OUTS (outf, "(P5:");
OUTS (outf, ps);
OUTS (outf, ") = [SP++]");
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+ return 2;
}
static int
decode_ccMV_0 (TIword iw0, disassemble_info *outf)
{
-/* ccMV
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 0 | 0 | 0 | 0 | 0 | 1 | 1 |.T.|.d.|.s.|.dst.......|.src.......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* ccMV
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 0 | 0 | 0 | 0 | 0 | 1 | 1 |.T.|.d.|.s.|.dst.......|.src.......|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int s = ((iw0 >> CCmv_s_bits) & CCmv_s_mask);
int d = ((iw0 >> CCmv_d_bits) & CCmv_d_mask);
int T = ((iw0 >> CCmv_T_bits) & CCmv_T_mask);
@@ -1049,36 +815,30 @@ decode_ccMV_0 (TIword iw0, disassemble_info *outf)
if (T == 1)
{
- notethat ("IF CC gregs = gregs");
OUTS (outf, "IF CC ");
OUTS (outf, gregs (dst, d));
OUTS (outf, " = ");
OUTS (outf, gregs (src, s));
- return 1 * 2;
}
else if (T == 0)
{
- notethat ("IF ! CC gregs = gregs");
OUTS (outf, "IF ! CC ");
OUTS (outf, gregs (dst, d));
OUTS (outf, " = ");
OUTS (outf, gregs (src, s));
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+ return 2;
}
static int
decode_CCflag_0 (TIword iw0, disassemble_info *outf)
{
-/* CCflag
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 0 | 0 | 0 | 0 | 1 |.I.|.opc.......|.G.|.y.........|.x.........|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* CCflag
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 0 | 0 | 0 | 0 | 1 |.I.|.opc.......|.G.|.y.........|.x.........|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int x = ((iw0 >> CCflag_x_bits) & CCflag_x_mask);
int y = ((iw0 >> CCflag_y_bits) & CCflag_y_mask);
int I = ((iw0 >> CCflag_I_bits) & CCflag_I_mask);
@@ -1087,739 +847,588 @@ decode_CCflag_0 (TIword iw0, disassemble_info *outf)
if (opc == 0 && I == 0 && G == 0)
{
- notethat ("CC = dregs == dregs");
OUTS (outf, "CC=");
OUTS (outf, dregs (x));
OUTS (outf, "==");
OUTS (outf, dregs (y));
- return 1 * 2;
}
else if (opc == 1 && I == 0 && G == 0)
{
- notethat ("CC = dregs < dregs");
OUTS (outf, "CC=");
OUTS (outf, dregs (x));
OUTS (outf, "<");
OUTS (outf, dregs (y));
- return 1 * 2;
}
else if (opc == 2 && I == 0 && G == 0)
{
- notethat ("CC = dregs <= dregs");
OUTS (outf, "CC=");
OUTS (outf, dregs (x));
OUTS (outf, "<=");
OUTS (outf, dregs (y));
- return 1 * 2;
}
else if (opc == 3 && I == 0 && G == 0)
{
- notethat ("CC = dregs < dregs ( IU )");
OUTS (outf, "CC=");
OUTS (outf, dregs (x));
OUTS (outf, "<");
OUTS (outf, dregs (y));
OUTS (outf, "(IU)");
- return 1 * 2;
}
else if (opc == 4 && I == 0 && G == 0)
{
- notethat ("CC = dregs <= dregs ( IU )");
OUTS (outf, "CC=");
OUTS (outf, dregs (x));
OUTS (outf, "<=");
OUTS (outf, dregs (y));
OUTS (outf, "(IU)");
- return 1 * 2;
}
else if (opc == 0 && I == 1 && G == 0)
{
- notethat ("CC = dregs == imm3");
OUTS (outf, "CC=");
OUTS (outf, dregs (x));
OUTS (outf, "==");
OUTS (outf, imm3 (y));
- return 1 * 2;
}
else if (opc == 1 && I == 1 && G == 0)
{
- notethat ("CC = dregs < imm3");
OUTS (outf, "CC=");
OUTS (outf, dregs (x));
OUTS (outf, "<");
OUTS (outf, imm3 (y));
- return 1 * 2;
}
else if (opc == 2 && I == 1 && G == 0)
{
- notethat ("CC = dregs <= imm3");
OUTS (outf, "CC=");
OUTS (outf, dregs (x));
OUTS (outf, "<=");
OUTS (outf, imm3 (y));
- return 1 * 2;
}
else if (opc == 3 && I == 1 && G == 0)
{
- notethat ("CC = dregs < uimm3 ( IU )");
OUTS (outf, "CC=");
OUTS (outf, dregs (x));
OUTS (outf, "<");
OUTS (outf, uimm3 (y));
OUTS (outf, "(IU)");
- return 1 * 2;
}
else if (opc == 4 && I == 1 && G == 0)
{
- notethat ("CC = dregs <= uimm3 ( IU )");
OUTS (outf, "CC=");
OUTS (outf, dregs (x));
OUTS (outf, "<=");
OUTS (outf, uimm3 (y));
OUTS (outf, "(IU)");
- return 1 * 2;
}
else if (opc == 0 && I == 0 && G == 1)
{
- notethat ("CC = pregs == pregs");
OUTS (outf, "CC=");
OUTS (outf, pregs (x));
OUTS (outf, "==");
OUTS (outf, pregs (y));
- return 1 * 2;
}
else if (opc == 1 && I == 0 && G == 1)
{
- notethat ("CC = pregs < pregs");
OUTS (outf, "CC=");
OUTS (outf, pregs (x));
OUTS (outf, "<");
OUTS (outf, pregs (y));
- return 1 * 2;
}
else if (opc == 2 && I == 0 && G == 1)
{
- notethat ("CC = pregs <= pregs");
OUTS (outf, "CC=");
OUTS (outf, pregs (x));
OUTS (outf, "<=");
OUTS (outf, pregs (y));
- return 1 * 2;
}
else if (opc == 3 && I == 0 && G == 1)
{
- notethat ("CC = pregs < pregs ( IU )");
OUTS (outf, "CC=");
OUTS (outf, pregs (x));
OUTS (outf, "<");
OUTS (outf, pregs (y));
OUTS (outf, "(IU)");
- return 1 * 2;
}
else if (opc == 4 && I == 0 && G == 1)
{
- notethat ("CC = pregs <= pregs ( IU )");
OUTS (outf, "CC=");
OUTS (outf, pregs (x));
OUTS (outf, "<=");
OUTS (outf, pregs (y));
OUTS (outf, "(IU)");
- return 1 * 2;
}
else if (opc == 0 && I == 1 && G == 1)
{
- notethat ("CC = pregs == imm3");
OUTS (outf, "CC=");
OUTS (outf, pregs (x));
OUTS (outf, "==");
OUTS (outf, imm3 (y));
- return 1 * 2;
}
else if (opc == 1 && I == 1 && G == 1)
{
- notethat ("CC = pregs < imm3");
OUTS (outf, "CC=");
OUTS (outf, pregs (x));
OUTS (outf, "<");
OUTS (outf, imm3 (y));
- return 1 * 2;
}
else if (opc == 2 && I == 1 && G == 1)
{
- notethat ("CC = pregs <= imm3");
OUTS (outf, "CC=");
OUTS (outf, pregs (x));
OUTS (outf, "<=");
OUTS (outf, imm3 (y));
- return 1 * 2;
}
else if (opc == 3 && I == 1 && G == 1)
{
- notethat ("CC = pregs < uimm3 ( IU )");
OUTS (outf, "CC=");
OUTS (outf, pregs (x));
OUTS (outf, "<");
OUTS (outf, uimm3 (y));
OUTS (outf, "(IU)");
- return 1 * 2;
}
else if (opc == 4 && I == 1 && G == 1)
{
- notethat ("CC = pregs <= uimm3 ( IU )");
OUTS (outf, "CC=");
OUTS (outf, pregs (x));
OUTS (outf, "<=");
OUTS (outf, uimm3 (y));
OUTS (outf, "(IU)");
- return 1 * 2;
}
else if (opc == 5 && I == 0 && G == 0)
- {
- notethat ("CC = A0 == A1");
- OUTS (outf, "CC=A0==A1");
- return 1 * 2;
- }
+ OUTS (outf, "CC=A0==A1");
+
else if (opc == 6 && I == 0 && G == 0)
- {
- notethat ("CC = A0 < A1");
- OUTS (outf, "CC=A0<A1");
- return 1 * 2;
- }
+ OUTS (outf, "CC=A0<A1");
+
else if (opc == 7 && I == 0 && G == 0)
- {
- notethat ("CC = A0 <= A1");
- OUTS (outf, "CC=A0<=A1");
- return 1 * 2;
- }
+ OUTS (outf, "CC=A0<=A1");
+
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+ return 2;
}
static int
decode_CC2dreg_0 (TIword iw0, disassemble_info *outf)
{
-/* CC2dreg
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |.op....|.reg.......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* CC2dreg
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |.op....|.reg.......|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int op = ((iw0 >> CC2dreg_op_bits) & CC2dreg_op_mask);
int reg = ((iw0 >> CC2dreg_reg_bits) & CC2dreg_reg_mask);
if (op == 0)
{
- notethat ("dregs = CC");
OUTS (outf, dregs (reg));
OUTS (outf, "=CC");
- return 1 * 2;
}
else if (op == 1)
{
- notethat ("CC = dregs");
OUTS (outf, "CC=");
OUTS (outf, dregs (reg));
- return 1 * 2;
}
else if (op == 3)
- {
- notethat ("CC =! CC");
- OUTS (outf, "CC=!CC");
- return 1 * 2;
- }
+ OUTS (outf, "CC=!CC");
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 2;
}
static int
decode_CC2stat_0 (TIword iw0, disassemble_info *outf)
{
-/* CC2stat
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |.D.|.op....|.cbit..............|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* CC2stat
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |.D.|.op....|.cbit..............|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int D = ((iw0 >> CC2stat_D_bits) & CC2stat_D_mask);
int op = ((iw0 >> CC2stat_op_bits) & CC2stat_op_mask);
int cbit = ((iw0 >> CC2stat_cbit_bits) & CC2stat_cbit_mask);
if (op == 0 && D == 0)
{
- notethat ("CC = statbits");
OUTS (outf, "CC = ");
OUTS (outf, statbits (cbit));
- return 1 * 2;
}
else if (op == 1 && D == 0)
{
- notethat ("CC |= statbits");
OUTS (outf, "CC|=");
OUTS (outf, statbits (cbit));
- return 1 * 2;
}
else if (op == 2 && D == 0)
{
- notethat ("CC &= statbits");
OUTS (outf, "CC&=");
OUTS (outf, statbits (cbit));
- return 1 * 2;
}
else if (op == 3 && D == 0)
{
- notethat ("CC ^= statbits");
OUTS (outf, "CC^=");
OUTS (outf, statbits (cbit));
- return 1 * 2;
}
else if (op == 0 && D == 1)
{
- notethat ("statbits = CC");
OUTS (outf, statbits (cbit));
OUTS (outf, "=CC");
- return 1 * 2;
}
else if (op == 1 && D == 1)
{
- notethat ("statbits |= CC");
OUTS (outf, statbits (cbit));
OUTS (outf, "|=CC");
- return 1 * 2;
}
else if (op == 2 && D == 1)
{
- notethat ("statbits &= CC");
OUTS (outf, statbits (cbit));
OUTS (outf, "&=CC");
- return 1 * 2;
}
else if (op == 3 && D == 1)
{
- notethat ("statbits ^= CC");
OUTS (outf, statbits (cbit));
OUTS (outf, "^=CC");
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 2;
}
static int
decode_BRCC_0 (TIword iw0, bfd_vma pc, disassemble_info *outf)
{
-/* BRCC
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 0 | 0 | 0 | 1 |.T.|.B.|.offset................................|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* BRCC
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 0 | 0 | 0 | 1 |.T.|.B.|.offset................................|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int B = ((iw0 >> BRCC_B_bits) & BRCC_B_mask);
int T = ((iw0 >> BRCC_T_bits) & BRCC_T_mask);
int offset = ((iw0 >> BRCC_offset_bits) & BRCC_offset_mask);
if (T == 1 && B == 1)
{
- notethat ("IF CC JUMP pcrel10 ( BP )");
OUTS (outf, "IF CC JUMP ");
OUTS (outf, pcrel10 (offset));
OUTS (outf, "(BP)");
- return 1 * 2;
}
else if (T == 0 && B == 1)
{
- notethat ("IF !CC JUMP pcrel10 ( BP )");
OUTS (outf, "IF ! CC JUMP ");
OUTS (outf, pcrel10 (offset));
OUTS (outf, "(BP)");
- return 1 * 2;
}
else if (T == 1)
{
- notethat ("IF CC JUMP pcrel10");
OUTS (outf, "IF CC JUMP ");
OUTS (outf, pcrel10 (offset));
- return 1 * 2;
}
else if (T == 0)
{
- notethat ("IF !CC JUMP pcrel10");
OUTS (outf, "IF ! CC JUMP ");
OUTS (outf, pcrel10 (offset));
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 2;
}
static int
decode_UJUMP_0 (TIword iw0, bfd_vma pc, disassemble_info *outf)
{
-/* UJUMP
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 0 | 0 | 1 | 0 |.offset........................................|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* UJUMP
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 0 | 0 | 1 | 0 |.offset........................................|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int offset = ((iw0 >> UJump_offset_bits) & UJump_offset_mask);
- notethat ("JUMP.S pcrel12");
OUTS (outf, "JUMP.S ");
OUTS (outf, pcrel12 (offset));
- return 1 * 2;
+ return 2;
}
static int
decode_REGMV_0 (TIword iw0, disassemble_info *outf)
{
-/* REGMV
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 0 | 0 | 1 | 1 |.gd........|.gs........|.dst.......|.src.......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* REGMV
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 0 | 0 | 1 | 1 |.gd........|.gs........|.dst.......|.src.......|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int gs = ((iw0 >> RegMv_gs_bits) & RegMv_gs_mask);
int gd = ((iw0 >> RegMv_gd_bits) & RegMv_gd_mask);
int src = ((iw0 >> RegMv_src_bits) & RegMv_src_mask);
int dst = ((iw0 >> RegMv_dst_bits) & RegMv_dst_mask);
- notethat ("allregs = allregs");
OUTS (outf, allregs (dst, gd));
OUTS (outf, "=");
OUTS (outf, allregs (src, gs));
- return 1 * 2;
+ return 2;
}
static int
decode_ALU2op_0 (TIword iw0, disassemble_info *outf)
{
-/* ALU2op
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 0 | 1 | 0 | 0 | 0 | 0 |.opc...........|.src.......|.dst.......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* ALU2op
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 0 | 1 | 0 | 0 | 0 | 0 |.opc...........|.src.......|.dst.......|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int src = ((iw0 >> ALU2op_src_bits) & ALU2op_src_mask);
int opc = ((iw0 >> ALU2op_opc_bits) & ALU2op_opc_mask);
int dst = ((iw0 >> ALU2op_dst_bits) & ALU2op_dst_mask);
if (opc == 0)
{
- notethat ("dregs >>>= dregs");
OUTS (outf, dregs (dst));
OUTS (outf, ">>>=");
OUTS (outf, dregs (src));
- return 1 * 2;
}
else if (opc == 1)
{
- notethat ("dregs >>= dregs");
OUTS (outf, dregs (dst));
OUTS (outf, ">>=");
OUTS (outf, dregs (src));
- return 1 * 2;
}
else if (opc == 2)
{
- notethat ("dregs <<= dregs");
OUTS (outf, dregs (dst));
OUTS (outf, "<<=");
OUTS (outf, dregs (src));
- return 1 * 2;
}
else if (opc == 3)
{
- notethat ("dregs *= dregs");
OUTS (outf, dregs (dst));
OUTS (outf, "*=");
OUTS (outf, dregs (src));
- return 1 * 2;
}
else if (opc == 4)
{
- notethat ("dregs = (dregs + dregs) << 1");
OUTS (outf, dregs (dst));
OUTS (outf, "=(");
OUTS (outf, dregs (dst));
OUTS (outf, "+");
OUTS (outf, dregs (src));
OUTS (outf, ")<<1");
- return 1 * 2;
}
else if (opc == 5)
{
- notethat ("dregs = (dregs + dregs) << 2");
OUTS (outf, dregs (dst));
OUTS (outf, "=(");
OUTS (outf, dregs (dst));
OUTS (outf, "+");
OUTS (outf, dregs (src));
OUTS (outf, ")<<2");
- return 1 * 2;
}
else if (opc == 8)
{
- notethat ("DIVQ (dregs , dregs)");
OUTS (outf, "DIVQ(");
OUTS (outf, dregs (dst));
OUTS (outf, ",");
OUTS (outf, dregs (src));
OUTS (outf, ")");
- return 1 * 2;
}
else if (opc == 9)
{
- notethat ("DIVS (dregs , dregs)");
OUTS (outf, "DIVS(");
OUTS (outf, dregs (dst));
OUTS (outf, ",");
OUTS (outf, dregs (src));
OUTS (outf, ")");
- return 1 * 2;
}
else if (opc == 10)
{
- notethat ("dregs = dregs_lo (X)");
OUTS (outf, dregs (dst));
OUTS (outf, "=");
OUTS (outf, dregs_lo (src));
OUTS (outf, "(X)");
- return 1 * 2;
}
else if (opc == 11)
{
- notethat ("dregs = dregs_lo (Z)");
OUTS (outf, dregs (dst));
OUTS (outf, "=");
OUTS (outf, dregs_lo (src));
OUTS (outf, "(Z)");
- return 1 * 2;
}
else if (opc == 12)
{
- notethat ("dregs = dregs_byte (X)");
OUTS (outf, dregs (dst));
OUTS (outf, "=");
OUTS (outf, dregs_byte (src));
OUTS (outf, "(X)");
- return 1 * 2;
}
else if (opc == 13)
{
- notethat ("dregs = dregs_byte (Z)");
OUTS (outf, dregs (dst));
OUTS (outf, "=");
OUTS (outf, dregs_byte (src));
OUTS (outf, "(Z)");
- return 1 * 2;
}
else if (opc == 14)
{
- notethat ("dregs = - dregs");
OUTS (outf, dregs (dst));
OUTS (outf, "=-");
OUTS (outf, dregs (src));
- return 1 * 2;
}
else if (opc == 15)
{
- notethat ("dregs = ~ dregs");
OUTS (outf, dregs (dst));
OUTS (outf, "=~");
OUTS (outf, dregs (src));
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 2;
}
static int
decode_PTR2op_0 (TIword iw0, disassemble_info *outf)
{
-/* PTR2op
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 0 | 1 | 0 | 0 | 0 | 1 | 0 |.opc.......|.src.......|.dst.......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* PTR2op
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 0 | 1 | 0 | 0 | 0 | 1 | 0 |.opc.......|.src.......|.dst.......|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int src = ((iw0 >> PTR2op_src_bits) & PTR2op_dst_mask);
int opc = ((iw0 >> PTR2op_opc_bits) & PTR2op_opc_mask);
int dst = ((iw0 >> PTR2op_dst_bits) & PTR2op_dst_mask);
if (opc == 0)
{
- notethat ("pregs -= pregs");
OUTS (outf, pregs (dst));
OUTS (outf, "-=");
OUTS (outf, pregs (src));
- return 1 * 2;
}
else if (opc == 1)
{
- notethat ("pregs = pregs << 2");
OUTS (outf, pregs (dst));
OUTS (outf, "=");
OUTS (outf, pregs (src));
OUTS (outf, "<<2");
- return 1 * 2;
}
else if (opc == 3)
{
- notethat ("pregs = pregs >> 2");
OUTS (outf, pregs (dst));
OUTS (outf, "=");
OUTS (outf, pregs (src));
OUTS (outf, ">>2");
- return 1 * 2;
}
else if (opc == 4)
{
- notethat ("pregs = pregs >> 1");
OUTS (outf, pregs (dst));
OUTS (outf, "=");
OUTS (outf, pregs (src));
OUTS (outf, ">>1");
- return 1 * 2;
}
else if (opc == 5)
{
- notethat ("pregs += pregs ( BREV )");
OUTS (outf, pregs (dst));
OUTS (outf, "+=");
OUTS (outf, pregs (src));
OUTS (outf, "(BREV)");
- return 1 * 2;
}
else if (opc == 6)
{
- notethat ("pregs = (pregs + pregs) << 1");
OUTS (outf, pregs (dst));
OUTS (outf, "=(");
OUTS (outf, pregs (dst));
OUTS (outf, "+");
OUTS (outf, pregs (src));
OUTS (outf, ")<<1");
- return 1 * 2;
}
else if (opc == 7)
{
- notethat ("pregs = (pregs + pregs) << 2");
OUTS (outf, pregs (dst));
OUTS (outf, "=(");
OUTS (outf, pregs (dst));
OUTS (outf, "+");
OUTS (outf, pregs (src));
OUTS (outf, ")<<2");
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 2;
}
static int
decode_LOGI2op_0 (TIword iw0, disassemble_info *outf)
{
-/* LOGI2op
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 0 | 1 | 0 | 0 | 1 |.opc.......|.src...............|.dst.......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* LOGI2op
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 0 | 1 | 0 | 0 | 1 |.opc.......|.src...............|.dst.......|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int src = ((iw0 >> LOGI2op_src_bits) & LOGI2op_src_mask);
int opc = ((iw0 >> LOGI2op_opc_bits) & LOGI2op_opc_mask);
int dst = ((iw0 >> LOGI2op_dst_bits) & LOGI2op_dst_mask);
if (opc == 0)
{
- notethat ("CC = ! BITTST ( dregs , uimm5 )");
OUTS (outf, "CC = ! BITTST (");
OUTS (outf, dregs (dst));
OUTS (outf, ",");
OUTS (outf, uimm5 (src));
OUTS (outf, ")");
- return 1 * 2;
}
else if (opc == 1)
{
- notethat ("CC = BITTST ( dregs , uimm5 )");
OUTS (outf, "CC = BITTST (");
OUTS (outf, dregs (dst));
OUTS (outf, ",");
OUTS (outf, uimm5 (src));
OUTS (outf, ")");
- return 1 * 2;
}
else if (opc == 2)
{
- notethat ("BITSET ( dregs , uimm5 )");
OUTS (outf, "BITSET (");
OUTS (outf, dregs (dst));
OUTS (outf, ",");
OUTS (outf, uimm5 (src));
OUTS (outf, ")");
- return 1 * 2;
}
else if (opc == 3)
{
- notethat ("BITTGL ( dregs , uimm5 )");
OUTS (outf, "BITTGL (");
OUTS (outf, dregs (dst));
OUTS (outf, ",");
OUTS (outf, uimm5 (src));
OUTS (outf, ")");
- return 1 * 2;
}
else if (opc == 4)
{
- notethat ("BITCLR ( dregs , uimm5 )");
OUTS (outf, "BITCLR (");
OUTS (outf, dregs (dst));
OUTS (outf, ",");
OUTS (outf, uimm5 (src));
OUTS (outf, ")");
- return 1 * 2;
}
else if (opc == 5)
{
- notethat ("dregs >>>= uimm5");
OUTS (outf, dregs (dst));
OUTS (outf, ">>>=");
OUTS (outf, uimm5 (src));
- return 1 * 2;
}
else if (opc == 6)
{
- notethat ("dregs >>= uimm5");
OUTS (outf, dregs (dst));
OUTS (outf, ">>=");
OUTS (outf, uimm5 (src));
- return 1 * 2;
}
else if (opc == 7)
{
- notethat ("dregs <<= uimm5");
OUTS (outf, dregs (dst));
OUTS (outf, "<<=");
OUTS (outf, uimm5 (src));
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 2;
}
static int
decode_COMP3op_0 (TIword iw0, disassemble_info *outf)
{
-/* COMP3op
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 0 | 1 | 0 | 1 |.opc.......|.dst.......|.src1......|.src0......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* COMP3op
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 0 | 1 | 0 | 1 |.opc.......|.dst.......|.src1......|.src0......|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int opc = ((iw0 >> COMP3op_opc_bits) & COMP3op_opc_mask);
int dst = ((iw0 >> COMP3op_dst_bits) & COMP3op_dst_mask);
int src0 = ((iw0 >> COMP3op_src0_bits) & COMP3op_src0_mask);
@@ -1827,178 +1436,149 @@ decode_COMP3op_0 (TIword iw0, disassemble_info *outf)
if (opc == 5 && src1 == src0)
{
- notethat ("pregs = pregs << 1");
OUTS (outf, pregs (dst));
OUTS (outf, "=");
OUTS (outf, pregs (src0));
OUTS (outf, "<<1");
- return 1 * 2;
}
else if (opc == 1)
{
- notethat ("dregs = dregs - dregs");
OUTS (outf, dregs (dst));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
OUTS (outf, "-");
OUTS (outf, dregs (src1));
- return 1 * 2;
}
else if (opc == 2)
{
- notethat ("dregs = dregs & dregs");
OUTS (outf, dregs (dst));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
OUTS (outf, "&");
OUTS (outf, dregs (src1));
- return 1 * 2;
}
else if (opc == 3)
{
- notethat ("dregs = dregs | dregs");
OUTS (outf, dregs (dst));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
OUTS (outf, "|");
OUTS (outf, dregs (src1));
- return 1 * 2;
}
else if (opc == 4)
{
- notethat ("dregs = dregs ^ dregs");
OUTS (outf, dregs (dst));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
OUTS (outf, "^");
OUTS (outf, dregs (src1));
- return 1 * 2;
}
else if (opc == 5)
{
- notethat ("pregs = pregs + pregs");
OUTS (outf, pregs (dst));
OUTS (outf, "=");
OUTS (outf, pregs (src0));
OUTS (outf, "+");
OUTS (outf, pregs (src1));
- return 1 * 2;
}
else if (opc == 6)
{
- notethat ("pregs = pregs + (pregs << 1)");
OUTS (outf, pregs (dst));
OUTS (outf, "=");
OUTS (outf, pregs (src0));
OUTS (outf, "+(");
OUTS (outf, pregs (src1));
OUTS (outf, "<<1)");
- return 1 * 2;
}
else if (opc == 7)
{
- notethat ("pregs = pregs + (pregs << 2)");
OUTS (outf, pregs (dst));
OUTS (outf, "=");
OUTS (outf, pregs (src0));
OUTS (outf, "+(");
OUTS (outf, pregs (src1));
OUTS (outf, "<<2)");
- return 1 * 2;
}
else if (opc == 0)
{
- notethat ("dregs = dregs + dregs");
OUTS (outf, dregs (dst));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
OUTS (outf, "+");
OUTS (outf, dregs (src1));
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 2;
}
static int
decode_COMPI2opD_0 (TIword iw0, disassemble_info *outf)
{
-/* COMPI2opD
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 0 | 1 | 1 | 0 | 0 |.op|..src......................|.dst.......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* COMPI2opD
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 0 | 1 | 1 | 0 | 0 |.op|..src......................|.dst.......|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int op = ((iw0 >> COMPI2opD_op_bits) & COMPI2opD_op_mask);
int dst = ((iw0 >> COMPI2opD_dst_bits) & COMPI2opD_dst_mask);
int src = ((iw0 >> COMPI2opD_src_bits) & COMPI2opD_src_mask);
if (op == 0)
{
- notethat ("dregs = imm7 (x)");
OUTS (outf, dregs (dst));
OUTS (outf, "=");
OUTS (outf, imm7 (src));
OUTS (outf, "(x)");
- return 1 * 2;
}
else if (op == 1)
{
- notethat ("dregs += imm7");
OUTS (outf, dregs (dst));
OUTS (outf, "+=");
OUTS (outf, imm7 (src));
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 2;
}
static int
decode_COMPI2opP_0 (TIword iw0, disassemble_info *outf)
{
-/* COMPI2opP
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 0 | 1 | 1 | 0 | 1 |.op|.src.......................|.dst.......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* COMPI2opP
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 0 | 1 | 1 | 0 | 1 |.op|.src.......................|.dst.......|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int op = ((iw0 >> COMPI2opP_op_bits) & COMPI2opP_op_mask);
int src = ((iw0 >> COMPI2opP_src_bits) & COMPI2opP_src_mask);
int dst = ((iw0 >> COMPI2opP_dst_bits) & COMPI2opP_dst_mask);
if (op == 0)
{
- notethat ("pregs = imm7");
OUTS (outf, pregs (dst));
OUTS (outf, "=");
OUTS (outf, imm7 (src));
- return 1 * 2;
}
else if (op == 1)
{
- notethat ("pregs += imm7");
OUTS (outf, pregs (dst));
OUTS (outf, "+=");
OUTS (outf, imm7 (src));
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 2;
}
static int
decode_LDSTpmod_0 (TIword iw0, disassemble_info *outf)
{
-/* LDSTpmod
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 1 | 0 | 0 | 0 |.W.|.aop...|.reg.......|.idx.......|.ptr.......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* LDSTpmod
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 1 | 0 | 0 | 0 |.W.|.aop...|.reg.......|.idx.......|.ptr.......|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int W = ((iw0 >> LDSTpmod_W_bits) & LDSTpmod_W_mask);
int aop = ((iw0 >> LDSTpmod_aop_bits) & LDSTpmod_aop_mask);
int idx = ((iw0 >> LDSTpmod_idx_bits) & LDSTpmod_idx_mask);
@@ -2007,142 +1587,117 @@ decode_LDSTpmod_0 (TIword iw0, disassemble_info *outf)
if (aop == 1 && W == 0 && idx == ptr)
{
- notethat ("dregs_lo = W [ pregs ]");
OUTS (outf, dregs_lo (reg));
OUTS (outf, "=W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "]");
- return 1 * 2;
}
else if (aop == 2 && W == 0 && idx == ptr)
{
- notethat ("dregs_hi = W [ pregs ]");
OUTS (outf, dregs_hi (reg));
OUTS (outf, "=W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "]");
- return 1 * 2;
}
else if (aop == 1 && W == 1 && idx == ptr)
{
- notethat ("W [ pregs ] = dregs_lo");
OUTS (outf, "W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "]=");
OUTS (outf, dregs_lo (reg));
- return 1 * 2;
}
else if (aop == 2 && W == 1 && idx == ptr)
{
- notethat ("W [ pregs ] = dregs_hi");
OUTS (outf, "W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "]=");
OUTS (outf, dregs_hi (reg));
- return 1 * 2;
}
else if (aop == 0 && W == 0)
{
- notethat ("dregs = [ pregs ++ pregs ]");
OUTS (outf, dregs (reg));
OUTS (outf, "=[");
OUTS (outf, pregs (ptr));
OUTS (outf, "++");
OUTS (outf, pregs (idx));
OUTS (outf, "]");
- return 1 * 2;
}
else if (aop == 1 && W == 0)
{
- notethat ("dregs_lo = W [ pregs ++ pregs ]");
OUTS (outf, dregs_lo (reg));
OUTS (outf, "=W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "++");
OUTS (outf, pregs (idx));
OUTS (outf, "]");
- return 1 * 2;
}
else if (aop == 2 && W == 0)
{
- notethat ("dregs_hi = W [ pregs ++ pregs ]");
OUTS (outf, dregs_hi (reg));
OUTS (outf, "=W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "++");
OUTS (outf, pregs (idx));
OUTS (outf, "]");
- return 1 * 2;
}
else if (aop == 3 && W == 0)
{
- notethat ("dregs = W [ pregs ++ pregs ] (Z)");
OUTS (outf, dregs (reg));
OUTS (outf, "=W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "++");
OUTS (outf, pregs (idx));
OUTS (outf, "] (Z)");
- return 1 * 2;
}
else if (aop == 3 && W == 1)
{
- notethat ("dregs = W [ pregs ++ pregs ] (X)");
OUTS (outf, dregs (reg));
OUTS (outf, "=W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "++");
OUTS (outf, pregs (idx));
OUTS (outf, "](X)");
- return 1 * 2;
}
else if (aop == 0 && W == 1)
{
- notethat ("[ pregs ++ pregs ] = dregs");
OUTS (outf, "[");
OUTS (outf, pregs (ptr));
OUTS (outf, "++");
OUTS (outf, pregs (idx));
OUTS (outf, "]=");
OUTS (outf, dregs (reg));
- return 1 * 2;
}
else if (aop == 1 && W == 1)
{
- notethat (" W [ pregs ++ pregs ] = dregs_lo");
OUTS (outf, "W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "++");
OUTS (outf, pregs (idx));
OUTS (outf, "]=");
OUTS (outf, dregs_lo (reg));
- return 1 * 2;
}
else if (aop == 2 && W == 1)
{
- notethat (" W[ pregs ++ pregs ] = dregs_hi");
OUTS (outf, "W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "++");
OUTS (outf, pregs (idx));
OUTS (outf, "]=");
OUTS (outf, dregs_hi (reg));
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 2;
}
static int
decode_dagMODim_0 (TIword iw0, disassemble_info *outf)
{
-/* dagMODim
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 |.br| 1 | 1 |.op|.m.....|.i.....|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* dagMODim
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 |.br| 1 | 1 |.op|.m.....|.i.....|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int i = ((iw0 >> DagMODim_i_bits) & DagMODim_i_mask);
int m = ((iw0 >> DagMODim_m_bits) & DagMODim_m_mask);
int br = ((iw0 >> DagMODim_br_bits) & DagMODim_br_mask);
@@ -2150,88 +1705,72 @@ decode_dagMODim_0 (TIword iw0, disassemble_info *outf)
if (op == 0 && br == 1)
{
- notethat ("iregs += mregs ( BREV )");
OUTS (outf, iregs (i));
OUTS (outf, "+=");
OUTS (outf, mregs (m));
OUTS (outf, "(BREV)");
- return 1 * 2;
}
else if (op == 0)
{
- notethat ("iregs += mregs");
OUTS (outf, iregs (i));
OUTS (outf, "+=");
OUTS (outf, mregs (m));
- return 1 * 2;
}
else if (op == 1)
{
- notethat ("iregs -= mregs");
OUTS (outf, iregs (i));
OUTS (outf, "-=");
OUTS (outf, mregs (m));
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 2;
}
static int
decode_dagMODik_0 (TIword iw0, disassemble_info *outf)
{
-/* dagMODik
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 0 |.op....|.i.....|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* dagMODik
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 0 |.op....|.i.....|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int i = ((iw0 >> DagMODik_i_bits) & DagMODik_i_mask);
int op = ((iw0 >> DagMODik_op_bits) & DagMODik_op_mask);
if (op == 0)
{
- notethat ("iregs += 2");
OUTS (outf, iregs (i));
OUTS (outf, "+=2");
- return 1 * 2;
}
else if (op == 1)
{
- notethat ("iregs -= 2");
OUTS (outf, iregs (i));
OUTS (outf, "-=2");
- return 1 * 2;
}
else if (op == 2)
{
- notethat ("iregs += 4");
OUTS (outf, iregs (i));
OUTS (outf, "+=4");
- return 1 * 2;
}
else if (op == 3)
{
- notethat ("iregs -= 4");
OUTS (outf, iregs (i));
OUTS (outf, "-=4");
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 2;
}
static int
decode_dspLDST_0 (TIword iw0, disassemble_info *outf)
{
-/* dspLDST
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 1 | 0 | 0 | 1 | 1 | 1 |.W.|.aop...|.m.....|.i.....|.reg.......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* dspLDST
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 1 | 0 | 0 | 1 | 1 | 1 |.W.|.aop...|.m.....|.i.....|.reg.......|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int i = ((iw0 >> DspLDST_i_bits) & DspLDST_i_mask);
int m = ((iw0 >> DspLDST_m_bits) & DspLDST_m_mask);
int W = ((iw0 >> DspLDST_W_bits) & DspLDST_W_mask);
@@ -2240,202 +1779,161 @@ decode_dspLDST_0 (TIword iw0, disassemble_info *outf)
if (aop == 0 && W == 0 && m == 0)
{
- notethat ("dregs = [ iregs ++ ]");
OUTS (outf, dregs (reg));
OUTS (outf, "=[");
OUTS (outf, iregs (i));
OUTS (outf, "++]");
- return 1 * 2;
}
else if (aop == 0 && W == 0 && m == 1)
{
- notethat ("dregs_lo = W [ iregs ++ ]");
OUTS (outf, dregs_lo (reg));
OUTS (outf, "=W[");
OUTS (outf, iregs (i));
OUTS (outf, "++]");
- return 1 * 2;
}
else if (aop == 0 && W == 0 && m == 2)
{
- notethat ("dregs_hi = W [ iregs ++ ]");
OUTS (outf, dregs_hi (reg));
OUTS (outf, "=W[");
OUTS (outf, iregs (i));
OUTS (outf, "++]");
- return 1 * 2;
}
else if (aop == 1 && W == 0 && m == 0)
{
- notethat ("dregs = [ iregs -- ]");
OUTS (outf, dregs (reg));
OUTS (outf, "=[");
OUTS (outf, iregs (i));
OUTS (outf, "--]");
- return 1 * 2;
}
else if (aop == 1 && W == 0 && m == 1)
{
- notethat ("dregs_lo = W [ iregs -- ]");
OUTS (outf, dregs_lo (reg));
OUTS (outf, "=W[");
OUTS (outf, iregs (i));
OUTS (outf, "--]");
- return 1 * 2;
}
else if (aop == 1 && W == 0 && m == 2)
{
- notethat ("dregs_hi = W [ iregs -- ]");
OUTS (outf, dregs_hi (reg));
OUTS (outf, "=W[");
OUTS (outf, iregs (i));
OUTS (outf, "--]");
- return 1 * 2;
}
else if (aop == 2 && W == 0 && m == 0)
{
- notethat ("dregs = [ iregs ]");
OUTS (outf, dregs (reg));
OUTS (outf, "=[");
OUTS (outf, iregs (i));
OUTS (outf, "]");
- return 1 * 2;
}
else if (aop == 2 && W == 0 && m == 1)
{
- notethat ("dregs_lo = W [ iregs ]");
OUTS (outf, dregs_lo (reg));
OUTS (outf, "=W[");
OUTS (outf, iregs (i));
OUTS (outf, "]");
- return 1 * 2;
}
else if (aop == 2 && W == 0 && m == 2)
{
- notethat ("dregs_hi = W [ iregs ]");
OUTS (outf, dregs_hi (reg));
OUTS (outf, "=W[");
OUTS (outf, iregs (i));
OUTS (outf, "]");
- return 1 * 2;
}
else if (aop == 0 && W == 1 && m == 0)
{
- notethat ("[ iregs ++ ] = dregs");
OUTS (outf, "[");
OUTS (outf, iregs (i));
OUTS (outf, "++]=");
OUTS (outf, dregs (reg));
- return 1 * 2;
}
else if (aop == 0 && W == 1 && m == 1)
{
- notethat ("W [ iregs ++ ] = dregs_lo");
OUTS (outf, "W[");
OUTS (outf, iregs (i));
OUTS (outf, "++]=");
OUTS (outf, dregs_lo (reg));
- return 1 * 2;
}
else if (aop == 0 && W == 1 && m == 2)
{
- notethat ("W [ iregs ++ ] = dregs_hi");
OUTS (outf, "W[");
OUTS (outf, iregs (i));
OUTS (outf, "++]=");
OUTS (outf, dregs_hi (reg));
- return 1 * 2;
}
else if (aop == 1 && W == 1 && m == 0)
{
- notethat ("[ iregs -- ] = dregs");
OUTS (outf, "[");
OUTS (outf, iregs (i));
OUTS (outf, "--]=");
OUTS (outf, dregs (reg));
- return 1 * 2;
}
else if (aop == 1 && W == 1 && m == 1)
{
- notethat ("W [ iregs -- ] = dregs_lo");
OUTS (outf, "W[");
OUTS (outf, iregs (i));
OUTS (outf, "--]=");
OUTS (outf, dregs_lo (reg));
- return 1 * 2;
}
else if (aop == 1 && W == 1 && m == 2)
{
- notethat ("W [ iregs -- ] = dregs_hi");
OUTS (outf, "W[");
OUTS (outf, iregs (i));
OUTS (outf, "--]=");
OUTS (outf, dregs_hi (reg));
- return 1 * 2;
}
else if (aop == 2 && W == 1 && m == 0)
{
- notethat ("[ iregs ] = dregs");
OUTS (outf, "[");
OUTS (outf, iregs (i));
OUTS (outf, "]=");
OUTS (outf, dregs (reg));
- return 1 * 2;
}
else if (aop == 2 && W == 1 && m == 1)
{
- notethat (" W [ iregs ] = dregs_lo");
OUTS (outf, "W[");
OUTS (outf, iregs (i));
OUTS (outf, "]=");
OUTS (outf, dregs_lo (reg));
- return 1 * 2;
}
else if (aop == 2 && W == 1 && m == 2)
{
- notethat (" W [ iregs ] = dregs_hi");
OUTS (outf, "W[");
OUTS (outf, iregs (i));
OUTS (outf, "]=");
OUTS (outf, dregs_hi (reg));
- return 1 * 2;
}
else if (aop == 3 && W == 0)
{
- notethat ("dregs = [ iregs ++ mregs ]");
OUTS (outf, dregs (reg));
OUTS (outf, "=[");
OUTS (outf, iregs (i));
OUTS (outf, "++");
OUTS (outf, mregs (m));
OUTS (outf, "]");
- return 1 * 2;
}
else if (aop == 3 && W == 1)
{
- notethat ("[ iregs ++ mregs ] = dregs");
OUTS (outf, "[");
OUTS (outf, iregs (i));
OUTS (outf, "++");
OUTS (outf, mregs (m));
OUTS (outf, "]=");
OUTS (outf, dregs (reg));
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 2;
}
static int
decode_LDST_0 (TIword iw0, disassemble_info *outf)
{
-/* LDST
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 1 | 0 | 0 | 1 |.sz....|.W.|.aop...|.Z.|.ptr.......|.reg.......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* LDST
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 1 | 0 | 0 | 1 |.sz....|.W.|.aop...|.Z.|.ptr.......|.reg.......|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int Z = ((iw0 >> LDST_Z_bits) & LDST_Z_mask);
int W = ((iw0 >> LDST_W_bits) & LDST_W_mask);
int sz = ((iw0 >> LDST_sz_bits) & LDST_sz_mask);
@@ -2445,324 +1943,258 @@ decode_LDST_0 (TIword iw0, disassemble_info *outf)
if (aop == 0 && sz == 0 && Z == 0 && W == 0)
{
- notethat ("dregs = [ pregs ++ ]");
OUTS (outf, dregs (reg));
OUTS (outf, "=[");
OUTS (outf, pregs (ptr));
OUTS (outf, "++]");
- return 1 * 2;
}
else if (aop == 0 && sz == 0 && Z == 1 && W == 0)
{
- notethat ("pregs = [ pregs ++ ]");
OUTS (outf, pregs (reg));
OUTS (outf, "=[");
OUTS (outf, pregs (ptr));
OUTS (outf, "++]");
- return 1 * 2;
}
else if (aop == 0 && sz == 1 && Z == 0 && W == 0)
{
- notethat ("dregs = W [ pregs ++ ] (z)");
OUTS (outf, dregs (reg));
OUTS (outf, "=W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "++] (Z)");
- return 1 * 2;
}
else if (aop == 0 && sz == 1 && Z == 1 && W == 0)
{
- notethat ("dregs = W [ pregs ++ ] (X)");
OUTS (outf, dregs (reg));
OUTS (outf, "=W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "++](X)");
- return 1 * 2;
}
else if (aop == 0 && sz == 2 && Z == 0 && W == 0)
{
- notethat ("dregs = B [ pregs ++ ] (Z)");
OUTS (outf, dregs (reg));
OUTS (outf, "=B[");
OUTS (outf, pregs (ptr));
OUTS (outf, "++] (Z)");
- return 1 * 2;
}
else if (aop == 0 && sz == 2 && Z == 1 && W == 0)
{
- notethat ("dregs = B [ pregs ++ ] (X)");
OUTS (outf, dregs (reg));
OUTS (outf, "=B[");
OUTS (outf, pregs (ptr));
OUTS (outf, "++](X)");
- return 1 * 2;
}
else if (aop == 1 && sz == 0 && Z == 0 && W == 0)
{
- notethat ("dregs = [ pregs -- ]");
OUTS (outf, dregs (reg));
OUTS (outf, "=[");
OUTS (outf, pregs (ptr));
OUTS (outf, "--]");
- return 1 * 2;
}
else if (aop == 1 && sz == 0 && Z == 1 && W == 0)
{
- notethat ("pregs = [ pregs -- ]");
OUTS (outf, pregs (reg));
OUTS (outf, "=[");
OUTS (outf, pregs (ptr));
OUTS (outf, "--]");
- return 1 * 2;
}
else if (aop == 1 && sz == 1 && Z == 0 && W == 0)
{
- notethat ("dregs = W [ pregs -- ] (Z)");
OUTS (outf, dregs (reg));
OUTS (outf, "=W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "--] (Z)");
- return 1 * 2;
}
else if (aop == 1 && sz == 1 && Z == 1 && W == 0)
{
- notethat ("dregs = W [ pregs -- ] (X)");
OUTS (outf, dregs (reg));
OUTS (outf, "=W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "--](X)");
- return 1 * 2;
}
else if (aop == 1 && sz == 2 && Z == 0 && W == 0)
{
- notethat ("dregs = B [ pregs -- ] (Z)");
OUTS (outf, dregs (reg));
OUTS (outf, "=B[");
OUTS (outf, pregs (ptr));
OUTS (outf, "--] (Z)");
- return 1 * 2;
}
else if (aop == 1 && sz == 2 && Z == 1 && W == 0)
{
- notethat ("dregs = B [ pregs -- ] (X)");
OUTS (outf, dregs (reg));
OUTS (outf, "=B[");
OUTS (outf, pregs (ptr));
OUTS (outf, "--](X)");
- return 1 * 2;
}
else if (aop == 2 && sz == 0 && Z == 0 && W == 0)
{
- notethat ("dregs = [ pregs ]");
OUTS (outf, dregs (reg));
OUTS (outf, "=[");
OUTS (outf, pregs (ptr));
OUTS (outf, "]");
- return 1 * 2;
}
else if (aop == 2 && sz == 0 && Z == 1 && W == 0)
{
- notethat ("pregs = [ pregs ]");
OUTS (outf, pregs (reg));
OUTS (outf, "=[");
OUTS (outf, pregs (ptr));
OUTS (outf, "]");
- return 1 * 2;
}
else if (aop == 2 && sz == 1 && Z == 0 && W == 0)
{
- notethat ("dregs = W [ pregs ] (Z)");
OUTS (outf, dregs (reg));
OUTS (outf, "=W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "] (Z)");
- return 1 * 2;
}
else if (aop == 2 && sz == 1 && Z == 1 && W == 0)
{
- notethat ("dregs = W [ pregs ] (X)");
OUTS (outf, dregs (reg));
OUTS (outf, "=W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "](X)");
- return 1 * 2;
}
else if (aop == 2 && sz == 2 && Z == 0 && W == 0)
{
- notethat ("dregs = B [ pregs ] (Z)");
OUTS (outf, dregs (reg));
OUTS (outf, "=B[");
OUTS (outf, pregs (ptr));
OUTS (outf, "] (Z)");
- return 1 * 2;
}
else if (aop == 2 && sz == 2 && Z == 1 && W == 0)
{
- notethat ("dregs = B [ pregs ] (X)");
OUTS (outf, dregs (reg));
OUTS (outf, "=B[");
OUTS (outf, pregs (ptr));
OUTS (outf, "](X)");
- return 1 * 2;
}
else if (aop == 0 && sz == 0 && Z == 0 && W == 1)
{
- notethat ("[ pregs ++ ] = dregs");
OUTS (outf, "[");
OUTS (outf, pregs (ptr));
OUTS (outf, "++]=");
OUTS (outf, dregs (reg));
- return 1 * 2;
}
else if (aop == 0 && sz == 0 && Z == 1 && W == 1)
{
- notethat ("[ pregs ++ ] = pregs");
OUTS (outf, "[");
OUTS (outf, pregs (ptr));
OUTS (outf, "++]=");
OUTS (outf, pregs (reg));
- return 1 * 2;
}
else if (aop == 0 && sz == 1 && Z == 0 && W == 1)
{
- notethat ("W [ pregs ++ ] = dregs");
OUTS (outf, "W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "++]=");
OUTS (outf, dregs (reg));
- return 1 * 2;
}
else if (aop == 0 && sz == 2 && Z == 0 && W == 1)
{
- notethat ("B [ pregs ++ ] = dregs");
OUTS (outf, "B[");
OUTS (outf, pregs (ptr));
OUTS (outf, "++]=");
OUTS (outf, dregs (reg));
- return 1 * 2;
}
else if (aop == 1 && sz == 0 && Z == 0 && W == 1)
{
- notethat ("[ pregs -- ] = dregs");
OUTS (outf, "[");
OUTS (outf, pregs (ptr));
OUTS (outf, "--]=");
OUTS (outf, dregs (reg));
- return 1 * 2;
}
else if (aop == 1 && sz == 0 && Z == 1 && W == 1)
{
- notethat ("[ pregs -- ] = pregs");
OUTS (outf, "[");
OUTS (outf, pregs (ptr));
OUTS (outf, "--]=");
OUTS (outf, pregs (reg));
- return 1 * 2;
}
else if (aop == 1 && sz == 1 && Z == 0 && W == 1)
{
- notethat ("W [ pregs -- ] = dregs");
OUTS (outf, "W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "--]=");
OUTS (outf, dregs (reg));
- return 1 * 2;
}
else if (aop == 1 && sz == 2 && Z == 0 && W == 1)
{
- notethat ("B [ pregs -- ] = dregs");
OUTS (outf, "B[");
OUTS (outf, pregs (ptr));
OUTS (outf, "--]=");
OUTS (outf, dregs (reg));
- return 1 * 2;
}
else if (aop == 2 && sz == 0 && Z == 0 && W == 1)
{
- notethat ("[ pregs ] = dregs");
OUTS (outf, "[");
OUTS (outf, pregs (ptr));
OUTS (outf, "]=");
OUTS (outf, dregs (reg));
- return 1 * 2;
}
else if (aop == 2 && sz == 0 && Z == 1 && W == 1)
{
- notethat ("[ pregs ] = pregs");
OUTS (outf, "[");
OUTS (outf, pregs (ptr));
OUTS (outf, "]=");
OUTS (outf, pregs (reg));
- return 1 * 2;
}
else if (aop == 2 && sz == 1 && Z == 0 && W == 1)
{
- notethat ("W [ pregs ] = dregs");
OUTS (outf, "W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "]=");
OUTS (outf, dregs (reg));
- return 1 * 2;
}
else if (aop == 2 && sz == 2 && Z == 0 && W == 1)
{
- notethat ("B [ pregs ] = dregs");
OUTS (outf, "B[");
OUTS (outf, pregs (ptr));
OUTS (outf, "]=");
OUTS (outf, dregs (reg));
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 2;
}
static int
decode_LDSTiiFP_0 (TIword iw0, disassemble_info *outf)
{
-/* LDSTiiFP
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 1 | 0 | 1 | 1 | 1 | 0 |.W.|.offset............|.reg...........|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* LDSTiiFP
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 1 | 0 | 1 | 1 | 1 | 0 |.W.|.offset............|.reg...........|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int reg = ((iw0 >> LDSTiiFP_reg_bits) & LDSTiiFP_reg_mask);
int offset = ((iw0 >> LDSTiiFP_offset_bits) & LDSTiiFP_offset_mask);
int W = ((iw0 >> LDSTiiFP_W_bits) & LDSTiiFP_W_mask);
if (W == 0)
{
- notethat ("dpregs = [ FP - negimm5s4 ]");
OUTS (outf, dpregs (reg));
OUTS (outf, "=[FP");
OUTS (outf, negimm5s4 (offset));
OUTS (outf, "]");
- return 1 * 2;
}
else if (W == 1)
{
- notethat ("[ FP - negimm5s4 ] = dpregs");
OUTS (outf, "[FP");
OUTS (outf, negimm5s4 (offset));
OUTS (outf, "]=");
OUTS (outf, dpregs (reg));
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 2;
}
static int
decode_LDSTii_0 (TIword iw0, disassemble_info *outf)
{
-/* LDSTii
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 1 | 0 | 1 |.W.|.op....|.offset........|.ptr.......|.reg.......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* LDSTii
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 1 | 0 | 1 |.W.|.op....|.offset........|.ptr.......|.reg.......|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int reg = ((iw0 >> LDSTii_reg_bit) & LDSTii_reg_mask);
int ptr = ((iw0 >> LDSTii_ptr_bit) & LDSTii_ptr_mask);
int offset = ((iw0 >> LDSTii_offset_bit) & LDSTii_offset_mask);
@@ -2771,62 +2203,51 @@ decode_LDSTii_0 (TIword iw0, disassemble_info *outf)
if (W == 0 && op == 0)
{
- notethat ("dregs = [ pregs + uimm4s4 ]");
OUTS (outf, dregs (reg));
OUTS (outf, "=[");
OUTS (outf, pregs (ptr));
OUTS (outf, "+");
OUTS (outf, uimm4s4 (offset));
OUTS (outf, "]");
- return 1 * 2;
}
else if (W == 0 && op == 1)
{
- notethat ("dregs = W [ pregs + uimm4s2 ] (Z)");
OUTS (outf, dregs (reg));
OUTS (outf, "=W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "+");
OUTS (outf, uimm4s2 (offset));
OUTS (outf, "] (Z)");
- return 1 * 2;
}
else if (W == 0 && op == 2)
{
- notethat ("dregs = W [ pregs + uimm4s2 ] (X)");
OUTS (outf, dregs (reg));
OUTS (outf, "=W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "+");
OUTS (outf, uimm4s2 (offset));
OUTS (outf, "](X)");
- return 1 * 2;
}
else if (W == 0 && op == 3)
{
- notethat ("pregs = [ pregs + uimm4s4 ]");
OUTS (outf, pregs (reg));
OUTS (outf, "=[");
OUTS (outf, pregs (ptr));
OUTS (outf, "+");
OUTS (outf, uimm4s4 (offset));
OUTS (outf, "]");
- return 1 * 2;
}
else if (W == 1 && op == 0)
{
- notethat ("[ pregs + uimm4s4 ] = dregs");
OUTS (outf, "[");
OUTS (outf, pregs (ptr));
OUTS (outf, "+");
OUTS (outf, uimm4s4 (offset));
OUTS (outf, "]=");
OUTS (outf, dregs (reg));
- return 1 * 2;
}
else if (W == 1 && op == 1)
{
- notethat ("W [ pregs + uimm4s2 ] = dregs");
OUTS (outf, "W");
OUTS (outf, "[");
OUTS (outf, pregs (ptr));
@@ -2835,34 +2256,30 @@ decode_LDSTii_0 (TIword iw0, disassemble_info *outf)
OUTS (outf, "]");
OUTS (outf, "=");
OUTS (outf, dregs (reg));
- return 1 * 2;
}
else if (W == 1 && op == 3)
{
- notethat ("[ pregs + uimm4s4 ] = pregs");
OUTS (outf, "[");
OUTS (outf, pregs (ptr));
OUTS (outf, "+");
OUTS (outf, uimm4s4 (offset));
OUTS (outf, "]=");
OUTS (outf, pregs (reg));
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 2;
}
static int
decode_LoopSetup_0 (TIword iw0, TIword iw1, bfd_vma pc, disassemble_info *outf)
{
-/* LoopSetup
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 |.rop...|.c.|.soffset.......|
-|.reg...........| - | - |.eoffset...............................|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* LoopSetup
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 |.rop...|.c.|.soffset.......|
+ |.reg...........| - | - |.eoffset...............................|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int c = ((iw0 >> (LoopSetup_c_bits - 16)) & LoopSetup_c_mask);
int reg = ((iw1 >> LoopSetup_reg_bits) & LoopSetup_reg_mask);
int rop = ((iw0 >> (LoopSetup_rop_bits - 16)) & LoopSetup_rop_mask);
@@ -2871,7 +2288,6 @@ decode_LoopSetup_0 (TIword iw0, TIword iw1, bfd_vma pc, disassemble_info *outf)
if (rop == 0)
{
- notethat ("LSETUP ( pcrel4 , lppcrel10 ) counters");
OUTS (outf, "LSETUP");
OUTS (outf, "(");
OUTS (outf, pcrel4 (soffset));
@@ -2879,11 +2295,9 @@ decode_LoopSetup_0 (TIword iw0, TIword iw1, bfd_vma pc, disassemble_info *outf)
OUTS (outf, lppcrel10 (eoffset));
OUTS (outf, ")");
OUTS (outf, counters (c));
- return 2 * 2;
}
else if (rop == 1)
{
- notethat ("LSETUP ( pcrel4 , lppcrel10 ) counters = pregs");
OUTS (outf, "LSETUP");
OUTS (outf, "(");
OUTS (outf, pcrel4 (soffset));
@@ -2893,11 +2307,9 @@ decode_LoopSetup_0 (TIword iw0, TIword iw1, bfd_vma pc, disassemble_info *outf)
OUTS (outf, counters (c));
OUTS (outf, "=");
OUTS (outf, pregs (reg));
- return 2 * 2;
}
else if (rop == 3)
{
- notethat ("LSETUP ( pcrel4 , lppcrel10 ) counters = pregs >> 1");
OUTS (outf, "LSETUP");
OUTS (outf, "(");
OUTS (outf, pcrel4 (soffset));
@@ -2908,23 +2320,21 @@ decode_LoopSetup_0 (TIword iw0, TIword iw1, bfd_vma pc, disassemble_info *outf)
OUTS (outf, "=");
OUTS (outf, pregs (reg));
OUTS (outf, ">>1");
- return 2 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 4;
}
static int
decode_LDIMMhalf_0 (TIword iw0, TIword iw1, disassemble_info *outf)
{
-/* LDIMMhalf
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 |.Z.|.H.|.S.|.grp...|.reg.......|
-|.hword.........................................................|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* LDIMMhalf
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 |.Z.|.H.|.S.|.grp...|.reg.......|
+ |.hword.........................................................|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int H = ((iw0 >> (LDIMMhalf_H_bits - 16)) & LDIMMhalf_H_mask);
int Z = ((iw0 >> (LDIMMhalf_Z_bits - 16)) & LDIMMhalf_Z_mask);
int S = ((iw0 >> (LDIMMhalf_S_bits - 16)) & LDIMMhalf_S_mask);
@@ -2934,111 +2344,86 @@ decode_LDIMMhalf_0 (TIword iw0, TIword iw1, disassemble_info *outf)
if (grp == 0 && H == 0 && S == 0 && Z == 0)
{
- notethat ("dregs_lo = imm16");
OUTS (outf, dregs_lo (reg));
OUTS (outf, "=");
OUTS (outf, imm16 (hword));
- return 2 * 2;
}
else if (grp == 0 && H == 1 && S == 0 && Z == 0)
{
- notethat ("dregs_hi = imm16");
OUTS (outf, dregs_hi (reg));
OUTS (outf, "=");
OUTS (outf, imm16 (hword));
- return 2 * 2;
}
else if (grp == 0 && H == 0 && S == 1 && Z == 0)
{
- notethat ("dregs = imm16 (x)");
OUTS (outf, dregs (reg));
OUTS (outf, "=");
OUTS (outf, imm16 (hword));
OUTS (outf, " (X)");
- return 2 * 2;
}
else if (H == 0 && S == 1 && Z == 0)
{
- notethat ("regs = imm16 (x)");
OUTS (outf, regs (reg, grp));
OUTS (outf, "=");
OUTS (outf, imm16 (hword));
OUTS (outf, " (X)");
- return 2 * 2;
}
else if (H == 0 && S == 0 && Z == 1)
{
- notethat ("regs = luimm16 (Z)");
OUTS (outf, regs (reg, grp));
OUTS (outf, "=");
OUTS (outf, luimm16 (hword));
OUTS (outf, "(Z)");
- return 2 * 2;
}
else if (H == 0 && S == 0 && Z == 0)
{
- notethat ("regs_lo = luimm16");
OUTS (outf, regs_lo (reg, grp));
OUTS (outf, "=");
OUTS (outf, luimm16 (hword));
- return 2 * 2;
}
else if (H == 1 && S == 0 && Z == 0)
{
- notethat ("regs_hi = huimm16");
OUTS (outf, regs_hi (reg, grp));
OUTS (outf, "=");
OUTS (outf, huimm16 (hword));
- return 2 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 4;
}
static int
decode_CALLa_0 (TIword iw0, TIword iw1, bfd_vma pc, disassemble_info *outf)
{
-/* CALLa
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 1 | 1 | 1 | 0 | 0 | 0 | 1 |.S.|.msw...........................|
-|.lsw...........................................................|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* CALLa
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 1 | 1 | 1 | 0 | 0 | 0 | 1 |.S.|.msw...........................|
+ |.lsw...........................................................|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int S = ((iw0 >> (CALLa_S_bits - 16)) & CALLa_S_mask);
int lsw = ((iw1 >> 0) & 0xffff);
int msw = ((iw0 >> 0) & 0xff);
if (S == 1)
- {
- notethat ("CALL pcrel24");
- OUTS (outf, "CALL ");
- OUTS (outf, pcrel24 (((msw) << 16) | (lsw)));
- return 2 * 2;
- }
+ OUTS (outf, "CALL ");
else if (S == 0)
- {
- notethat ("JUMP.L pcrel24");
- OUTS (outf, "JUMP.L ");
- OUTS (outf, pcrel24 (((msw) << 16) | (lsw)));
- return 2 * 2;
- }
+ OUTS (outf, "JUMP.L ");
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ OUTS (outf, pcrel24 (((msw) << 16) | (lsw)));
+ return 4;
}
static int
decode_LDSTidxI_0 (TIword iw0, TIword iw1, disassemble_info *outf)
{
-/* LDSTidxI
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 1 | 1 | 1 | 0 | 0 | 1 |.W.|.Z.|.sz....|.ptr.......|.reg.......|
-|.offset........................................................|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* LDSTidxI
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 1 | 1 | 1 | 0 | 0 | 1 |.W.|.Z.|.sz....|.ptr.......|.reg.......|
+ |.offset........................................................|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int Z = ((iw0 >> (LDSTidxI_Z_bits - 16)) & LDSTidxI_Z_mask);
int W = ((iw0 >> (LDSTidxI_W_bits - 16)) & LDSTidxI_W_mask);
int sz = ((iw0 >> (LDSTidxI_sz_bits - 16)) & LDSTidxI_sz_mask);
@@ -3048,174 +2433,146 @@ decode_LDSTidxI_0 (TIword iw0, TIword iw1, disassemble_info *outf)
if (W == 0 && sz == 0 && Z == 0)
{
- notethat ("dregs = [ pregs + imm16s4 ]");
OUTS (outf, dregs (reg));
OUTS (outf, "=[");
OUTS (outf, pregs (ptr));
OUTS (outf, "+");
OUTS (outf, imm16s4 (offset));
OUTS (outf, "]");
- return 2 * 2;
}
else if (W == 0 && sz == 0 && Z == 1)
{
- notethat ("pregs = [ pregs + imm16s4 ]");
OUTS (outf, pregs (reg));
OUTS (outf, "=[");
OUTS (outf, pregs (ptr));
OUTS (outf, "+");
OUTS (outf, imm16s4 (offset));
OUTS (outf, "]");
- return 2 * 2;
}
else if (W == 0 && sz == 1 && Z == 0)
{
- notethat ("dregs = W [ pregs + imm16s2 ] (Z)");
OUTS (outf, dregs (reg));
OUTS (outf, "=W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "+");
OUTS (outf, imm16s2 (offset));
OUTS (outf, "] (Z)");
- return 2 * 2;
}
else if (W == 0 && sz == 1 && Z == 1)
{
- notethat ("dregs = W [ pregs + imm16s2 ] (X)");
OUTS (outf, dregs (reg));
OUTS (outf, "=W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "+");
OUTS (outf, imm16s2 (offset));
OUTS (outf, "](X)");
- return 2 * 2;
}
else if (W == 0 && sz == 2 && Z == 0)
{
- notethat ("dregs = B [ pregs + imm16 ] (Z)");
OUTS (outf, dregs (reg));
OUTS (outf, "=B[");
OUTS (outf, pregs (ptr));
OUTS (outf, "+");
OUTS (outf, imm16 (offset));
OUTS (outf, "] (Z)");
- return 2 * 2;
}
else if (W == 0 && sz == 2 && Z == 1)
{
- notethat ("dregs = B [ pregs + imm16 ] (X)");
OUTS (outf, dregs (reg));
OUTS (outf, "=B[");
OUTS (outf, pregs (ptr));
OUTS (outf, "+");
OUTS (outf, imm16 (offset));
OUTS (outf, "](X)");
- return 2 * 2;
}
else if (W == 1 && sz == 0 && Z == 0)
{
- notethat ("[ pregs + imm16s4 ] = dregs");
OUTS (outf, "[");
OUTS (outf, pregs (ptr));
OUTS (outf, "+");
OUTS (outf, imm16s4 (offset));
OUTS (outf, "]=");
OUTS (outf, dregs (reg));
- return 2 * 2;
}
else if (W == 1 && sz == 0 && Z == 1)
{
- notethat ("[ pregs + imm16s4 ] = pregs");
OUTS (outf, "[");
OUTS (outf, pregs (ptr));
OUTS (outf, "+");
OUTS (outf, imm16s4 (offset));
OUTS (outf, "]=");
OUTS (outf, pregs (reg));
- return 2 * 2;
}
else if (W == 1 && sz == 1 && Z == 0)
{
- notethat ("W [ pregs + imm16s2 ] = dregs");
OUTS (outf, "W[");
OUTS (outf, pregs (ptr));
OUTS (outf, "+");
OUTS (outf, imm16s2 (offset));
OUTS (outf, "]=");
OUTS (outf, dregs (reg));
- return 2 * 2;
}
else if (W == 1 && sz == 2 && Z == 0)
{
- notethat ("B [ pregs + imm16 ] = dregs");
OUTS (outf, "B[");
OUTS (outf, pregs (ptr));
OUTS (outf, "+");
OUTS (outf, imm16 (offset));
OUTS (outf, "]=");
OUTS (outf, dregs (reg));
- return 2 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 4;
}
static int
decode_linkage_0 (TIword iw0, TIword iw1, disassemble_info *outf)
{
-/* linkage
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |.R.|
-|.framesize.....................................................|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* linkage
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |.R.|
+ |.framesize.....................................................|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int R = ((iw0 >> (Linkage_R_bits - 16)) & Linkage_R_mask);
int framesize = ((iw1 >> Linkage_framesize_bits) & Linkage_framesize_mask);
if (R == 0)
{
- notethat ("LINK uimm16s4");
OUTS (outf, "LINK ");
OUTS (outf, uimm16s4 (framesize));
- return 2 * 2;
}
else if (R == 1)
- {
- notethat ("UNLINK");
- OUTS (outf, "UNLINK");
- return 2 * 2;
- }
+ OUTS (outf, "UNLINK");
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 4;
}
static int
decode_dsp32mac_0 (TIword iw0, TIword iw1, disassemble_info *outf)
{
-/* dsp32mac
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 1 | 1 | 0 | 0 |.M.| 0 | 0 |.mmod..........|.MM|.P.|.w1|.op1...|
-|.h01|.h11|.w0|.op0...|.h00|.h10|.dst.......|.src0......|.src1......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
- int op1 = ((iw0 >> (DSP32Mac_op1_bits - 16)) & DSP32Mac_op1_mask);
- int w1 = ((iw0 >> (DSP32Mac_w1_bits - 16)) & DSP32Mac_w1_mask);
- int P = ((iw0 >> (DSP32Mac_p_bits - 16)) & DSP32Mac_p_mask);
- int MM = ((iw0 >> (DSP32Mac_MM_bits - 16)) & DSP32Mac_MM_mask);
+ /* dsp32mac
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 1 | 1 | 0 | 0 |.M.| 0 | 0 |.mmod..........|.MM|.P.|.w1|.op1...|
+ |.h01|.h11|.w0|.op0...|.h00|.h10|.dst.......|.src0......|.src1..|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
+ int op1 = ((iw0 >> (DSP32Mac_op1_bits - 16)) & DSP32Mac_op1_mask);
+ int w1 = ((iw0 >> (DSP32Mac_w1_bits - 16)) & DSP32Mac_w1_mask);
+ int P = ((iw0 >> (DSP32Mac_p_bits - 16)) & DSP32Mac_p_mask);
+ int MM = ((iw0 >> (DSP32Mac_MM_bits - 16)) & DSP32Mac_MM_mask);
int mmod = ((iw0 >> (DSP32Mac_mmod_bits - 16)) & DSP32Mac_mmod_mask);
- int w0 = ((iw1 >> DSP32Mac_w0_bits) & DSP32Mac_w0_mask);
+ int w0 = ((iw1 >> DSP32Mac_w0_bits) & DSP32Mac_w0_mask);
int src0 = ((iw1 >> DSP32Mac_src0_bits) & DSP32Mac_src0_mask);
int src1 = ((iw1 >> DSP32Mac_src1_bits) & DSP32Mac_src1_mask);
- int dst = ((iw1 >> DSP32Mac_dst_bits) & DSP32Mac_dst_mask);
- int h10 = ((iw1 >> DSP32Mac_h10_bits) & DSP32Mac_h10_mask);
- int h00 = ((iw1 >> DSP32Mac_h00_bits) & DSP32Mac_h00_mask);
- int op0 = ((iw1 >> DSP32Mac_op0_bits) & DSP32Mac_op0_mask);
- int h11 = ((iw1 >> DSP32Mac_h11_bits) & DSP32Mac_h11_mask);
- int h01 = ((iw1 >> DSP32Mac_h01_bits) & DSP32Mac_h01_mask);
+ int dst = ((iw1 >> DSP32Mac_dst_bits) & DSP32Mac_dst_mask);
+ int h10 = ((iw1 >> DSP32Mac_h10_bits) & DSP32Mac_h10_mask);
+ int h00 = ((iw1 >> DSP32Mac_h00_bits) & DSP32Mac_h00_mask);
+ int op0 = ((iw1 >> DSP32Mac_op0_bits) & DSP32Mac_op0_mask);
+ int h11 = ((iw1 >> DSP32Mac_h11_bits) & DSP32Mac_h11_mask);
+ int h01 = ((iw1 >> DSP32Mac_h01_bits) & DSP32Mac_h01_mask);
if (w0 == 0 && w1 == 0 && op1 == 3 && op0 == 3)
return 0;
@@ -3279,30 +2636,30 @@ decode_dsp32mac_0 (TIword iw0, TIword iw1, disassemble_info *outf)
static int
decode_dsp32mult_0 (TIword iw0, TIword iw1, disassemble_info *outf)
{
-/* dsp32mult
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 1 | 1 | 0 | 0 |.M.| 0 | 1 |.mmod..........|.MM|.P.|.w1|.op1...|
-|.h01|.h11|.w0|.op0...|.h00|.h10|.dst.......|.src0......|.src1......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
- int w1 = ((iw0 >> (DSP32Mac_w1_bits - 16)) & DSP32Mac_w1_mask);
- int P = ((iw0 >> (DSP32Mac_p_bits - 16)) & DSP32Mac_p_mask);
- int MM = ((iw0 >> (DSP32Mac_MM_bits - 16)) & DSP32Mac_MM_mask);
+ /* dsp32mult
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 1 | 1 | 0 | 0 |.M.| 0 | 1 |.mmod..........|.MM|.P.|.w1|.op1...|
+ |.h01|.h11|.w0|.op0...|.h00|.h10|.dst.......|.src0......|.src1..|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
+ int w1 = ((iw0 >> (DSP32Mac_w1_bits - 16)) & DSP32Mac_w1_mask);
+ int P = ((iw0 >> (DSP32Mac_p_bits - 16)) & DSP32Mac_p_mask);
+ int MM = ((iw0 >> (DSP32Mac_MM_bits - 16)) & DSP32Mac_MM_mask);
int mmod = ((iw0 >> (DSP32Mac_mmod_bits - 16)) & DSP32Mac_mmod_mask);
- int w0 = ((iw1 >> DSP32Mac_w0_bits) & DSP32Mac_w0_mask);
+ int w0 = ((iw1 >> DSP32Mac_w0_bits) & DSP32Mac_w0_mask);
int src0 = ((iw1 >> DSP32Mac_src0_bits) & DSP32Mac_src0_mask);
int src1 = ((iw1 >> DSP32Mac_src1_bits) & DSP32Mac_src1_mask);
- int dst = ((iw1 >> DSP32Mac_dst_bits) & DSP32Mac_dst_mask);
- int h10 = ((iw1 >> DSP32Mac_h10_bits) & DSP32Mac_h10_mask);
- int h00 = ((iw1 >> DSP32Mac_h00_bits) & DSP32Mac_h00_mask);
- int h11 = ((iw1 >> DSP32Mac_h11_bits) & DSP32Mac_h11_mask);
- int h01 = ((iw1 >> DSP32Mac_h01_bits) & DSP32Mac_h01_mask);
+ int dst = ((iw1 >> DSP32Mac_dst_bits) & DSP32Mac_dst_mask);
+ int h10 = ((iw1 >> DSP32Mac_h10_bits) & DSP32Mac_h10_mask);
+ int h00 = ((iw1 >> DSP32Mac_h00_bits) & DSP32Mac_h00_mask);
+ int h11 = ((iw1 >> DSP32Mac_h11_bits) & DSP32Mac_h11_mask);
+ int h01 = ((iw1 >> DSP32Mac_h01_bits) & DSP32Mac_h01_mask);
if (w1 == 0 && w0 == 0)
return 0;
+
if (((1 << mmod) & (P ? 0x313 : 0x1b57)) == 0)
return 0;
-
+
if (w1)
{
OUTS (outf, P ? dregs (dst | 1) : dregs_hi (dst));
@@ -3332,12 +2689,11 @@ decode_dsp32mult_0 (TIword iw0, TIword iw1, disassemble_info *outf)
static int
decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
{
-/* dsp32alu
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 1 | 1 | 0 | 0 |.M.| 1 | 0 | - | - | - |.HL|.aopcde............|
-|.aop...|.s.|.x.|.dst0......|.dst1......|.src0......|.src1......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* dsp32alu
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 1 | 1 | 0 | 0 |.M.| 1 | 0 | - | - | - |.HL|.aopcde............|
+ |.aop...|.s.|.x.|.dst0......|.dst1......|.src0......|.src1......|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int s = ((iw1 >> DSP32Alu_s_bits) & DSP32Alu_s_mask);
int x = ((iw1 >> DSP32Alu_x_bits) & DSP32Alu_x_mask);
int aop = ((iw1 >> DSP32Alu_aop_bits) & DSP32Alu_aop_mask);
@@ -3350,123 +2706,98 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
if (aop == 0 && aopcde == 9 && HL == 0 && s == 0)
{
- notethat ("A0.L = dregs_lo");
OUTS (outf, "A0.L=");
OUTS (outf, dregs_lo (src0));
- return 2 * 2;
}
else if (aop == 2 && aopcde == 9 && HL == 1 && s == 0)
{
- notethat ("A1.H = dregs_hi");
OUTS (outf, "A1.H=");
OUTS (outf, dregs_hi (src0));
- return 2 * 2;
}
else if (aop == 2 && aopcde == 9 && HL == 0 && s == 0)
{
- notethat ("A1.L = dregs_lo");
OUTS (outf, "A1.L=");
OUTS (outf, dregs_lo (src0));
- return 2 * 2;
}
else if (aop == 0 && aopcde == 9 && HL == 1 && s == 0)
{
- notethat ("A0.H = dregs_hi");
OUTS (outf, "A0.H=");
OUTS (outf, dregs_hi (src0));
- return 2 * 2;
}
else if (x == 1 && HL == 1 && aop == 3 && aopcde == 5)
{
- notethat ("dregs_hi = dregs - dregs (RND20)");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
OUTS (outf, "-");
OUTS (outf, dregs (src1));
OUTS (outf, "(RND20)");
- return 2 * 2;
}
else if (x == 1 && HL == 1 && aop == 2 && aopcde == 5)
{
- notethat ("dregs_hi = dregs + dregs (RND20)");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
OUTS (outf, "+");
OUTS (outf, dregs (src1));
OUTS (outf, "(RND20)");
- return 2 * 2;
}
else if (x == 0 && HL == 0 && aop == 1 && aopcde == 5)
{
- notethat ("dregs_lo = dregs - dregs (RND12)");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
OUTS (outf, "-");
OUTS (outf, dregs (src1));
OUTS (outf, "(RND12)");
- return 2 * 2;
}
else if (x == 0 && HL == 0 && aop == 0 && aopcde == 5)
{
- notethat ("dregs_lo = dregs + dregs (RND12)");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
OUTS (outf, "+");
OUTS (outf, dregs (src1));
OUTS (outf, "(RND12)");
- return 2 * 2;
}
else if (x == 1 && HL == 0 && aop == 3 && aopcde == 5)
{
- notethat ("dregs_lo = dregs - dregs (RND20)");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
OUTS (outf, "-");
OUTS (outf, dregs (src1));
OUTS (outf, "(RND20)");
- return 2 * 2;
}
else if (x == 0 && HL == 1 && aop == 0 && aopcde == 5)
{
- notethat ("dregs_hi = dregs + dregs (RND12)");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
OUTS (outf, "+");
OUTS (outf, dregs (src1));
OUTS (outf, "(RND12)");
- return 2 * 2;
}
else if (x == 1 && HL == 0 && aop == 2 && aopcde == 5)
{
- notethat ("dregs_lo = dregs + dregs (RND20)");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
OUTS (outf, "+");
OUTS (outf, dregs (src1));
OUTS (outf, "(RND20)");
- return 2 * 2;
}
else if (x == 0 && HL == 1 && aop == 1 && aopcde == 5)
{
- notethat ("dregs_hi = dregs - dregs (RND12)");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
OUTS (outf, "-");
OUTS (outf, dregs (src1));
OUTS (outf, "(RND12)");
- return 2 * 2;
}
else if (HL == 1 && aop == 0 && aopcde == 2)
{
- notethat ("dregs_hi = dregs_lo + dregs_lo amod1");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_lo (src0));
@@ -3474,11 +2805,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs_lo (src1));
OUTS (outf, " ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (HL == 1 && aop == 1 && aopcde == 2)
{
- notethat ("dregs_hi = dregs_lo + dregs_hi amod1");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_lo (src0));
@@ -3486,11 +2815,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs_hi (src1));
OUTS (outf, " ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (HL == 1 && aop == 2 && aopcde == 2)
{
- notethat ("dregs_hi = dregs_hi + dregs_lo amod1");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_hi (src0));
@@ -3498,11 +2825,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs_lo (src1));
OUTS (outf, " ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (HL == 1 && aop == 3 && aopcde == 2)
{
- notethat ("dregs_hi = dregs_hi + dregs_hi amod1");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_hi (src0));
@@ -3510,11 +2835,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs_hi (src1));
OUTS (outf, " ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (HL == 0 && aop == 0 && aopcde == 3)
{
- notethat ("dregs_lo = dregs_lo - dregs_lo amod1");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_lo (src0));
@@ -3522,11 +2845,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs_lo (src1));
OUTS (outf, " ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (HL == 0 && aop == 1 && aopcde == 3)
{
- notethat ("dregs_lo = dregs_lo - dregs_hi amod1");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_lo (src0));
@@ -3534,11 +2855,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs_hi (src1));
OUTS (outf, " ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (HL == 0 && aop == 3 && aopcde == 2)
{
- notethat ("dregs_lo = dregs_hi + dregs_hi amod1");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_hi (src0));
@@ -3546,11 +2865,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs_hi (src1));
OUTS (outf, " ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (HL == 1 && aop == 0 && aopcde == 3)
{
- notethat ("dregs_hi = dregs_lo - dregs_lo amod1");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_lo (src0));
@@ -3558,11 +2875,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs_lo (src1));
OUTS (outf, " ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (HL == 1 && aop == 1 && aopcde == 3)
{
- notethat ("dregs_hi = dregs_lo - dregs_hi amod1");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_lo (src0));
@@ -3570,11 +2885,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs_hi (src1));
OUTS (outf, " ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (HL == 1 && aop == 2 && aopcde == 3)
{
- notethat ("dregs_hi = dregs_hi - dregs_lo amod1");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_hi (src0));
@@ -3582,11 +2895,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs_lo (src1));
OUTS (outf, " ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (HL == 1 && aop == 3 && aopcde == 3)
{
- notethat ("dregs_hi = dregs_hi - dregs_hi amod1");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_hi (src0));
@@ -3594,11 +2905,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs_hi (src1));
OUTS (outf, " ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (HL == 0 && aop == 2 && aopcde == 2)
{
- notethat ("dregs_lo = dregs_hi + dregs_lo amod1");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_hi (src0));
@@ -3606,11 +2915,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs_lo (src1));
OUTS (outf, " ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (HL == 0 && aop == 1 && aopcde == 2)
{
- notethat ("dregs_lo = dregs_lo + dregs_hi amod1");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_lo (src0));
@@ -3618,11 +2925,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs_hi (src1));
OUTS (outf, " ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (HL == 0 && aop == 2 && aopcde == 3)
{
- notethat ("dregs_lo = dregs_hi - dregs_lo amod1");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_hi (src0));
@@ -3630,11 +2935,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs_lo (src1));
OUTS (outf, " ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (HL == 0 && aop == 3 && aopcde == 3)
{
- notethat ("dregs_lo = dregs_hi - dregs_hi amod1");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_hi (src0));
@@ -3642,11 +2945,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs_hi (src1));
OUTS (outf, " ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (HL == 0 && aop == 0 && aopcde == 2)
{
- notethat ("dregs_lo = dregs_lo + dregs_lo amod1");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_lo (src0));
@@ -3654,30 +2955,20 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs_lo (src1));
OUTS (outf, " ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (aop == 0 && aopcde == 9 && s == 1)
{
- notethat ("A0 = dregs");
OUTS (outf, "A0=");
OUTS (outf, dregs (src0));
- return 2 * 2;
}
else if (aop == 3 && aopcde == 11 && s == 0)
- {
- notethat ("A0 -= A1");
- OUTS (outf, "A0-=A1");
- return 2 * 2;
- }
+ OUTS (outf, "A0-=A1");
+
else if (aop == 3 && aopcde == 11 && s == 1)
- {
- notethat ("A0 -= A1 (W32)");
- OUTS (outf, "A0-=A1(W32)");
- return 2 * 2;
- }
+ OUTS (outf, "A0-=A1(W32)");
+
else if (aop == 3 && aopcde == 22 && HL == 1)
{
- notethat ("dregs = BYTEOP2M ( dregs_pair , dregs_pair ) (TH , R)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=BYTEOP2M(");
OUTS (outf, dregs (src0 + 1));
@@ -3692,11 +2983,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, ", R)");
else
OUTS (outf, ")");
- return 2 * 2;
}
else if (aop == 3 && aopcde == 22 && HL == 0)
{
- notethat ("dregs = BYTEOP2M ( dregs_pair , dregs_pair ) (TL , R)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=BYTEOP2M(");
OUTS (outf, dregs (src0 + 1));
@@ -3711,11 +3000,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, ", R)");
else
OUTS (outf, ")");
- return 2 * 2;
}
else if (aop == 2 && aopcde == 22 && HL == 1)
{
- notethat ("dregs = BYTEOP2M ( dregs_pair , dregs_pair ) (RNDH , R)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=BYTEOP2M(");
OUTS (outf, dregs (src0 + 1));
@@ -3730,11 +3017,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, ", R)");
else
OUTS (outf, ")");
- return 2 * 2;
}
else if (aop == 2 && aopcde == 22 && HL == 0)
{
- notethat ("dregs = BYTEOP2M ( dregs_pair , dregs_pair ) (RNDL , R)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=BYTEOP2M(");
OUTS (outf, dregs (src0 + 1));
@@ -3749,11 +3034,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, ", R)");
else
OUTS (outf, ")");
- return 2 * 2;
}
else if (aop == 1 && aopcde == 22 && HL == 1)
{
- notethat ("dregs = BYTEOP2P ( dregs_pair , dregs_pair ) (TH , R)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=BYTEOP2P(");
OUTS (outf, dregs (src0 + 1));
@@ -3768,11 +3051,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, ", R)");
else
OUTS (outf, ")");
- return 2 * 2;
}
else if (aop == 1 && aopcde == 22 && HL == 0)
{
- notethat ("dregs = BYTEOP2P ( dregs_pair , dregs_pair ) (TL , R)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=BYTEOP2P(");
OUTS (outf, dregs (src0 + 1));
@@ -3787,11 +3068,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, ", R)");
else
OUTS (outf, ")");
- return 2 * 2;
}
else if (aop == 0 && aopcde == 22 && HL == 1)
{
- notethat ("dregs = BYTEOP2P ( dregs_pair , dregs_pair ) (RNDH , R)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=BYTEOP2P(");
OUTS (outf, dregs (src0 + 1));
@@ -3806,11 +3085,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, ", R)");
else
OUTS (outf, ")");
- return 2 * 2;
}
else if (aop == 0 && aopcde == 22 && HL == 0)
{
- notethat ("dregs = BYTEOP2P ( dregs_pair , dregs_pair ) (RNDL , aligndir)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=BYTEOP2P(");
OUTS (outf, dregs (src0 + 1));
@@ -3825,79 +3102,46 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, ", R)");
else
OUTS (outf, ")");
- return 2 * 2;
}
else if (aop == 0 && s == 0 && aopcde == 8)
- {
- notethat ("A0 = 0");
- OUTS (outf, "A0=0");
- return 2 * 2;
- }
+ OUTS (outf, "A0=0");
+
else if (aop == 0 && s == 1 && aopcde == 8)
- {
- notethat ("A0 = A0 (S)");
- OUTS (outf, "A0=A0(S)");
- return 2 * 2;
- }
+ OUTS (outf, "A0=A0(S)");
+
else if (aop == 1 && s == 0 && aopcde == 8)
- {
- notethat ("A1 = 0");
- OUTS (outf, "A1=0");
- return 2 * 2;
- }
+ OUTS (outf, "A1=0");
+
else if (aop == 1 && s == 1 && aopcde == 8)
- {
- notethat ("A1 = A1 (S)");
- OUTS (outf, "A1=A1(S)");
- return 2 * 2;
- }
+ OUTS (outf, "A1=A1(S)");
+
else if (aop == 2 && s == 0 && aopcde == 8)
- {
- notethat ("A1 = A0 = 0");
- OUTS (outf, "A1=A0=0");
- return 2 * 2;
- }
+ OUTS (outf, "A1=A0=0");
+
else if (aop == 2 && s == 1 && aopcde == 8)
- {
- notethat ("A1 = A1 (S) , A0 = A0 (S)");
- OUTS (outf, "A1=A1(S),A0=A0(S)");
- return 2 * 2;
- }
+ OUTS (outf, "A1=A1(S),A0=A0(S)");
+
else if (aop == 3 && s == 0 && aopcde == 8)
- {
- notethat ("A0 = A1");
- OUTS (outf, "A0=A1");
- return 2 * 2;
- }
+ OUTS (outf, "A0=A1");
+
else if (aop == 3 && s == 1 && aopcde == 8)
- {
- notethat ("A1 = A0");
- OUTS (outf, "A1=A0");
- return 2 * 2;
- }
+ OUTS (outf, "A1=A0");
+
else if (aop == 1 && aopcde == 9 && s == 0)
{
- notethat ("A0.x = dregs_lo");
OUTS (outf, "A0.x=");
OUTS (outf, dregs_lo (src0));
- return 2 * 2;
}
else if (aop == 1 && HL == 0 && aopcde == 11)
{
- notethat ("dregs_lo = ( A0 += A1 )");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=(A0+=A1)");
- return 2 * 2;
}
else if (aop == 3 && HL == 0 && aopcde == 16)
- {
- notethat ("A1 = ABS A1, A0 = ABS A0");
- OUTS (outf, "A1= ABS A0,A0= ABS A0");
- return 2 * 2;
- }
+ OUTS (outf, "A1= ABS A0,A0= ABS A0");
+
else if (aop == 0 && aopcde == 23 && HL == 1)
{
- notethat ("dregs = BYTEOP3P ( dregs_pair , dregs_pair ) (HI , R)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=BYTEOP3P(");
OUTS (outf, dregs (src0 + 1));
@@ -3912,119 +3156,80 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, ", R)");
else
OUTS (outf, ")");
- return 2 * 2;
}
else if (aop == 3 && aopcde == 9 && s == 0)
{
- notethat ("A1.x = dregs_lo");
OUTS (outf, "A1.x=");
OUTS (outf, dregs_lo (src0));
- return 2 * 2;
}
else if (aop == 1 && HL == 1 && aopcde == 16)
- {
- notethat ("A1 = ABS A1");
- OUTS (outf, "A1= ABS A1");
- return 2 * 2;
- }
+ OUTS (outf, "A1= ABS A1");
+
else if (aop == 0 && HL == 1 && aopcde == 16)
- {
- notethat ("A1 = ABS A0");
- OUTS (outf, "A1= ABS A0");
- return 2 * 2;
- }
+ OUTS (outf, "A1= ABS A0");
+
else if (aop == 2 && aopcde == 9 && s == 1)
{
- notethat ("A1 = dregs");
OUTS (outf, "A1=");
OUTS (outf, dregs (src0));
- return 2 * 2;
}
else if (HL == 0 && aop == 3 && aopcde == 12)
{
- notethat ("dregs_lo = dregs (RND)");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
OUTS (outf, "(RND)");
- return 2 * 2;
}
else if (aop == 1 && HL == 0 && aopcde == 16)
- {
- notethat ("A0 = ABS A1");
- OUTS (outf, "A0= ABS A1");
- return 2 * 2;
- }
+ OUTS (outf, "A0= ABS A1");
+
else if (aop == 0 && HL == 0 && aopcde == 16)
- {
- notethat ("A0 = ABS A0");
- OUTS (outf, "A0= ABS A0");
- return 2 * 2;
- }
+ OUTS (outf, "A0= ABS A0");
+
else if (aop == 3 && HL == 0 && aopcde == 15)
{
- notethat ("dregs = - dregs (V)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=-");
OUTS (outf, dregs (src0));
OUTS (outf, "(V)");
- return 2 * 2;
}
else if (aop == 3 && s == 1 && HL == 0 && aopcde == 7)
{
- notethat ("dregs = - dregs (S)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=-");
OUTS (outf, dregs (src0));
OUTS (outf, "(S)");
- return 2 * 2;
}
else if (aop == 3 && s == 0 && HL == 0 && aopcde == 7)
{
- notethat ("dregs = - dregs (NS)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=-");
OUTS (outf, dregs (src0));
OUTS (outf, "(NS)");
- return 2 * 2;
}
else if (aop == 1 && HL == 1 && aopcde == 11)
{
- notethat ("dregs_hi = ( A0 += A1 )");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=(A0+=A1)");
- return 2 * 2;
}
else if (aop == 2 && aopcde == 11 && s == 0)
- {
- notethat ("A0 += A1");
- OUTS (outf, "A0+=A1");
- return 2 * 2;
- }
+ OUTS (outf, "A0+=A1");
+
else if (aop == 2 && aopcde == 11 && s == 1)
- {
- notethat ("A0 += A1 (W32)");
- OUTS (outf, "A0+=A1(W32)");
- return 2 * 2;
- }
+ OUTS (outf, "A0+=A1(W32)");
+
else if (aop == 3 && HL == 0 && aopcde == 14)
- {
- notethat ("A1 = - A1 , A0 = - A0");
- OUTS (outf, "A1=-A1,A0=-A0");
- return 2 * 2;
- }
+ OUTS (outf, "A1=-A1,A0=-A0");
+
else if (HL == 1 && aop == 3 && aopcde == 12)
{
- notethat ("dregs_hi = dregs (RND)");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
OUTS (outf, "(RND)");
- return 2 * 2;
}
else if (aop == 0 && aopcde == 23 && HL == 0)
{
- notethat ("dregs = BYTEOP3P ( dregs_pair , dregs_pair ) (LO , R)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=BYTEOP3P(");
OUTS (outf, dregs (src0 + 1));
@@ -4039,35 +3244,21 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, ", R)");
else
OUTS (outf, ")");
- return 2 * 2;
}
else if (aop == 0 && HL == 0 && aopcde == 14)
- {
- notethat ("A0 = - A0");
- OUTS (outf, "A0=-A0");
- return 2 * 2;
- }
+ OUTS (outf, "A0=-A0");
+
else if (aop == 1 && HL == 0 && aopcde == 14)
- {
- notethat ("A0 = - A1");
- OUTS (outf, "A0=-A1");
- return 2 * 2;
- }
+ OUTS (outf, "A0=-A1");
+
else if (aop == 0 && HL == 1 && aopcde == 14)
- {
- notethat ("A1 = - A0");
- OUTS (outf, "A1=-A0");
- return 2 * 2;
- }
+ OUTS (outf, "A1=-A0");
+
else if (aop == 1 && HL == 1 && aopcde == 14)
- {
- notethat ("A1 = - A1");
- OUTS (outf, "A1=-A1");
- return 2 * 2;
- }
+ OUTS (outf, "A1=-A1");
+
else if (aop == 0 && aopcde == 12)
{
- notethat ("dregs_hi=dregs_lo=SIGN(dregs_hi)*dregs_hi + SIGN(dregs_lo)*dregs_lo)");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_lo (dst0));
@@ -4080,11 +3271,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, ")*");
OUTS (outf, dregs_lo (src1));
OUTS (outf, ")");
- return 2 * 2;
}
else if (aop == 2 && aopcde == 0)
{
- notethat ("dregs = dregs -|+ dregs amod0");
OUTS (outf, dregs (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
@@ -4092,20 +3281,16 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs (src1));
OUTS (outf, " ");
amod0 (s, x, outf);
- return 2 * 2;
}
else if (aop == 1 && aopcde == 12)
{
- notethat ("dregs = A1.L + A1.H , dregs = A0.L + A0.H");
OUTS (outf, dregs (dst1));
OUTS (outf, "=A1.L+A1.H,");
OUTS (outf, dregs (dst0));
OUTS (outf, "=A0.L+A0.H");
- return 2 * 2;
}
else if (aop == 2 && aopcde == 4)
{
- notethat ("dregs = dregs + dregs , dregs = dregs - dregs amod1");
OUTS (outf, dregs (dst1));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
@@ -4119,11 +3304,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs (src1));
OUTS (outf, " ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (HL == 0 && aopcde == 1)
{
- notethat ("dregs = dregs +|+ dregs , dregs = dregs -|- dregs (amod0, amod2)");
OUTS (outf, dregs (dst1));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
@@ -4136,32 +3319,24 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, "-|-");
OUTS (outf, dregs (src1));
amod0amod2 (s, x, aop, outf);
- return 2 * 2;
}
else if (aop == 0 && aopcde == 11)
{
- notethat ("dregs = ( A0 += A1 )");
OUTS (outf, dregs (dst0));
OUTS (outf, "=(A0+=A1)");
- return 2 * 2;
}
else if (aop == 0 && aopcde == 10)
{
- notethat ("dregs_lo = A0.x");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=A0.x");
- return 2 * 2;
}
else if (aop == 1 && aopcde == 10)
{
- notethat ("dregs_lo = A1.x");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=A1.x");
- return 2 * 2;
}
else if (aop == 1 && aopcde == 0)
{
- notethat ("dregs = dregs +|- dregs amod0");
OUTS (outf, dregs (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
@@ -4169,11 +3344,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs (src1));
OUTS (outf, " ");
amod0 (s, x, outf);
- return 2 * 2;
}
else if (aop == 3 && aopcde == 0)
{
- notethat ("dregs = dregs -|- dregs amod0");
OUTS (outf, dregs (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
@@ -4181,11 +3354,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs (src1));
OUTS (outf, " ");
amod0 (s, x, outf);
- return 2 * 2;
}
else if (aop == 1 && aopcde == 4)
{
- notethat ("dregs = dregs - dregs amod1");
OUTS (outf, dregs (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
@@ -4193,31 +3364,25 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs (src1));
OUTS (outf, " ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (aop == 0 && aopcde == 17)
{
- notethat ("dregs = A1 + A0, dregs = A1 - A0 amod1");
OUTS (outf, dregs (dst1));
OUTS (outf, "=A1+A0,");
OUTS (outf, dregs (dst0));
OUTS (outf, "=A1-A0 ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (aop == 1 && aopcde == 17)
{
- notethat ("dregs = A0 + A1, dregs = A0 - A1 amod1");
OUTS (outf, dregs (dst1));
OUTS (outf, "=A0+A1,");
OUTS (outf, dregs (dst0));
OUTS (outf, "=A0-A1 ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (aop == 0 && aopcde == 18)
{
- notethat ("SAA ( dregs_pair , dregs_pair ) aligndir");
OUTS (outf, "SAA(");
OUTS (outf, dregs (src0 + 1));
OUTS (outf, ":");
@@ -4228,17 +3393,12 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, imm5 (src1));
OUTS (outf, ") ");
aligndir (s, outf);
- return 2 * 2;
}
else if (aop == 3 && aopcde == 18)
- {
- notethat ("DISALGNEXCPT");
- OUTS (outf, "DISALGNEXCPT");
- return 2 * 2;
- }
+ OUTS (outf, "DISALGNEXCPT");
+
else if (aop == 0 && aopcde == 20)
{
- notethat ("dregs = BYTEOP1P ( dregs_pair , dregs_pair ) aligndir");
OUTS (outf, dregs (dst0));
OUTS (outf, "=BYTEOP1P(");
OUTS (outf, dregs (src0 + 1));
@@ -4250,11 +3410,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, imm5 (src1));
OUTS (outf, ")");
aligndir (s, outf);
- return 2 * 2;
}
else if (aop == 1 && aopcde == 20)
{
- notethat ("dregs = BYTEOP1P ( dregs_pair , dregs_pair ) (T, R)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=BYTEOP1P(");
OUTS (outf, dregs (src0 + 1));
@@ -4269,11 +3427,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, ", R)");
else
OUTS (outf, ")");
- return 2 * 2;
}
else if (aop == 0 && aopcde == 21)
{
- notethat ("( dregs , dregs ) = BYTEOP16P ( dregs_pair , dregs_pair ) aligndir");
OUTS (outf, "(");
OUTS (outf, dregs (dst1));
OUTS (outf, ",");
@@ -4288,11 +3444,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, imm5 (src1));
OUTS (outf, ") ");
aligndir (s, outf);
- return 2 * 2;
}
else if (aop == 1 && aopcde == 21)
{
- notethat ("( dregs , dregs ) = BYTEOP16M ( dregs_pair , dregs_pair ) aligndir");
OUTS (outf, "(");
OUTS (outf, dregs (dst1));
OUTS (outf, ",");
@@ -4307,72 +3461,58 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, imm5 (src1));
OUTS (outf, ") ");
aligndir (s, outf);
- return 2 * 2;
}
else if (aop == 2 && aopcde == 7)
{
- notethat ("dregs = ABS dregs");
OUTS (outf, dregs (dst0));
OUTS (outf, "= ABS ");
OUTS (outf, dregs (src0));
- return 2 * 2;
}
else if (aop == 1 && aopcde == 7)
{
- notethat ("dregs = MIN ( dregs , dregs )");
OUTS (outf, dregs (dst0));
OUTS (outf, "=MIN(");
OUTS (outf, dregs (src0));
OUTS (outf, ",");
OUTS (outf, dregs (src1));
OUTS (outf, ")");
- return 2 * 2;
}
else if (aop == 0 && aopcde == 7)
{
- notethat ("dregs = MAX ( dregs , dregs )");
OUTS (outf, dregs (dst0));
OUTS (outf, "=MAX(");
OUTS (outf, dregs (src0));
OUTS (outf, ",");
OUTS (outf, dregs (src1));
OUTS (outf, ")");
- return 2 * 2;
}
else if (aop == 2 && aopcde == 6)
{
- notethat ("dregs = ABS dregs (V)");
OUTS (outf, dregs (dst0));
OUTS (outf, "= ABS ");
OUTS (outf, dregs (src0));
OUTS (outf, "(V)");
- return 2 * 2;
}
else if (aop == 1 && aopcde == 6)
{
- notethat ("dregs = MIN ( dregs , dregs ) (V)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=MIN(");
OUTS (outf, dregs (src0));
OUTS (outf, ",");
OUTS (outf, dregs (src1));
OUTS (outf, ")(V)");
- return 2 * 2;
}
else if (aop == 0 && aopcde == 6)
{
- notethat ("dregs = MAX ( dregs , dregs ) (V)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=MAX(");
OUTS (outf, dregs (src0));
OUTS (outf, ",");
OUTS (outf, dregs (src1));
OUTS (outf, ")(V)");
- return 2 * 2;
}
else if (HL == 1 && aopcde == 1)
{
- notethat ("dregs = dregs +|- dregs, dregs = dregs -|+ dregs (amod0, amod2)");
OUTS (outf, dregs (dst1));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
@@ -4385,11 +3525,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, "-|+");
OUTS (outf, dregs (src1));
amod0amod2 (s, x, aop, outf);
- return 2 * 2;
}
else if (aop == 0 && aopcde == 4)
{
- notethat ("dregs = dregs + dregs amod1");
OUTS (outf, dregs (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
@@ -4397,11 +3535,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs (src1));
OUTS (outf, " ");
amod1 (s, x, outf);
- return 2 * 2;
}
else if (aop == 0 && aopcde == 0)
{
- notethat ("dregs = dregs +|+ dregs amod0");
OUTS (outf, dregs (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src0));
@@ -4409,22 +3545,18 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, dregs (src1));
OUTS (outf, " ");
amod0 (s, x, outf);
- return 2 * 2;
}
else if (aop == 0 && aopcde == 24)
{
- notethat ("dregs = BYTEPACK ( dregs , dregs )");
OUTS (outf, dregs (dst0));
OUTS (outf, "=BYTEPACK(");
OUTS (outf, dregs (src0));
OUTS (outf, ",");
OUTS (outf, dregs (src1));
OUTS (outf, ")");
- return 2 * 2;
}
else if (aop == 1 && aopcde == 24)
{
- notethat ("( dregs , dregs ) = BYTEUNPACK dregs_pair aligndir");
OUTS (outf, "(");
OUTS (outf, dregs (dst1));
OUTS (outf, ",");
@@ -4435,11 +3567,9 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, imm5 (src0));
OUTS (outf, " ");
aligndir (s, outf);
- return 2 * 2;
}
else if (aopcde == 13)
{
- notethat ("( dregs , dregs ) = SEARCH dregs (searchmod)");
OUTS (outf, "(");
OUTS (outf, dregs (dst1));
OUTS (outf, ",");
@@ -4449,23 +3579,21 @@ decode_dsp32alu_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, "(");
searchmod (aop, outf);
OUTS (outf, ")");
- return 2 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 4;
}
static int
decode_dsp32shift_0 (TIword iw0, TIword iw1, disassemble_info *outf)
{
-/* dsp32shift
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 1 | 1 | 0 | 0 |.M.| 1 | 1 | 0 | 0 | - | - |.sopcde............|
-|.sop...|.HLs...|.dst0......| - | - | - |.src0......|.src1......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* dsp32shift
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 1 | 1 | 0 | 0 |.M.| 1 | 1 | 0 | 0 | - | - |.sopcde............|
+ |.sop...|.HLs...|.dst0......| - | - | - |.src0......|.src1......|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int HLs = ((iw1 >> DSP32Shift_HLs_bits) & DSP32Shift_HLs_mask);
int sop = ((iw1 >> DSP32Shift_sop_bits) & DSP32Shift_sop_mask);
int src0 = ((iw1 >> DSP32Shift_src0_bits) & DSP32Shift_src0_mask);
@@ -4474,218 +3602,176 @@ decode_dsp32shift_0 (TIword iw0, TIword iw1, disassemble_info *outf)
int sopcde = ((iw0 >> (DSP32Shift_sopcde_bits - 16)) & DSP32Shift_sopcde_mask);
const char *acc01 = (HLs & 1) == 0 ? "A0" : "A1";
-
if (HLs == 0 && sop == 0 && sopcde == 0)
{
- notethat ("dregs_lo = ASHIFT dregs_lo BY dregs_lo");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "= ASHIFT ");
OUTS (outf, dregs_lo (src1));
OUTS (outf, " BY ");
OUTS (outf, dregs_lo (src0));
- return 2 * 2;
}
else if (HLs == 1 && sop == 0 && sopcde == 0)
{
- notethat ("dregs_lo = ASHIFT dregs_hi BY dregs_lo");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "= ASHIFT ");
OUTS (outf, dregs_hi (src1));
OUTS (outf, " BY ");
OUTS (outf, dregs_lo (src0));
- return 2 * 2;
}
else if (HLs == 2 && sop == 0 && sopcde == 0)
{
- notethat ("dregs_hi = ASHIFT dregs_lo BY dregs_lo");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "= ASHIFT ");
OUTS (outf, dregs_lo (src1));
OUTS (outf, " BY ");
OUTS (outf, dregs_lo (src0));
- return 2 * 2;
}
else if (HLs == 3 && sop == 0 && sopcde == 0)
{
- notethat ("dregs_hi = ASHIFT dregs_hi BY dregs_lo");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "= ASHIFT ");
OUTS (outf, dregs_hi (src1));
OUTS (outf, " BY ");
OUTS (outf, dregs_lo (src0));
- return 2 * 2;
}
else if (HLs == 0 && sop == 1 && sopcde == 0)
{
- notethat ("dregs_lo = ASHIFT dregs_lo BY dregs_lo (S)");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "= ASHIFT ");
OUTS (outf, dregs_lo (src1));
OUTS (outf, " BY ");
OUTS (outf, dregs_lo (src0));
OUTS (outf, "(S)");
- return 2 * 2;
}
else if (HLs == 1 && sop == 1 && sopcde == 0)
{
- notethat ("dregs_lo = ASHIFT dregs_hi BY dregs_lo (S)");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "= ASHIFT ");
OUTS (outf, dregs_hi (src1));
OUTS (outf, " BY ");
OUTS (outf, dregs_lo (src0));
OUTS (outf, "(S)");
- return 2 * 2;
}
else if (HLs == 2 && sop == 1 && sopcde == 0)
{
- notethat ("dregs_hi = ASHIFT dregs_lo BY dregs_lo (S)");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "= ASHIFT ");
OUTS (outf, dregs_lo (src1));
OUTS (outf, " BY ");
OUTS (outf, dregs_lo (src0));
OUTS (outf, "(S)");
- return 2 * 2;
}
else if (HLs == 3 && sop == 1 && sopcde == 0)
{
- notethat ("dregs_hi = ASHIFT dregs_hi BY dregs_lo (S)");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "= ASHIFT ");
OUTS (outf, dregs_hi (src1));
OUTS (outf, " BY ");
OUTS (outf, dregs_lo (src0));
OUTS (outf, "(S)");
- return 2 * 2;
}
else if (sop == 2 && sopcde == 0)
{
- notethat ("dregs_hilo = LSHIFT dregs_hilo BY dregs_lo");
OUTS (outf, (HLs & 2) == 0 ? dregs_lo (dst0) : dregs_hi (dst0));
OUTS (outf, "= LSHIFT ");
OUTS (outf, (HLs & 1) == 0 ? dregs_lo (src1) : dregs_hi (src1));
OUTS (outf, " BY ");
OUTS (outf, dregs_lo (src0));
- return 2 * 2;
}
else if (sop == 0 && sopcde == 3)
{
- notethat ("An = ASHIFT An BY dregs_lo");
OUTS (outf, acc01);
OUTS (outf, "= ASHIFT ");
OUTS (outf, acc01);
OUTS (outf, " BY ");
OUTS (outf, dregs_lo (src0));
- return 2 * 2;
}
else if (sop == 1 && sopcde == 3)
{
- notethat ("An = LSHIFT An BY dregs_lo");
OUTS (outf, acc01);
OUTS (outf, "= LSHIFT ");
OUTS (outf, acc01);
OUTS (outf, " BY ");
OUTS (outf, dregs_lo (src0));
- return 2 * 2;
}
else if (sop == 2 && sopcde == 3)
{
- notethat ("An = ROT An BY dregs_lo");
OUTS (outf, acc01);
OUTS (outf, "= ROT ");
OUTS (outf, acc01);
OUTS (outf, " BY ");
OUTS (outf, dregs_lo (src0));
- return 2 * 2;
}
else if (sop == 3 && sopcde == 3)
{
- notethat ("dregs = ROT dregs BY dregs_lo");
OUTS (outf, dregs (dst0));
OUTS (outf, "= ROT ");
OUTS (outf, dregs (src1));
OUTS (outf, " BY ");
OUTS (outf, dregs_lo (src0));
- return 2 * 2;
}
else if (sop == 1 && sopcde == 1)
{
- notethat ("dregs = ASHIFT dregs BY dregs_lo (V, S)");
OUTS (outf, dregs (dst0));
OUTS (outf, "= ASHIFT ");
OUTS (outf, dregs (src1));
OUTS (outf, " BY ");
OUTS (outf, dregs_lo (src0));
OUTS (outf, "(V,S)");
- return 2 * 2;
}
else if (sop == 0 && sopcde == 1)
{
- notethat ("dregs = ASHIFT dregs BY dregs_lo (V)");
OUTS (outf, dregs (dst0));
OUTS (outf, "= ASHIFT ");
OUTS (outf, dregs (src1));
OUTS (outf, " BY ");
OUTS (outf, dregs_lo (src0));
OUTS (outf, "(V)");
- return 2 * 2;
}
else if (sop == 0 && sopcde == 2)
{
- notethat ("dregs = ASHIFT dregs BY dregs_lo");
OUTS (outf, dregs (dst0));
OUTS (outf, "= ASHIFT ");
OUTS (outf, dregs (src1));
OUTS (outf, " BY ");
OUTS (outf, dregs_lo (src0));
- return 2 * 2;
}
else if (sop == 1 && sopcde == 2)
{
- notethat ("dregs = ASHIFT dregs BY dregs_lo (S)");
OUTS (outf, dregs (dst0));
OUTS (outf, "= ASHIFT ");
OUTS (outf, dregs (src1));
OUTS (outf, " BY ");
OUTS (outf, dregs_lo (src0));
OUTS (outf, "(S)");
- return 2 * 2;
}
else if (sop == 2 && sopcde == 2)
{
- notethat ("dregs = SHIFT dregs BY dregs_lo");
OUTS (outf, dregs (dst0));
OUTS (outf, "=SHIFT ");
OUTS (outf, dregs (src1));
OUTS (outf, " BY ");
OUTS (outf, dregs_lo (src0));
- return 2 * 2;
}
else if (sop == 3 && sopcde == 2)
{
- notethat ("dregs = ROT dregs BY dregs_lo");
OUTS (outf, dregs (dst0));
OUTS (outf, "= ROT ");
OUTS (outf, dregs (src1));
OUTS (outf, " BY ");
OUTS (outf, dregs_lo (src0));
- return 2 * 2;
}
else if (sop == 2 && sopcde == 1)
{
- notethat ("dregs = SHIFT dregs BY dregs_lo (V)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=SHIFT ");
OUTS (outf, dregs (src1));
OUTS (outf, " BY ");
OUTS (outf, dregs_lo (src0));
OUTS (outf, "(V)");
- return 2 * 2;
}
else if (sop == 0 && sopcde == 4)
{
- notethat ("dregs = PACK ( dregs_lo , dregs_lo )");
OUTS (outf, dregs (dst0));
OUTS (outf, "=PACK");
OUTS (outf, "(");
@@ -4693,796 +3779,631 @@ decode_dsp32shift_0 (TIword iw0, TIword iw1, disassemble_info *outf)
OUTS (outf, ",");
OUTS (outf, dregs_lo (src0));
OUTS (outf, ")");
- return 2 * 2;
}
else if (sop == 1 && sopcde == 4)
{
- notethat ("dregs = PACK ( dregs_lo , dregs_hi )");
OUTS (outf, dregs (dst0));
OUTS (outf, "=PACK(");
OUTS (outf, dregs_lo (src1));
OUTS (outf, ",");
OUTS (outf, dregs_hi (src0));
OUTS (outf, ")");
- return 2 * 2;
}
else if (sop == 2 && sopcde == 4)
{
- notethat ("dregs = PACK ( dregs_hi , dregs_lo )");
OUTS (outf, dregs (dst0));
OUTS (outf, "=PACK(");
OUTS (outf, dregs_hi (src1));
OUTS (outf, ",");
OUTS (outf, dregs_lo (src0));
OUTS (outf, ")");
- return 2 * 2;
}
else if (sop == 3 && sopcde == 4)
{
- notethat ("dregs = PACK ( dregs_hi , dregs_hi )");
OUTS (outf, dregs (dst0));
OUTS (outf, "=PACK(");
OUTS (outf, dregs_hi (src1));
OUTS (outf, ",");
OUTS (outf, dregs_hi (src0));
OUTS (outf, ")");
- return 2 * 2;
}
else if (sop == 0 && sopcde == 5)
{
- notethat ("dregs_lo = SIGNBITS dregs");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=SIGNBITS ");
OUTS (outf, dregs (src1));
- return 2 * 2;
}
else if (sop == 1 && sopcde == 5)
{
- notethat ("dregs_lo = SIGNBITS dregs_lo");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=SIGNBITS ");
OUTS (outf, dregs_lo (src1));
- return 2 * 2;
}
else if (sop == 2 && sopcde == 5)
{
- notethat ("dregs_lo = SIGNBITS dregs_hi");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=SIGNBITS ");
OUTS (outf, dregs_hi (src1));
- return 2 * 2;
}
else if (sop == 0 && sopcde == 6)
{
- notethat ("dregs_lo = SIGNBITS A0");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=SIGNBITS A0");
- return 2 * 2;
}
else if (sop == 1 && sopcde == 6)
{
- notethat ("dregs_lo = SIGNBITS A1");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=SIGNBITS A1");
- return 2 * 2;
}
else if (sop == 3 && sopcde == 6)
{
- notethat ("dregs_lo = ONES dregs");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=ONES ");
OUTS (outf, dregs (src1));
- return 2 * 2;
}
else if (sop == 0 && sopcde == 7)
{
- notethat ("dregs_lo = EXPADJ (dregs , dregs_lo)");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=EXPADJ (");
OUTS (outf, dregs (src1));
OUTS (outf, ",");
OUTS (outf, dregs_lo (src0));
OUTS (outf, ")");
- return 2 * 2;
}
else if (sop == 1 && sopcde == 7)
{
- notethat ("dregs_lo = EXPADJ (dregs , dregs_lo) (V)");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=EXPADJ (");
OUTS (outf, dregs (src1));
OUTS (outf, ",");
OUTS (outf, dregs_lo (src0));
OUTS (outf, ") (V)");
- return 2 * 2;
}
else if (sop == 2 && sopcde == 7)
{
- notethat ("dregs_lo = EXPADJ (dregs_lo , dregs_lo)");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=EXPADJ (");
OUTS (outf, dregs_lo (src1));
OUTS (outf, ",");
OUTS (outf, dregs_lo (src0));
OUTS (outf, ")");
- return 2 * 2;
}
else if (sop == 3 && sopcde == 7)
{
- notethat ("dregs_lo = EXPADJ (dregs_hi , dregs_lo)");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=EXPADJ (");
OUTS (outf, dregs_hi (src1));
OUTS (outf, ",");
OUTS (outf, dregs_lo (src0));
OUTS (outf, ")");
- return 2 * 2;
}
else if (sop == 0 && sopcde == 8)
{
- notethat ("BITMUX (dregs , dregs , A0) (ASR)");
OUTS (outf, "BITMUX (");
OUTS (outf, dregs (src0));
OUTS (outf, ",");
OUTS (outf, dregs (src1));
OUTS (outf, ",A0 )(ASR)");
- return 2 * 2;
}
else if (sop == 1 && sopcde == 8)
{
- notethat ("BITMUX (dregs , dregs , A0) (ASL)");
OUTS (outf, "BITMUX (");
OUTS (outf, dregs (src0));
OUTS (outf, ",");
OUTS (outf, dregs (src1));
OUTS (outf, ",A0 )(ASL)");
- return 2 * 2;
}
else if (sop == 0 && sopcde == 9)
{
- notethat ("dregs_lo = VIT_MAX (dregs) (ASL)");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=VIT_MAX (");
OUTS (outf, dregs (src1));
OUTS (outf, ") (ASL)");
- return 2 * 2;
}
else if (sop == 1 && sopcde == 9)
{
- notethat ("dregs_lo = VIT_MAX (dregs) (ASR)");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=VIT_MAX (");
OUTS (outf, dregs (src1));
OUTS (outf, ") (ASR)");
- return 2 * 2;
}
else if (sop == 2 && sopcde == 9)
{
- notethat ("dregs = VIT_MAX ( dregs , dregs ) (ASL)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=VIT_MAX(");
OUTS (outf, dregs (src1));
OUTS (outf, ",");
OUTS (outf, dregs (src0));
OUTS (outf, ")(ASL)");
- return 2 * 2;
}
else if (sop == 3 && sopcde == 9)
{
- notethat ("dregs = VIT_MAX ( dregs , dregs ) (ASR)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=VIT_MAX(");
OUTS (outf, dregs (src1));
OUTS (outf, ",");
OUTS (outf, dregs (src0));
OUTS (outf, ")(ASR)");
- return 2 * 2;
}
else if (sop == 0 && sopcde == 10)
{
- notethat ("dregs = EXTRACT ( dregs , dregs_lo ) (Z)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=EXTRACT(");
OUTS (outf, dregs (src1));
OUTS (outf, ",");
OUTS (outf, dregs_lo (src0));
OUTS (outf, ") (Z)");
- return 2 * 2;
}
else if (sop == 1 && sopcde == 10)
{
- notethat ("dregs = EXTRACT ( dregs , dregs_lo ) (X)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=EXTRACT(");
OUTS (outf, dregs (src1));
OUTS (outf, ",");
OUTS (outf, dregs_lo (src0));
OUTS (outf, ")(X)");
- return 2 * 2;
}
else if (sop == 2 && sopcde == 10)
{
- notethat ("dregs = DEPOSIT ( dregs , dregs )");
OUTS (outf, dregs (dst0));
OUTS (outf, "=DEPOSIT(");
OUTS (outf, dregs (src1));
OUTS (outf, ",");
OUTS (outf, dregs (src0));
OUTS (outf, ")");
- return 2 * 2;
}
else if (sop == 3 && sopcde == 10)
{
- notethat ("dregs = DEPOSIT ( dregs , dregs ) (X)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=DEPOSIT(");
OUTS (outf, dregs (src1));
OUTS (outf, ",");
OUTS (outf, dregs (src0));
OUTS (outf, ")(X)");
- return 2 * 2;
}
else if (sop == 0 && sopcde == 11)
{
- notethat ("dregs_lo = CC = BXORSHIFT ( A0 , dregs )");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=CC=BXORSHIFT(A0,");
OUTS (outf, dregs (src0));
OUTS (outf, ")");
- return 2 * 2;
}
else if (sop == 1 && sopcde == 11)
{
- notethat ("dregs_lo = CC = BXOR (A0 , dregs)");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=CC=BXOR(A0,");
OUTS (outf, dregs (src0));
OUTS (outf, ")");
- return 2 * 2;
}
else if (sop == 0 && sopcde == 12)
- {
- notethat ("A0 = BXORSHIFT ( A0 , A1 , CC )");
- OUTS (outf, "A0=BXORSHIFT(A0,A1 ,CC)");
- return 2 * 2;
- }
+ OUTS (outf, "A0=BXORSHIFT(A0,A1 ,CC)");
+
else if (sop == 1 && sopcde == 12)
{
- notethat ("dregs_lo = CC = BXOR (A0 , A1 , CC)");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=CC=BXOR( A0,A1 ,CC )");
- return 2 * 2;
}
else if (sop == 0 && sopcde == 13)
{
- notethat ("dregs = ALIGN8 ( dregs , dregs )");
OUTS (outf, dregs (dst0));
OUTS (outf, "=ALIGN8(");
OUTS (outf, dregs (src1));
OUTS (outf, ",");
OUTS (outf, dregs (src0));
OUTS (outf, ")");
- return 2 * 2;
}
else if (sop == 1 && sopcde == 13)
{
- notethat ("dregs = ALIGN16 ( dregs , dregs )");
OUTS (outf, dregs (dst0));
OUTS (outf, "=ALIGN16(");
OUTS (outf, dregs (src1));
OUTS (outf, ",");
OUTS (outf, dregs (src0));
OUTS (outf, ")");
- return 2 * 2;
}
else if (sop == 2 && sopcde == 13)
{
- notethat ("dregs = ALIGN24 ( dregs , dregs )");
OUTS (outf, dregs (dst0));
OUTS (outf, "=ALIGN24(");
OUTS (outf, dregs (src1));
OUTS (outf, ",");
OUTS (outf, dregs (src0));
OUTS (outf, ")");
- return 2 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 4;
}
static int
decode_dsp32shiftimm_0 (TIword iw0, TIword iw1, disassemble_info *outf)
{
-/* dsp32shiftimm
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 1 | 1 | 0 | 0 |.M.| 1 | 1 | 0 | 1 | - | - |.sopcde............|
-|.sop...|.HLs...|.dst0......|.immag.................|.src1......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
- int src1 = ((iw1 >> DSP32ShiftImm_src1_bits) & DSP32ShiftImm_src1_mask);
- int sop = ((iw1 >> DSP32ShiftImm_sop_bits) & DSP32ShiftImm_sop_mask);
- int bit8 = ((iw1 >> 8) & 0x1);
- int immag = ((iw1 >> DSP32ShiftImm_immag_bits) & DSP32ShiftImm_immag_mask);
+ /* dsp32shiftimm
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 1 | 1 | 0 | 0 |.M.| 1 | 1 | 0 | 1 | - | - |.sopcde............|
+ |.sop...|.HLs...|.dst0......|.immag.................|.src1......|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
+ int src1 = ((iw1 >> DSP32ShiftImm_src1_bits) & DSP32ShiftImm_src1_mask);
+ int sop = ((iw1 >> DSP32ShiftImm_sop_bits) & DSP32ShiftImm_sop_mask);
+ int bit8 = ((iw1 >> 8) & 0x1);
+ int immag = ((iw1 >> DSP32ShiftImm_immag_bits) & DSP32ShiftImm_immag_mask);
int newimmag = (-(iw1 >> DSP32ShiftImm_immag_bits) & DSP32ShiftImm_immag_mask);
- int dst0 = ((iw1 >> DSP32ShiftImm_dst0_bits) & DSP32ShiftImm_dst0_mask);
- int sopcde = ((iw0 >> (DSP32ShiftImm_sopcde_bits - 16)) & DSP32ShiftImm_sopcde_mask);
- int HLs = ((iw1 >> DSP32ShiftImm_HLs_bits) & DSP32ShiftImm_HLs_mask);
+ int dst0 = ((iw1 >> DSP32ShiftImm_dst0_bits) & DSP32ShiftImm_dst0_mask);
+ int sopcde = ((iw0 >> (DSP32ShiftImm_sopcde_bits - 16)) & DSP32ShiftImm_sopcde_mask);
+ int HLs = ((iw1 >> DSP32ShiftImm_HLs_bits) & DSP32ShiftImm_HLs_mask);
if (HLs == 0 && sop == 0 && sopcde == 0)
{
- notethat ("dregs_lo = dregs_lo >>> uimm4");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_lo (src1));
OUTS (outf, ">>>");
OUTS (outf, uimm4 (newimmag));
- return 2 * 2;
}
else if (HLs == 1 && sop == 0 && sopcde == 0)
{
- notethat ("dregs_lo = dregs_hi >>> uimm4");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_hi (src1));
OUTS (outf, ">>>");
OUTS (outf, uimm4 (newimmag));
- return 2 * 2;
}
else if (HLs == 2 && sop == 0 && sopcde == 0)
{
- notethat ("dregs_hi = dregs_lo >>> uimm4");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_lo (src1));
OUTS (outf, ">>>");
OUTS (outf, uimm4 (newimmag));
- return 2 * 2;
}
else if (HLs == 3 && sop == 0 && sopcde == 0)
{
- notethat ("dregs_hi = dregs_hi >>> uimm4");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_hi (src1));
OUTS (outf, ">>>");
OUTS (outf, uimm4 (newimmag));
- return 2 * 2;
}
else if (HLs == 0 && sop == 1 && sopcde == 0)
{
- notethat ("dregs_lo = dregs_lo << uimm4 (S)");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_lo (src1));
OUTS (outf, "<<");
OUTS (outf, uimm4 (immag));
OUTS (outf, "(S)");
- return 2 * 2;
}
else if (HLs == 1 && sop == 1 && sopcde == 0)
{
- notethat ("dregs_lo = dregs_hi << uimm4 (S)");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_hi (src1));
OUTS (outf, "<<");
OUTS (outf, uimm4 (immag));
OUTS (outf, "(S)");
- return 2 * 2;
}
else if (HLs == 2 && sop == 1 && sopcde == 0)
{
- notethat ("dregs_hi = dregs_lo << uimm4 (S)");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_lo (src1));
OUTS (outf, "<<");
OUTS (outf, uimm4 (immag));
OUTS (outf, "(S)");
- return 2 * 2;
}
else if (HLs == 3 && sop == 1 && sopcde == 0)
{
- notethat ("dregs_hi = dregs_hi << uimm4 (S)");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_hi (src1));
OUTS (outf, "<<");
OUTS (outf, uimm4 (immag));
OUTS (outf, "(S)");
- return 2 * 2;
}
else if (HLs == 0 && sop == 2 && sopcde == 0 && bit8 == 0)
{
- notethat ("dregs_lo = dregs_lo << uimm4");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_lo (src1));
OUTS (outf, "<<");
OUTS (outf, uimm4 (immag));
- return 2 * 2;
}
else if (HLs == 0 && sop == 2 && sopcde == 0 && bit8 == 1)
{
- notethat ("dregs_lo = dregs_lo >> uimm4");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_lo (src1));
OUTS (outf, ">>");
OUTS (outf, uimm4 (newimmag));
- return 2 * 2;
}
else if (HLs == 1 && sop == 2 && sopcde == 0)
{
- notethat ("dregs_lo = dregs_hi >> uimm4");
OUTS (outf, dregs_lo (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_hi (src1));
OUTS (outf, ">>");
OUTS (outf, uimm4 (newimmag));
- return 2 * 2;
}
else if (HLs == 2 && sop == 2 && sopcde == 0 && bit8 == 1)
{
- notethat ("dregs_hi = dregs_lo >> uimm4");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_lo (src1));
OUTS (outf, ">>");
OUTS (outf, uimm4 (newimmag));
- return 2 * 2;
}
else if (HLs == 2 && sop == 2 && sopcde == 0 && bit8 == 0)
{
- notethat ("dregs_hi = dregs_lo << uimm4");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_lo (src1));
OUTS (outf, "<<");
OUTS (outf, uimm4 (immag));
- return 2 * 2;
}
else if (HLs == 3 && sop == 2 && sopcde == 0 && bit8 == 1)
{
- notethat ("dregs_hi = dregs_hi >> uimm4");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_hi (src1));
OUTS (outf, ">>");
OUTS (outf, uimm4 (newimmag));
- return 2 * 2;
}
else if (HLs == 3 && sop == 2 && sopcde == 0 && bit8 == 0)
{
- notethat ("dregs_hi = dregs_hi << uimm4");
OUTS (outf, dregs_hi (dst0));
OUTS (outf, "=");
OUTS (outf, dregs_hi (src1));
OUTS (outf, "<<");
OUTS (outf, uimm4 (immag));
- return 2 * 2;
}
else if (sop == 2 && sopcde == 3 && HLs == 1)
{
- notethat ("A1 = ROT A1 BY imm6");
OUTS (outf, "A1= ROT A1 BY ");
OUTS (outf, imm6 (immag));
- return 2 * 2;
}
else if (sop == 0 && sopcde == 3 && HLs == 0 && bit8 == 0)
{
- notethat ("A0 = A0 << uimm5");
OUTS (outf, "A0=A0<<");
OUTS (outf, uimm5 (immag));
- return 2 * 2;
}
else if (sop == 0 && sopcde == 3 && HLs == 0 && bit8 == 1)
{
- notethat ("A0 = A0 >>> uimm5");
OUTS (outf, "A0=A0>>>");
OUTS (outf, uimm5 (newimmag));
- return 2 * 2;
}
else if (sop == 0 && sopcde == 3 && HLs == 1 && bit8 == 0)
{
- notethat ("A1 = A1 << uimm5");
OUTS (outf, "A1=A1<<");
OUTS (outf, uimm5 (immag));
- return 2 * 2;
}
else if (sop == 0 && sopcde == 3 && HLs == 1 && bit8 == 1)
{
- notethat ("A1 = A1 >>> uimm5");
OUTS (outf, "A1=A1>>>");
OUTS (outf, uimm5 (newimmag));
- return 2 * 2;
}
else if (sop == 1 && sopcde == 3 && HLs == 0)
{
- notethat ("A0 = A0 >> uimm5");
OUTS (outf, "A0=A0>>");
OUTS (outf, uimm5 (newimmag));
- return 2 * 2;
}
else if (sop == 1 && sopcde == 3 && HLs == 1)
{
- notethat ("A1 = A1 >> uimm5");
OUTS (outf, "A1=A1>>");
OUTS (outf, uimm5 (newimmag));
- return 2 * 2;
}
else if (sop == 2 && sopcde == 3 && HLs == 0)
{
- notethat ("A0 = ROT A0 BY imm6");
OUTS (outf, "A0= ROT A0 BY ");
OUTS (outf, imm6 (immag));
- return 2 * 2;
}
else if (sop == 1 && sopcde == 1 && bit8 == 0)
{
- notethat ("dregs = dregs << uimm5 (V, S)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src1));
OUTS (outf, "<<");
OUTS (outf, uimm5 (immag));
OUTS (outf, " (V, S)");
- return 2 * 2;
}
else if (sop == 1 && sopcde == 1 && bit8 == 1)
{
- notethat ("dregs = dregs >>> uimm5 (V)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src1));
OUTS (outf, ">>>");
OUTS (outf, imm5 (-immag));
OUTS (outf, " (V)");
- return 2 * 2;
}
else if (sop == 2 && sopcde == 1 && bit8 == 1)
{
- notethat ("dregs = dregs >> uimm5 (V)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src1));
OUTS (outf, " >> ");
OUTS (outf, uimm5 (newimmag));
OUTS (outf, " (V)");
- return 2 * 2;
}
else if (sop == 2 && sopcde == 1 && bit8 == 0)
{
- notethat ("dregs = dregs << imm5 (V)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src1));
OUTS (outf, "<<");
OUTS (outf, imm5 (immag));
OUTS (outf, " (V)");
- return 2 * 2;
}
else if (sop == 0 && sopcde == 1)
{
- notethat ("dregs = dregs >>> uimm5 (V)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src1));
OUTS (outf, ">>>");
OUTS (outf, uimm5 (newimmag));
OUTS (outf, " (V)");
- return 2 * 2;
}
else if (sop == 1 && sopcde == 2)
{
- notethat ("dregs = dregs << uimm5 (S)");
OUTS (outf, dregs (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src1));
OUTS (outf, "<<");
OUTS (outf, uimm5 (immag));
OUTS (outf, "(S)");
- return 2 * 2;
}
else if (sop == 2 && sopcde == 2 && bit8 == 1)
{
- notethat ("dregs = dregs >> uimm5");
OUTS (outf, dregs (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src1));
OUTS (outf, ">>");
OUTS (outf, uimm5 (newimmag));
- return 2 * 2;
}
else if (sop == 2 && sopcde == 2 && bit8 == 0)
{
- notethat ("dregs = dregs << uimm5");
OUTS (outf, dregs (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src1));
OUTS (outf, "<<");
OUTS (outf, uimm5 (immag));
- return 2 * 2;
}
else if (sop == 3 && sopcde == 2)
{
- notethat ("dregs = ROT dregs BY imm6");
OUTS (outf, dregs (dst0));
OUTS (outf, "= ROT ");
OUTS (outf, dregs (src1));
OUTS (outf, " BY ");
OUTS (outf, imm6 (immag));
- return 2 * 2;
}
else if (sop == 0 && sopcde == 2)
{
- notethat ("dregs = dregs >>> uimm5");
OUTS (outf, dregs (dst0));
OUTS (outf, "=");
OUTS (outf, dregs (src1));
OUTS (outf, ">>>");
OUTS (outf, uimm5 (newimmag));
- return 2 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 4;
}
static int
decode_pseudoDEBUG_0 (TIword iw0, disassemble_info *outf)
{
-/* pseudoDEBUG
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |.fn....|.grp.......|.reg.......|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* pseudoDEBUG
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |.fn....|.grp.......|.reg.......|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int fn = ((iw0 >> PseudoDbg_fn_bits) & PseudoDbg_fn_mask);
int grp = ((iw0 >> PseudoDbg_grp_bits) & PseudoDbg_grp_mask);
int reg = ((iw0 >> PseudoDbg_reg_bits) & PseudoDbg_reg_mask);
if (reg == 0 && fn == 3)
- {
- notethat ("DBG A0");
- OUTS (outf, "DBG A0");
- return 1 * 2;
- }
+ OUTS (outf, "DBG A0");
+
else if (reg == 1 && fn == 3)
- {
- notethat ("DBG A1");
- OUTS (outf, "DBG A1");
- return 1 * 2;
- }
+ OUTS (outf, "DBG A1");
+
else if (reg == 3 && fn == 3)
- {
- notethat ("ABORT");
- OUTS (outf, "ABORT");
- return 1 * 2;
- }
+ OUTS (outf, "ABORT");
+
else if (reg == 4 && fn == 3)
- {
- notethat ("HLT");
- OUTS (outf, "HLT");
- return 1 * 2;
- }
+ OUTS (outf, "HLT");
+
else if (reg == 5 && fn == 3)
- {
- notethat ("DBGHALT");
- OUTS (outf, "DBGHALT");
- return 1 * 2;
- }
+ OUTS (outf, "DBGHALT");
+
else if (reg == 6 && fn == 3)
{
- notethat ("DBGCMPLX ( dregs )");
OUTS (outf, "DBGCMPLX(");
OUTS (outf, dregs (grp));
OUTS (outf, ")");
- return 1 * 2;
}
else if (reg == 7 && fn == 3)
- {
- notethat ("DBG");
- OUTS (outf, "DBG");
- return 1 * 2;
- }
+ OUTS (outf, "DBG");
+
else if (grp == 0 && fn == 2)
{
- notethat ("OUTC dregs");
OUTS (outf, "OUTC");
OUTS (outf, dregs (reg));
- return 1 * 2;
}
else if (fn == 0)
{
- notethat ("DBG allregs");
OUTS (outf, "DBG");
OUTS (outf, allregs (reg, grp));
- return 1 * 2;
}
else if (fn == 1)
{
- notethat ("PRNT allregs");
OUTS (outf, "PRNT");
OUTS (outf, allregs (reg, grp));
- return 1 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+
+ return 2;
}
static int
decode_pseudodbg_assert_0 (TIword iw0, TIword iw1, disassemble_info *outf)
{
-/* pseudodbg_assert
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-| 1 | 1 | 1 | 1 | 0 | - | - | - | - | - |.dbgop.....|.regtest...|
-|.expected......................................................|
-+---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
-*/
+ /* pseudodbg_assert
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
+ | 1 | 1 | 1 | 1 | 0 | - | - | - | - | - |.dbgop.....|.regtest...|
+ |.expected......................................................|
+ +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
int expected = ((iw1 >> PseudoDbg_Assert_expected_bits) & PseudoDbg_Assert_expected_mask);
- int dbgop = ((iw0 >> (PseudoDbg_Assert_dbgop_bits - 16)) & PseudoDbg_Assert_dbgop_mask);
- int regtest = ((iw0 >> (PseudoDbg_Assert_regtest_bits - 16)) & PseudoDbg_Assert_regtest_mask);
+ int dbgop = ((iw0 >> (PseudoDbg_Assert_dbgop_bits - 16)) & PseudoDbg_Assert_dbgop_mask);
+ int regtest = ((iw0 >> (PseudoDbg_Assert_regtest_bits - 16)) & PseudoDbg_Assert_regtest_mask);
if (dbgop == 0)
{
- notethat ("DBGA ( dregs_lo , uimm16 )");
OUTS (outf, "DBGA(");
OUTS (outf, dregs_lo (regtest));
OUTS (outf, ",");
OUTS (outf, uimm16 (expected));
OUTS (outf, ")");
- return 2 * 2;
}
else if (dbgop == 1)
{
- notethat ("DBGA ( dregs_hi , uimm16 )");
OUTS (outf, "DBGA(");
OUTS (outf, dregs_hi (regtest));
OUTS (outf, ",");
OUTS (outf, uimm16 (expected));
OUTS (outf, ")");
- return 2 * 2;
}
else if (dbgop == 2)
{
- notethat ("DBGAL ( dregs , uimm16 )");
OUTS (outf, "DBGAL(");
OUTS (outf, dregs (regtest));
OUTS (outf, ",");
OUTS (outf, uimm16 (expected));
OUTS (outf, ")");
- return 2 * 2;
}
else if (dbgop == 3)
{
- notethat ("DBGAH ( dregs , uimm16 )");
OUTS (outf, "DBGAH(");
OUTS (outf, dregs (regtest));
OUTS (outf, ",");
OUTS (outf, uimm16 (expected));
OUTS (outf, ")");
- return 2 * 2;
}
else
- goto illegal_instruction;
-illegal_instruction:
- return 0;
+ return 0;
+ return 4;
}
int
_print_insn_bfin (bfd_vma pc, disassemble_info *outf)
{
-
bfd_byte buf[4];
TIword iw0;
TIword iw1;
int status;
+ int rv = 0;
+
status = (*outf->read_memory_func) (pc & ~0x1, buf, 2, outf);
status = (*outf->read_memory_func) ((pc + 2) & ~0x1, buf + 2, 2, outf);
@@ -5495,270 +4416,83 @@ _print_insn_bfin (bfd_vma pc, disassemble_info *outf)
return 4;
}
else if ((iw0 & 0xff00) == 0x0000)
- {
- int rv = decode_ProgCtrl_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_ProgCtrl_0 (iw0, outf);
else if ((iw0 & 0xffc0) == 0x0240)
- {
- int rv = decode_CaCTRL_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_CaCTRL_0 (iw0, outf);
else if ((iw0 & 0xff80) == 0x0100)
- {
- int rv = decode_PushPopReg_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_PushPopReg_0 (iw0, outf);
else if ((iw0 & 0xfe00) == 0x0400)
- {
- int rv = decode_PushPopMultiple_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_PushPopMultiple_0 (iw0, outf);
else if ((iw0 & 0xfe00) == 0x0600)
- {
- int rv = decode_ccMV_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_ccMV_0 (iw0, outf);
else if ((iw0 & 0xf800) == 0x0800)
- {
- int rv = decode_CCflag_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_CCflag_0 (iw0, outf);
else if ((iw0 & 0xffe0) == 0x0200)
- {
- int rv = decode_CC2dreg_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_CC2dreg_0 (iw0, outf);
else if ((iw0 & 0xff00) == 0x0300)
- {
- int rv = decode_CC2stat_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_CC2stat_0 (iw0, outf);
else if ((iw0 & 0xf000) == 0x1000)
- {
- int rv = decode_BRCC_0 (iw0, pc, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_BRCC_0 (iw0, pc, outf);
else if ((iw0 & 0xf000) == 0x2000)
- {
- int rv = decode_UJUMP_0 (iw0, pc, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_UJUMP_0 (iw0, pc, outf);
else if ((iw0 & 0xf000) == 0x3000)
- {
- int rv = decode_REGMV_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_REGMV_0 (iw0, outf);
else if ((iw0 & 0xfc00) == 0x4000)
- {
- int rv = decode_ALU2op_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_ALU2op_0 (iw0, outf);
else if ((iw0 & 0xfe00) == 0x4400)
- {
- int rv = decode_PTR2op_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_PTR2op_0 (iw0, outf);
else if ((iw0 & 0xf800) == 0x4800)
- {
- int rv = decode_LOGI2op_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_LOGI2op_0 (iw0, outf);
else if ((iw0 & 0xf000) == 0x5000)
- {
- int rv = decode_COMP3op_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_COMP3op_0 (iw0, outf);
else if ((iw0 & 0xf800) == 0x6000)
- {
- int rv = decode_COMPI2opD_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_COMPI2opD_0 (iw0, outf);
else if ((iw0 & 0xf800) == 0x6800)
- {
- int rv = decode_COMPI2opP_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_COMPI2opP_0 (iw0, outf);
else if ((iw0 & 0xf000) == 0x8000)
- {
- int rv = decode_LDSTpmod_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_LDSTpmod_0 (iw0, outf);
else if ((iw0 & 0xff60) == 0x9e60)
- {
- int rv = decode_dagMODim_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_dagMODim_0 (iw0, outf);
else if ((iw0 & 0xfff0) == 0x9f60)
- {
- int rv = decode_dagMODik_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_dagMODik_0 (iw0, outf);
else if ((iw0 & 0xfc00) == 0x9c00)
- {
- int rv = decode_dspLDST_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_dspLDST_0 (iw0, outf);
else if ((iw0 & 0xf000) == 0x9000)
- {
- int rv = decode_LDST_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_LDST_0 (iw0, outf);
else if ((iw0 & 0xfc00) == 0xb800)
- {
- int rv = decode_LDSTiiFP_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_LDSTiiFP_0 (iw0, outf);
else if ((iw0 & 0xe000) == 0xA000)
- {
- int rv = decode_LDSTii_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_LDSTii_0 (iw0, outf);
else if ((iw0 & 0xff80) == 0xe080 && (iw1 & 0x0C00) == 0x0000)
- {
- int rv = decode_LoopSetup_0 (iw0, iw1, pc, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_LoopSetup_0 (iw0, iw1, pc, outf);
else if ((iw0 & 0xff00) == 0xe100 && (iw1 & 0x0000) == 0x0000)
- {
- int rv = decode_LDIMMhalf_0 (iw0, iw1, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_LDIMMhalf_0 (iw0, iw1, outf);
else if ((iw0 & 0xfe00) == 0xe200 && (iw1 & 0x0000) == 0x0000)
- {
- int rv = decode_CALLa_0 (iw0, iw1, pc, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_CALLa_0 (iw0, iw1, pc, outf);
else if ((iw0 & 0xfc00) == 0xe400 && (iw1 & 0x0000) == 0x0000)
- {
- int rv = decode_LDSTidxI_0 (iw0, iw1, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_LDSTidxI_0 (iw0, iw1, outf);
else if ((iw0 & 0xfffe) == 0xe800 && (iw1 & 0x0000) == 0x0000)
- {
- int rv = decode_linkage_0 (iw0, iw1, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_linkage_0 (iw0, iw1, outf);
else if ((iw0 & 0xf600) == 0xc000 && (iw1 & 0x0000) == 0x0000)
- {
- int rv = decode_dsp32mac_0 (iw0, iw1, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_dsp32mac_0 (iw0, iw1, outf);
else if ((iw0 & 0xf600) == 0xc200 && (iw1 & 0x0000) == 0x0000)
- {
- int rv = decode_dsp32mult_0 (iw0, iw1, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_dsp32mult_0 (iw0, iw1, outf);
else if ((iw0 & 0xf7c0) == 0xc400 && (iw1 & 0x0000) == 0x0000)
- {
- int rv = decode_dsp32alu_0 (iw0, iw1, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_dsp32alu_0 (iw0, iw1, outf);
else if ((iw0 & 0xf780) == 0xc600 && (iw1 & 0x01c0) == 0x0000)
- {
- int rv = decode_dsp32shift_0 (iw0, iw1, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_dsp32shift_0 (iw0, iw1, outf);
else if ((iw0 & 0xf780) == 0xc680 && (iw1 & 0x0000) == 0x0000)
- {
- int rv = decode_dsp32shiftimm_0 (iw0, iw1, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_dsp32shiftimm_0 (iw0, iw1, outf);
else if ((iw0 & 0xff00) == 0xf800)
- {
- int rv = decode_pseudoDEBUG_0 (iw0, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
+ rv = decode_pseudoDEBUG_0 (iw0, outf);
#if 0
- }
else if ((iw0 & 0xFF00) == 0xF900)
- {
-
- int rv = decode_pseudoOChar_0 (iw0, iw1, pc, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
+ rv = decode_pseudoOChar_0 (iw0, iw1, pc, outf);
#endif
- }
else if ((iw0 & 0xFFC0) == 0xf000 && (iw1 & 0x0000) == 0x0000)
- {
- int rv = decode_pseudodbg_assert_0 (iw0, iw1, outf);
- if (rv)
- return rv;
- goto illegal_instruction;
- }
+ rv = decode_pseudodbg_assert_0 (iw0, iw1, outf);
-illegal_instruction:
- return 0;
+ return rv;
}
@@ -5778,7 +4512,7 @@ print_insn_bfin (bfd_vma pc, disassemble_info *outf)
/* Proper display of multiple issue instructions. */
if ((iw0 & 0xc000) == 0xc000 && (iw0 & BIT_MULTI_INS)
- && ((iw0 & 0xe800) != 0xe800 /* not Linkage */ ))
+ && ((iw0 & 0xe800) != 0xe800 /* Not Linkage. */ ))
{
outf->fprintf_func (outf->stream, " || ");
count += _print_insn_bfin (pc + 4, outf);