1 /* Disassemble ADI Blackfin Instructions.
2 Copyright 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
4 This file is part of libopcodes.
6 This library is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 It is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
25 #include "opcode/bfin.h"
47 #define HOST_LONG_WORD_SIZE (sizeof (long) * 8)
48 #define XFIELD(w,p,s) (((w) & ((1 << (s)) - 1) << (p)) >> (p))
49 #define SIGNEXTEND(v, n) ((v << (HOST_LONG_WORD_SIZE - (n))) >> (HOST_LONG_WORD_SIZE - (n)))
50 #define MASKBITS(val, bits) (val & ((1 << bits) - 1))
54 typedef unsigned int bu32
;
56 static char comment
= 0;
57 static char parallel
= 0;
61 c_0
, c_1
, c_4
, c_2
, c_uimm2
, c_uimm3
, c_imm3
, c_pcrel4
,
62 c_imm4
, c_uimm4s4
, c_uimm4s4d
, c_uimm4
, c_uimm4s2
, c_negimm5s4
, c_imm5
, c_imm5d
, c_uimm5
, c_imm6
,
63 c_imm7
, c_imm7d
, c_imm8
, c_uimm8
, c_pcrel8
, c_uimm8s4
, c_pcrel8s4
, c_lppcrel10
, c_pcrel10
,
64 c_pcrel12
, c_imm16s4
, c_luimm16
, c_imm16
, c_imm16d
, c_huimm16
, c_rimm16
, c_imm16s2
, c_uimm16s4
,
65 c_uimm16s4d
, c_uimm16
, c_pcrel24
, c_uimm32
, c_imm32
, c_huimm32
, c_huimm32e
,
82 } constant_formats
[] =
84 { "0", 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
85 { "1", 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
86 { "4", 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
87 { "2", 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
88 { "uimm2", 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
89 { "uimm3", 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
90 { "imm3", 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
91 { "pcrel4", 4, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0},
92 { "imm4", 4, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
93 { "uimm4s4", 4, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0},
94 { "uimm4s4d", 4, 0, 0, 0, 2, 0, 0, 1, 1, 0, 0},
95 { "uimm4", 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
96 { "uimm4s2", 4, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0},
97 { "negimm5s4", 5, 0, 1, 0, 2, 0, 1, 0, 0, 0, 0},
98 { "imm5", 5, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
99 { "imm5d", 5, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
100 { "uimm5", 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
101 { "imm6", 6, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
102 { "imm7", 7, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
103 { "imm7d", 7, 0, 1, 0, 0, 0, 0, 0, 1, 3, 0},
104 { "imm8", 8, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
105 { "uimm8", 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
106 { "pcrel8", 8, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0},
107 { "uimm8s4", 8, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0},
108 { "pcrel8s4", 8, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0},
109 { "lppcrel10", 10, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0},
110 { "pcrel10", 10, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0},
111 { "pcrel12", 12, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0},
112 { "imm16s4", 16, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0},
113 { "luimm16", 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
114 { "imm16", 16, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
115 { "imm16d", 16, 0, 1, 0, 0, 0, 0, 0, 1, 3, 0},
116 { "huimm16", 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
117 { "rimm16", 16, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
118 { "imm16s2", 16, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0},
119 { "uimm16s4", 16, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0},
120 { "uimm16s4d", 16, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0},
121 { "uimm16", 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
122 { "pcrel24", 24, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0},
123 { "uimm32", 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
124 { "imm32", 32, 0, 1, 0, 0, 0, 0, 0, 1, 3, 0},
125 { "huimm32", 32, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
126 { "huimm32e", 32, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1},
130 fmtconst (const_forms_t cf
, TIword x
, bfd_vma pc
, disassemble_info
*outf
)
134 if (constant_formats
[cf
].reloc
)
136 bfd_vma ea
= (((constant_formats
[cf
].pcrel
? SIGNEXTEND (x
, constant_formats
[cf
].nbits
)
137 : x
) + constant_formats
[cf
].offset
) << constant_formats
[cf
].scale
);
138 if (constant_formats
[cf
].pcrel
)
141 if (outf
->symbol_at_address_func (ea
, outf
) || !constant_formats
[cf
].exact
)
143 outf
->print_address_func (ea
, outf
);
148 sprintf (buf
, "%lx", (unsigned long) x
);
153 /* Negative constants have an implied sign bit. */
154 if (constant_formats
[cf
].negative
)
156 int nb
= constant_formats
[cf
].nbits
+ 1;
158 x
= x
| (1 << constant_formats
[cf
].nbits
);
159 x
= SIGNEXTEND (x
, nb
);
162 x
= constant_formats
[cf
].issigned
? SIGNEXTEND (x
, constant_formats
[cf
].nbits
) : x
;
164 if (constant_formats
[cf
].offset
)
165 x
+= constant_formats
[cf
].offset
;
167 if (constant_formats
[cf
].scale
)
168 x
<<= constant_formats
[cf
].scale
;
170 if (constant_formats
[cf
].decimal
)
172 if (constant_formats
[cf
].leading
)
175 sprintf (ps
, "%%%ii", constant_formats
[cf
].leading
);
176 sprintf (buf
, ps
, x
);
179 sprintf (buf
, "%li", x
);
183 if (constant_formats
[cf
].issigned
&& x
< 0)
184 sprintf (buf
, "-0x%x", abs (x
));
186 sprintf (buf
, "0x%lx", (unsigned long) x
);
193 fmtconst_val (const_forms_t cf
, unsigned int x
, unsigned int pc
)
195 if (0 && constant_formats
[cf
].reloc
)
197 bu32 ea
= (((constant_formats
[cf
].pcrel
198 ? SIGNEXTEND (x
, constant_formats
[cf
].nbits
)
199 : x
) + constant_formats
[cf
].offset
)
200 << constant_formats
[cf
].scale
);
201 if (constant_formats
[cf
].pcrel
)
207 /* Negative constants have an implied sign bit. */
208 if (constant_formats
[cf
].negative
)
210 int nb
= constant_formats
[cf
].nbits
+ 1;
211 x
= x
| (1 << constant_formats
[cf
].nbits
);
212 x
= SIGNEXTEND (x
, nb
);
214 else if (constant_formats
[cf
].issigned
)
215 x
= SIGNEXTEND (x
, constant_formats
[cf
].nbits
);
217 x
+= constant_formats
[cf
].offset
;
218 x
<<= constant_formats
[cf
].scale
;
223 enum machine_registers
225 REG_RL0
, REG_RL1
, REG_RL2
, REG_RL3
, REG_RL4
, REG_RL5
, REG_RL6
, REG_RL7
,
226 REG_RH0
, REG_RH1
, REG_RH2
, REG_RH3
, REG_RH4
, REG_RH5
, REG_RH6
, REG_RH7
,
227 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
228 REG_R1_0
, REG_R3_2
, REG_R5_4
, REG_R7_6
, REG_P0
, REG_P1
, REG_P2
, REG_P3
,
229 REG_P4
, REG_P5
, REG_SP
, REG_FP
, REG_A0x
, REG_A1x
, REG_A0w
, REG_A1w
,
230 REG_A0
, REG_A1
, REG_I0
, REG_I1
, REG_I2
, REG_I3
, REG_M0
, REG_M1
,
231 REG_M2
, REG_M3
, REG_B0
, REG_B1
, REG_B2
, REG_B3
, REG_L0
, REG_L1
,
233 REG_AZ
, REG_AN
, REG_AC0
, REG_AC1
, REG_AV0
, REG_AV1
, REG_AV0S
, REG_AV1S
,
234 REG_AQ
, REG_V
, REG_VS
,
235 REG_sftreset
, REG_omode
, REG_excause
, REG_emucause
, REG_idle_req
, REG_hwerrcause
, REG_CC
, REG_LC0
,
236 REG_LC1
, REG_GP
, REG_ASTAT
, REG_RETS
, REG_LT0
, REG_LB0
, REG_LT1
, REG_LB1
,
237 REG_CYCLES
, REG_CYCLES2
, REG_USP
, REG_SEQSTAT
, REG_SYSCFG
, REG_RETI
, REG_RETX
, REG_RETN
,
238 REG_RETE
, REG_EMUDAT
, REG_BR0
, REG_BR1
, REG_BR2
, REG_BR3
, REG_BR4
, REG_BR5
, REG_BR6
,
239 REG_BR7
, REG_PL0
, REG_PL1
, REG_PL2
, REG_PL3
, REG_PL4
, REG_PL5
, REG_SLP
, REG_FLP
,
240 REG_PH0
, REG_PH1
, REG_PH2
, REG_PH3
, REG_PH4
, REG_PH5
, REG_SHP
, REG_FHP
,
241 REG_IL0
, REG_IL1
, REG_IL2
, REG_IL3
, REG_ML0
, REG_ML1
, REG_ML2
, REG_ML3
,
242 REG_BL0
, REG_BL1
, REG_BL2
, REG_BL3
, REG_LL0
, REG_LL1
, REG_LL2
, REG_LL3
,
243 REG_IH0
, REG_IH1
, REG_IH2
, REG_IH3
, REG_MH0
, REG_MH1
, REG_MH2
, REG_MH3
,
244 REG_BH0
, REG_BH1
, REG_BH2
, REG_BH3
, REG_LH0
, REG_LH1
, REG_LH2
, REG_LH3
,
250 rc_dregs_lo
, rc_dregs_hi
, rc_dregs
, rc_dregs_pair
, rc_pregs
, rc_spfp
, rc_dregs_hilo
, rc_accum_ext
,
251 rc_accum_word
, rc_accum
, rc_iregs
, rc_mregs
, rc_bregs
, rc_lregs
, rc_dpregs
, rc_gregs
,
252 rc_regs
, rc_statbits
, rc_ignore_bits
, rc_ccstat
, rc_counters
, rc_dregs2_sysregs1
, rc_open
, rc_sysregs2
,
253 rc_sysregs3
, rc_allregs
,
257 static const char *reg_names
[] =
259 "R0.L", "R1.L", "R2.L", "R3.L", "R4.L", "R5.L", "R6.L", "R7.L",
260 "R0.H", "R1.H", "R2.H", "R3.H", "R4.H", "R5.H", "R6.H", "R7.H",
261 "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7",
262 "R1:0", "R3:2", "R5:4", "R7:6", "P0", "P1", "P2", "P3",
263 "P4", "P5", "SP", "FP", "A0.X", "A1.X", "A0.W", "A1.W",
264 "A0", "A1", "I0", "I1", "I2", "I3", "M0", "M1",
265 "M2", "M3", "B0", "B1", "B2", "B3", "L0", "L1",
267 "AZ", "AN", "AC0", "AC1", "AV0", "AV1", "AV0S", "AV1S",
269 "sftreset", "omode", "excause", "emucause", "idle_req", "hwerrcause", "CC", "LC0",
270 "LC1", "GP", "ASTAT", "RETS", "LT0", "LB0", "LT1", "LB1",
271 "CYCLES", "CYCLES2", "USP", "SEQSTAT", "SYSCFG", "RETI", "RETX", "RETN",
273 "R0.B", "R1.B", "R2.B", "R3.B", "R4.B", "R5.B", "R6.B", "R7.B",
274 "P0.L", "P1.L", "P2.L", "P3.L", "P4.L", "P5.L", "SP.L", "FP.L",
275 "P0.H", "P1.H", "P2.H", "P3.H", "P4.H", "P5.H", "SP.H", "FP.H",
276 "I0.L", "I1.L", "I2.L", "I3.L", "M0.L", "M1.L", "M2.L", "M3.L",
277 "B0.L", "B1.L", "B2.L", "B3.L", "L0.L", "L1.L", "L2.L", "L3.L",
278 "I0.H", "I1.H", "I2.H", "I3.H", "M0.H", "M1.H", "M2.H", "M3.H",
279 "B0.H", "B1.H", "B2.H", "B3.H", "L0.H", "L1.H", "L2.H", "L3.H",
284 #define REGNAME(x) ((x) < REG_LASTREG ? (reg_names[x]) : "...... Illegal register .......")
287 static enum machine_registers decode_dregs_lo
[] =
289 REG_RL0
, REG_RL1
, REG_RL2
, REG_RL3
, REG_RL4
, REG_RL5
, REG_RL6
, REG_RL7
,
292 #define dregs_lo(x) REGNAME (decode_dregs_lo[(x) & 7])
295 static enum machine_registers decode_dregs_hi
[] =
297 REG_RH0
, REG_RH1
, REG_RH2
, REG_RH3
, REG_RH4
, REG_RH5
, REG_RH6
, REG_RH7
,
300 #define dregs_hi(x) REGNAME (decode_dregs_hi[(x) & 7])
303 static enum machine_registers decode_dregs
[] =
305 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
308 #define dregs(x) REGNAME (decode_dregs[(x) & 7])
311 static enum machine_registers decode_dregs_byte
[] =
313 REG_BR0
, REG_BR1
, REG_BR2
, REG_BR3
, REG_BR4
, REG_BR5
, REG_BR6
, REG_BR7
,
316 #define dregs_byte(x) REGNAME (decode_dregs_byte[(x) & 7])
319 static enum machine_registers decode_pregs
[] =
321 REG_P0
, REG_P1
, REG_P2
, REG_P3
, REG_P4
, REG_P5
, REG_SP
, REG_FP
,
324 #define pregs(x) REGNAME (decode_pregs[(x) & 7])
325 #define spfp(x) REGNAME (decode_spfp[(x) & 1])
326 #define dregs_hilo(x,i) REGNAME (decode_dregs_hilo[((i) << 3)|x])
327 #define accum_ext(x) REGNAME (decode_accum_ext[(x) & 1])
328 #define accum_word(x) REGNAME (decode_accum_word[(x) & 1])
329 #define accum(x) REGNAME (decode_accum[(x) & 1])
332 static enum machine_registers decode_iregs
[] =
334 REG_I0
, REG_I1
, REG_I2
, REG_I3
,
337 #define iregs(x) REGNAME (decode_iregs[(x) & 3])
340 static enum machine_registers decode_mregs
[] =
342 REG_M0
, REG_M1
, REG_M2
, REG_M3
,
345 #define mregs(x) REGNAME (decode_mregs[(x) & 3])
346 #define bregs(x) REGNAME (decode_bregs[(x) & 3])
347 #define lregs(x) REGNAME (decode_lregs[(x) & 3])
350 static enum machine_registers decode_dpregs
[] =
352 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
353 REG_P0
, REG_P1
, REG_P2
, REG_P3
, REG_P4
, REG_P5
, REG_SP
, REG_FP
,
356 #define dpregs(x) REGNAME (decode_dpregs[(x) & 15])
359 static enum machine_registers decode_gregs
[] =
361 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
362 REG_P0
, REG_P1
, REG_P2
, REG_P3
, REG_P4
, REG_P5
, REG_SP
, REG_FP
,
365 #define gregs(x,i) REGNAME (decode_gregs[((i) << 3)|x])
367 /* [dregs pregs (iregs mregs) (bregs lregs)]. */
368 static enum machine_registers decode_regs
[] =
370 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
371 REG_P0
, REG_P1
, REG_P2
, REG_P3
, REG_P4
, REG_P5
, REG_SP
, REG_FP
,
372 REG_I0
, REG_I1
, REG_I2
, REG_I3
, REG_M0
, REG_M1
, REG_M2
, REG_M3
,
373 REG_B0
, REG_B1
, REG_B2
, REG_B3
, REG_L0
, REG_L1
, REG_L2
, REG_L3
,
376 #define regs(x,i) REGNAME (decode_regs[((i) << 3)|x])
378 /* [dregs pregs (iregs mregs) (bregs lregs) Low Half]. */
379 static enum machine_registers decode_regs_lo
[] =
381 REG_RL0
, REG_RL1
, REG_RL2
, REG_RL3
, REG_RL4
, REG_RL5
, REG_RL6
, REG_RL7
,
382 REG_PL0
, REG_PL1
, REG_PL2
, REG_PL3
, REG_PL4
, REG_PL5
, REG_SLP
, REG_FLP
,
383 REG_IL0
, REG_IL1
, REG_IL2
, REG_IL3
, REG_ML0
, REG_ML1
, REG_ML2
, REG_ML3
,
384 REG_BL0
, REG_BL1
, REG_BL2
, REG_BL3
, REG_LL0
, REG_LL1
, REG_LL2
, REG_LL3
,
387 #define regs_lo(x,i) REGNAME (decode_regs_lo[((i) << 3)|x])
388 /* [dregs pregs (iregs mregs) (bregs lregs) High Half]. */
389 static enum machine_registers decode_regs_hi
[] =
391 REG_RH0
, REG_RH1
, REG_RH2
, REG_RH3
, REG_RH4
, REG_RH5
, REG_RH6
, REG_RH7
,
392 REG_PH0
, REG_PH1
, REG_PH2
, REG_PH3
, REG_PH4
, REG_PH5
, REG_SHP
, REG_FHP
,
393 REG_IH0
, REG_IH1
, REG_IH2
, REG_IH3
, REG_MH0
, REG_MH1
, REG_MH2
, REG_MH3
,
394 REG_BH0
, REG_BH1
, REG_BH2
, REG_BH3
, REG_LH0
, REG_LH1
, REG_LH2
, REG_LH3
,
397 #define regs_hi(x,i) REGNAME (decode_regs_hi[((i) << 3)|x])
399 static enum machine_registers decode_statbits
[] =
401 REG_AZ
, REG_AN
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_AQ
, REG_LASTREG
,
402 REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_AC0
, REG_AC1
, REG_LASTREG
, REG_LASTREG
,
403 REG_AV0
, REG_AV0S
, REG_AV1
, REG_AV1S
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
,
404 REG_V
, REG_VS
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
,
407 #define statbits(x) REGNAME (decode_statbits[(x) & 31])
410 static enum machine_registers decode_counters
[] =
415 #define counters(x) REGNAME (decode_counters[(x) & 1])
416 #define dregs2_sysregs1(x) REGNAME (decode_dregs2_sysregs1[(x) & 7])
418 /* [dregs pregs (iregs mregs) (bregs lregs)
419 dregs2_sysregs1 open sysregs2 sysregs3]. */
420 static enum machine_registers decode_allregs
[] =
422 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
423 REG_P0
, REG_P1
, REG_P2
, REG_P3
, REG_P4
, REG_P5
, REG_SP
, REG_FP
,
424 REG_I0
, REG_I1
, REG_I2
, REG_I3
, REG_M0
, REG_M1
, REG_M2
, REG_M3
,
425 REG_B0
, REG_B1
, REG_B2
, REG_B3
, REG_L0
, REG_L1
, REG_L2
, REG_L3
,
426 REG_A0x
, REG_A0w
, REG_A1x
, REG_A1w
, REG_GP
, REG_LASTREG
, REG_ASTAT
, REG_RETS
,
427 REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
,
428 REG_LC0
, REG_LT0
, REG_LB0
, REG_LC1
, REG_LT1
, REG_LB1
, REG_CYCLES
, REG_CYCLES2
,
429 REG_USP
, REG_SEQSTAT
, REG_SYSCFG
, REG_RETI
, REG_RETX
, REG_RETN
, REG_RETE
, REG_EMUDAT
,
433 #define IS_DREG(g,r) ((g) == 0)
434 #define IS_PREG(g,r) ((g) == 1)
435 #define IS_AREG(g,r) ((g) == 4 && (r) >= 0 && (r) < 4)
436 #define IS_GENREG(g,r) ((g) == 0 || (g) == 1 || IS_AREG (g, r))
437 #define IS_DAGREG(g,r) ((g) == 2 || (g) == 3)
438 #define IS_SYSREG(g,r) \
439 (((g) == 4 && ((r) == 6 || (r) == 7)) || (g) == 6 || (g) == 7)
441 #define allregs(x,i) REGNAME (decode_allregs[((i) << 3) | x])
442 #define uimm16s4(x) fmtconst (c_uimm16s4, x, 0, outf)
443 #define uimm16s4d(x) fmtconst (c_uimm16s4d, x, 0, outf)
444 #define pcrel4(x) fmtconst (c_pcrel4, x, pc, outf)
445 #define pcrel8(x) fmtconst (c_pcrel8, x, pc, outf)
446 #define pcrel8s4(x) fmtconst (c_pcrel8s4, x, pc, outf)
447 #define pcrel10(x) fmtconst (c_pcrel10, x, pc, outf)
448 #define pcrel12(x) fmtconst (c_pcrel12, x, pc, outf)
449 #define negimm5s4(x) fmtconst (c_negimm5s4, x, 0, outf)
450 #define rimm16(x) fmtconst (c_rimm16, x, 0, outf)
451 #define huimm16(x) fmtconst (c_huimm16, x, 0, outf)
452 #define imm16(x) fmtconst (c_imm16, x, 0, outf)
453 #define imm16d(x) fmtconst (c_imm16d, x, 0, outf)
454 #define uimm2(x) fmtconst (c_uimm2, x, 0, outf)
455 #define uimm3(x) fmtconst (c_uimm3, x, 0, outf)
456 #define luimm16(x) fmtconst (c_luimm16, x, 0, outf)
457 #define uimm4(x) fmtconst (c_uimm4, x, 0, outf)
458 #define uimm5(x) fmtconst (c_uimm5, x, 0, outf)
459 #define imm16s2(x) fmtconst (c_imm16s2, x, 0, outf)
460 #define uimm8(x) fmtconst (c_uimm8, x, 0, outf)
461 #define imm16s4(x) fmtconst (c_imm16s4, x, 0, outf)
462 #define uimm4s2(x) fmtconst (c_uimm4s2, x, 0, outf)
463 #define uimm4s4(x) fmtconst (c_uimm4s4, x, 0, outf)
464 #define uimm4s4d(x) fmtconst (c_uimm4s4d, x, 0, outf)
465 #define lppcrel10(x) fmtconst (c_lppcrel10, x, pc, outf)
466 #define imm3(x) fmtconst (c_imm3, x, 0, outf)
467 #define imm4(x) fmtconst (c_imm4, x, 0, outf)
468 #define uimm8s4(x) fmtconst (c_uimm8s4, x, 0, outf)
469 #define imm5(x) fmtconst (c_imm5, x, 0, outf)
470 #define imm5d(x) fmtconst (c_imm5d, x, 0, outf)
471 #define imm6(x) fmtconst (c_imm6, x, 0, outf)
472 #define imm7(x) fmtconst (c_imm7, x, 0, outf)
473 #define imm7d(x) fmtconst (c_imm7d, x, 0, outf)
474 #define imm8(x) fmtconst (c_imm8, x, 0, outf)
475 #define pcrel24(x) fmtconst (c_pcrel24, x, pc, outf)
476 #define uimm16(x) fmtconst (c_uimm16, x, 0, outf)
477 #define uimm32(x) fmtconst (c_uimm32, x, 0, outf)
478 #define imm32(x) fmtconst (c_imm32, x, 0, outf)
479 #define huimm32(x) fmtconst (c_huimm32, x, 0, outf)
480 #define huimm32e(x) fmtconst (c_huimm32e, x, 0, outf)
481 #define imm7_val(x) fmtconst_val (c_imm7, x, 0)
482 #define imm16_val(x) fmtconst_val (c_uimm16, x, 0)
483 #define luimm16_val(x) fmtconst_val (c_luimm16, x, 0)
485 /* (arch.pm)arch_disassembler_functions. */
487 #define OUTS(p, txt) ((p) ? (((txt)[0]) ? (p->fprintf_func)(p->stream, "%s", txt) :0) :0)
491 amod0 (int s0
, int x0
, disassemble_info
*outf
)
493 if (s0
== 1 && x0
== 0)
495 else if (s0
== 0 && x0
== 1)
496 OUTS (outf
, " (CO)");
497 else if (s0
== 1 && x0
== 1)
498 OUTS (outf
, " (SCO)");
502 amod1 (int s0
, int x0
, disassemble_info
*outf
)
504 if (s0
== 0 && x0
== 0)
505 OUTS (outf
, " (NS)");
506 else if (s0
== 1 && x0
== 0)
511 amod0amod2 (int s0
, int x0
, int aop0
, disassemble_info
*outf
)
513 if (s0
== 1 && x0
== 0 && aop0
== 0)
515 else if (s0
== 0 && x0
== 1 && aop0
== 0)
516 OUTS (outf
, " (CO)");
517 else if (s0
== 1 && x0
== 1 && aop0
== 0)
518 OUTS (outf
, " (SCO)");
519 else if (s0
== 0 && x0
== 0 && aop0
== 2)
520 OUTS (outf
, " (ASR)");
521 else if (s0
== 1 && x0
== 0 && aop0
== 2)
522 OUTS (outf
, " (S, ASR)");
523 else if (s0
== 0 && x0
== 1 && aop0
== 2)
524 OUTS (outf
, " (CO, ASR)");
525 else if (s0
== 1 && x0
== 1 && aop0
== 2)
526 OUTS (outf
, " (SCO, ASR)");
527 else if (s0
== 0 && x0
== 0 && aop0
== 3)
528 OUTS (outf
, " (ASL)");
529 else if (s0
== 1 && x0
== 0 && aop0
== 3)
530 OUTS (outf
, " (S, ASL)");
531 else if (s0
== 0 && x0
== 1 && aop0
== 3)
532 OUTS (outf
, " (CO, ASL)");
533 else if (s0
== 1 && x0
== 1 && aop0
== 3)
534 OUTS (outf
, " (SCO, ASL)");
538 searchmod (int r0
, disassemble_info
*outf
)
551 aligndir (int r0
, disassemble_info
*outf
)
558 decode_multfunc (int h0
, int h1
, int src0
, int src1
, disassemble_info
* outf
)
563 s0
= dregs_hi (src0
);
565 s0
= dregs_lo (src0
);
568 s1
= dregs_hi (src1
);
570 s1
= dregs_lo (src1
);
579 decode_macfunc (int which
, int op
, int h0
, int h1
, int src0
, int src1
, disassemble_info
* outf
)
582 const char *sop
= "<unknown op>";
597 case 0: sop
= " = "; break;
598 case 1: sop
= " += "; break;
599 case 2: sop
= " -= "; break;
605 decode_multfunc (h0
, h1
, src0
, src1
, outf
);
611 decode_optmode (int mod
, int MM
, disassemble_info
*outf
)
613 if (mod
== 0 && MM
== 0)
628 OUTS (outf
, "S2RND");
631 else if (mod
== M_W32
)
633 else if (mod
== M_FU
)
635 else if (mod
== M_TFU
)
637 else if (mod
== M_IS
)
639 else if (mod
== M_ISS2
)
641 else if (mod
== M_IH
)
643 else if (mod
== M_IU
)
653 bu32 dpregs
[16], iregs
[4], mregs
[4], bregs
[4], lregs
[4];
654 bu32 a0x
, a0w
, a1x
, a1w
;
655 bu32 lt
[2], lc
[2], lb
[2];
656 int ac0
, ac0_copy
, ac1
, an
, aq
;
657 int av0
, av0s
, av1
, av1s
, az
, cc
, v
, v_copy
, vs
;
667 int end_of_registers
;
670 unsigned char *memory
;
671 unsigned long bfd_mach
;
674 #define DREG(x) (saved_state.dpregs[x])
675 #define GREG(x,i) DPREG ((x) | (i << 3))
676 #define DPREG(x) (saved_state.dpregs[x])
677 #define DREG(x) (saved_state.dpregs[x])
678 #define PREG(x) (saved_state.dpregs[x + 8])
679 #define SPREG PREG (6)
680 #define FPREG PREG (7)
681 #define IREG(x) (saved_state.iregs[x])
682 #define MREG(x) (saved_state.mregs[x])
683 #define BREG(x) (saved_state.bregs[x])
684 #define LREG(x) (saved_state.lregs[x])
685 #define A0XREG (saved_state.a0x)
686 #define A0WREG (saved_state.a0w)
687 #define A1XREG (saved_state.a1x)
688 #define A1WREG (saved_state.a1w)
689 #define CCREG (saved_state.cc)
690 #define LC0REG (saved_state.lc[0])
691 #define LT0REG (saved_state.lt[0])
692 #define LB0REG (saved_state.lb[0])
693 #define LC1REG (saved_state.lc[1])
694 #define LT1REG (saved_state.lt[1])
695 #define LB1REG (saved_state.lb[1])
696 #define RETSREG (saved_state.rets)
697 #define PCREG (saved_state.pc)
700 get_allreg (int grp
, int reg
)
702 int fullreg
= (grp
<< 3) | reg
;
703 /* REG_R0, REG_R1, REG_R2, REG_R3, REG_R4, REG_R5, REG_R6, REG_R7,
704 REG_P0, REG_P1, REG_P2, REG_P3, REG_P4, REG_P5, REG_SP, REG_FP,
705 REG_I0, REG_I1, REG_I2, REG_I3, REG_M0, REG_M1, REG_M2, REG_M3,
706 REG_B0, REG_B1, REG_B2, REG_B3, REG_L0, REG_L1, REG_L2, REG_L3,
707 REG_A0x, REG_A0w, REG_A1x, REG_A1w, , , REG_ASTAT, REG_RETS,
709 REG_LC0, REG_LT0, REG_LB0, REG_LC1, REG_LT1, REG_LB1, REG_CYCLES,
711 REG_USP, REG_SEQSTAT, REG_SYSCFG, REG_RETI, REG_RETX, REG_RETN, REG_RETE,
713 switch (fullreg
>> 2)
715 case 0: case 1: return &DREG (reg
); break;
716 case 2: case 3: return &PREG (reg
); break;
717 case 4: return &IREG (reg
& 3); break;
718 case 5: return &MREG (reg
& 3); break;
719 case 6: return &BREG (reg
& 3); break;
720 case 7: return &LREG (reg
& 3); break;
724 case 32: return &saved_state
.a0x
;
725 case 33: return &saved_state
.a0w
;
726 case 34: return &saved_state
.a1x
;
727 case 35: return &saved_state
.a1w
;
728 case 39: return &saved_state
.rets
;
729 case 48: return &LC0REG
;
730 case 49: return <0REG
;
731 case 50: return &LB0REG
;
732 case 51: return &LC1REG
;
733 case 52: return <1REG
;
734 case 53: return &LB1REG
;
741 decode_ProgCtrl_0 (TIword iw0
, disassemble_info
*outf
)
744 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
745 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |.prgfunc.......|.poprnd........|
746 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
747 int poprnd
= ((iw0
>> ProgCtrl_poprnd_bits
) & ProgCtrl_poprnd_mask
);
748 int prgfunc
= ((iw0
>> ProgCtrl_prgfunc_bits
) & ProgCtrl_prgfunc_mask
);
750 if (prgfunc
== 0 && poprnd
== 0)
752 else if (prgfunc
== 1 && poprnd
== 0)
754 else if (prgfunc
== 1 && poprnd
== 1)
756 else if (prgfunc
== 1 && poprnd
== 2)
758 else if (prgfunc
== 1 && poprnd
== 3)
760 else if (prgfunc
== 1 && poprnd
== 4)
762 else if (prgfunc
== 2 && poprnd
== 0)
764 else if (prgfunc
== 2 && poprnd
== 3)
765 OUTS (outf
, "CSYNC");
766 else if (prgfunc
== 2 && poprnd
== 4)
767 OUTS (outf
, "SSYNC");
768 else if (prgfunc
== 2 && poprnd
== 5)
769 OUTS (outf
, "EMUEXCPT");
770 else if (prgfunc
== 3)
773 OUTS (outf
, dregs (poprnd
));
775 else if (prgfunc
== 4)
778 OUTS (outf
, dregs (poprnd
));
780 else if (prgfunc
== 5)
782 OUTS (outf
, "JUMP (");
783 OUTS (outf
, pregs (poprnd
));
786 else if (prgfunc
== 6)
788 OUTS (outf
, "CALL (");
789 OUTS (outf
, pregs (poprnd
));
792 else if (prgfunc
== 7)
794 OUTS (outf
, "CALL (PC + ");
795 OUTS (outf
, pregs (poprnd
));
798 else if (prgfunc
== 8)
800 OUTS (outf
, "JUMP (PC + ");
801 OUTS (outf
, pregs (poprnd
));
804 else if (prgfunc
== 9)
806 OUTS (outf
, "RAISE ");
807 OUTS (outf
, uimm4 (poprnd
));
809 else if (prgfunc
== 10)
811 OUTS (outf
, "EXCPT ");
812 OUTS (outf
, uimm4 (poprnd
));
814 else if (prgfunc
== 11)
816 OUTS (outf
, "TESTSET (");
817 OUTS (outf
, pregs (poprnd
));
826 decode_CaCTRL_0 (TIword iw0
, disassemble_info
*outf
)
829 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
830 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 |.a.|.op....|.reg.......|
831 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
832 int a
= ((iw0
>> CaCTRL_a_bits
) & CaCTRL_a_mask
);
833 int op
= ((iw0
>> CaCTRL_op_bits
) & CaCTRL_op_mask
);
834 int reg
= ((iw0
>> CaCTRL_reg_bits
) & CaCTRL_reg_mask
);
836 if (a
== 0 && op
== 0)
838 OUTS (outf
, "PREFETCH[");
839 OUTS (outf
, pregs (reg
));
842 else if (a
== 0 && op
== 1)
844 OUTS (outf
, "FLUSHINV[");
845 OUTS (outf
, pregs (reg
));
848 else if (a
== 0 && op
== 2)
850 OUTS (outf
, "FLUSH[");
851 OUTS (outf
, pregs (reg
));
854 else if (a
== 0 && op
== 3)
856 OUTS (outf
, "IFLUSH[");
857 OUTS (outf
, pregs (reg
));
860 else if (a
== 1 && op
== 0)
862 OUTS (outf
, "PREFETCH[");
863 OUTS (outf
, pregs (reg
));
866 else if (a
== 1 && op
== 1)
868 OUTS (outf
, "FLUSHINV[");
869 OUTS (outf
, pregs (reg
));
872 else if (a
== 1 && op
== 2)
874 OUTS (outf
, "FLUSH[");
875 OUTS (outf
, pregs (reg
));
878 else if (a
== 1 && op
== 3)
880 OUTS (outf
, "IFLUSH[");
881 OUTS (outf
, pregs (reg
));
890 decode_PushPopReg_0 (TIword iw0
, disassemble_info
*outf
)
893 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
894 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |.W.|.grp.......|.reg.......|
895 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
896 int W
= ((iw0
>> PushPopReg_W_bits
) & PushPopReg_W_mask
);
897 int grp
= ((iw0
>> PushPopReg_grp_bits
) & PushPopReg_grp_mask
);
898 int reg
= ((iw0
>> PushPopReg_reg_bits
) & PushPopReg_reg_mask
);
902 OUTS (outf
, allregs (reg
, grp
));
903 OUTS (outf
, " = [SP++]");
907 OUTS (outf
, "[--SP] = ");
908 OUTS (outf
, allregs (reg
, grp
));
916 decode_PushPopMultiple_0 (TIword iw0
, disassemble_info
*outf
)
919 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
920 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |.d.|.p.|.W.|.dr........|.pr........|
921 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
922 int p
= ((iw0
>> PushPopMultiple_p_bits
) & PushPopMultiple_p_mask
);
923 int d
= ((iw0
>> PushPopMultiple_d_bits
) & PushPopMultiple_d_mask
);
924 int W
= ((iw0
>> PushPopMultiple_W_bits
) & PushPopMultiple_W_mask
);
925 int dr
= ((iw0
>> PushPopMultiple_dr_bits
) & PushPopMultiple_dr_mask
);
926 int pr
= ((iw0
>> PushPopMultiple_pr_bits
) & PushPopMultiple_pr_mask
);
928 if (W
== 1 && d
== 1 && p
== 1)
930 OUTS (outf
, "[--SP] = (R7:");
931 OUTS (outf
, imm5d (dr
));
932 OUTS (outf
, ", P5:");
933 OUTS (outf
, imm5d (pr
));
936 else if (W
== 1 && d
== 1 && p
== 0)
938 OUTS (outf
, "[--SP] = (R7:");
939 OUTS (outf
, imm5d (dr
));
942 else if (W
== 1 && d
== 0 && p
== 1)
944 OUTS (outf
, "[--SP] = (P5:");
945 OUTS (outf
, imm5d (pr
));
948 else if (W
== 0 && d
== 1 && p
== 1)
951 OUTS (outf
, imm5d (dr
));
952 OUTS (outf
, ", P5:");
953 OUTS (outf
, imm5d (pr
));
954 OUTS (outf
, ") = [SP++]");
956 else if (W
== 0 && d
== 1 && p
== 0)
959 OUTS (outf
, imm5d (dr
));
960 OUTS (outf
, ") = [SP++]");
962 else if (W
== 0 && d
== 0 && p
== 1)
965 OUTS (outf
, imm5d (pr
));
966 OUTS (outf
, ") = [SP++]");
974 decode_ccMV_0 (TIword iw0
, disassemble_info
*outf
)
977 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
978 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |.T.|.d.|.s.|.dst.......|.src.......|
979 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
980 int s
= ((iw0
>> CCmv_s_bits
) & CCmv_s_mask
);
981 int d
= ((iw0
>> CCmv_d_bits
) & CCmv_d_mask
);
982 int T
= ((iw0
>> CCmv_T_bits
) & CCmv_T_mask
);
983 int src
= ((iw0
>> CCmv_src_bits
) & CCmv_src_mask
);
984 int dst
= ((iw0
>> CCmv_dst_bits
) & CCmv_dst_mask
);
988 OUTS (outf
, "IF CC ");
989 OUTS (outf
, gregs (dst
, d
));
991 OUTS (outf
, gregs (src
, s
));
995 OUTS (outf
, "IF !CC ");
996 OUTS (outf
, gregs (dst
, d
));
998 OUTS (outf
, gregs (src
, s
));
1006 decode_CCflag_0 (TIword iw0
, disassemble_info
*outf
)
1009 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1010 | 0 | 0 | 0 | 0 | 1 |.I.|.opc.......|.G.|.y.........|.x.........|
1011 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1012 int x
= ((iw0
>> CCflag_x_bits
) & CCflag_x_mask
);
1013 int y
= ((iw0
>> CCflag_y_bits
) & CCflag_y_mask
);
1014 int I
= ((iw0
>> CCflag_I_bits
) & CCflag_I_mask
);
1015 int G
= ((iw0
>> CCflag_G_bits
) & CCflag_G_mask
);
1016 int opc
= ((iw0
>> CCflag_opc_bits
) & CCflag_opc_mask
);
1018 if (opc
== 0 && I
== 0 && G
== 0)
1020 OUTS (outf
, "CC = ");
1021 OUTS (outf
, dregs (x
));
1022 OUTS (outf
, " == ");
1023 OUTS (outf
, dregs (y
));
1025 else if (opc
== 1 && I
== 0 && G
== 0)
1027 OUTS (outf
, "CC = ");
1028 OUTS (outf
, dregs (x
));
1030 OUTS (outf
, dregs (y
));
1032 else if (opc
== 2 && I
== 0 && G
== 0)
1034 OUTS (outf
, "CC = ");
1035 OUTS (outf
, dregs (x
));
1036 OUTS (outf
, " <= ");
1037 OUTS (outf
, dregs (y
));
1039 else if (opc
== 3 && I
== 0 && G
== 0)
1041 OUTS (outf
, "CC = ");
1042 OUTS (outf
, dregs (x
));
1044 OUTS (outf
, dregs (y
));
1045 OUTS (outf
, " (IU)");
1047 else if (opc
== 4 && I
== 0 && G
== 0)
1049 OUTS (outf
, "CC = ");
1050 OUTS (outf
, dregs (x
));
1051 OUTS (outf
, " <= ");
1052 OUTS (outf
, dregs (y
));
1053 OUTS (outf
, " (IU)");
1055 else if (opc
== 0 && I
== 1 && G
== 0)
1057 OUTS (outf
, "CC = ");
1058 OUTS (outf
, dregs (x
));
1059 OUTS (outf
, " == ");
1060 OUTS (outf
, imm3 (y
));
1062 else if (opc
== 1 && I
== 1 && G
== 0)
1064 OUTS (outf
, "CC = ");
1065 OUTS (outf
, dregs (x
));
1067 OUTS (outf
, imm3 (y
));
1069 else if (opc
== 2 && I
== 1 && G
== 0)
1071 OUTS (outf
, "CC = ");
1072 OUTS (outf
, dregs (x
));
1073 OUTS (outf
, " <= ");
1074 OUTS (outf
, imm3 (y
));
1076 else if (opc
== 3 && I
== 1 && G
== 0)
1078 OUTS (outf
, "CC = ");
1079 OUTS (outf
, dregs (x
));
1081 OUTS (outf
, uimm3 (y
));
1082 OUTS (outf
, " (IU)");
1084 else if (opc
== 4 && I
== 1 && G
== 0)
1086 OUTS (outf
, "CC = ");
1087 OUTS (outf
, dregs (x
));
1088 OUTS (outf
, " <= ");
1089 OUTS (outf
, uimm3 (y
));
1090 OUTS (outf
, " (IU)");
1092 else if (opc
== 0 && I
== 0 && G
== 1)
1094 OUTS (outf
, "CC = ");
1095 OUTS (outf
, pregs (x
));
1096 OUTS (outf
, " == ");
1097 OUTS (outf
, pregs (y
));
1099 else if (opc
== 1 && I
== 0 && G
== 1)
1101 OUTS (outf
, "CC = ");
1102 OUTS (outf
, pregs (x
));
1104 OUTS (outf
, pregs (y
));
1106 else if (opc
== 2 && I
== 0 && G
== 1)
1108 OUTS (outf
, "CC = ");
1109 OUTS (outf
, pregs (x
));
1110 OUTS (outf
, " <= ");
1111 OUTS (outf
, pregs (y
));
1113 else if (opc
== 3 && I
== 0 && G
== 1)
1115 OUTS (outf
, "CC = ");
1116 OUTS (outf
, pregs (x
));
1118 OUTS (outf
, pregs (y
));
1119 OUTS (outf
, " (IU)");
1121 else if (opc
== 4 && I
== 0 && G
== 1)
1123 OUTS (outf
, "CC = ");
1124 OUTS (outf
, pregs (x
));
1125 OUTS (outf
, " <= ");
1126 OUTS (outf
, pregs (y
));
1127 OUTS (outf
, " (IU)");
1129 else if (opc
== 0 && I
== 1 && G
== 1)
1131 OUTS (outf
, "CC = ");
1132 OUTS (outf
, pregs (x
));
1133 OUTS (outf
, " == ");
1134 OUTS (outf
, imm3 (y
));
1136 else if (opc
== 1 && I
== 1 && G
== 1)
1138 OUTS (outf
, "CC = ");
1139 OUTS (outf
, pregs (x
));
1141 OUTS (outf
, imm3 (y
));
1143 else if (opc
== 2 && I
== 1 && G
== 1)
1145 OUTS (outf
, "CC = ");
1146 OUTS (outf
, pregs (x
));
1147 OUTS (outf
, " <= ");
1148 OUTS (outf
, imm3 (y
));
1150 else if (opc
== 3 && I
== 1 && G
== 1)
1152 OUTS (outf
, "CC = ");
1153 OUTS (outf
, pregs (x
));
1155 OUTS (outf
, uimm3 (y
));
1156 OUTS (outf
, " (IU)");
1158 else if (opc
== 4 && I
== 1 && G
== 1)
1160 OUTS (outf
, "CC = ");
1161 OUTS (outf
, pregs (x
));
1162 OUTS (outf
, " <= ");
1163 OUTS (outf
, uimm3 (y
));
1164 OUTS (outf
, " (IU)");
1166 else if (opc
== 5 && I
== 0 && G
== 0)
1167 OUTS (outf
, "CC = A0 == A1");
1169 else if (opc
== 6 && I
== 0 && G
== 0)
1170 OUTS (outf
, "CC = A0 < A1");
1172 else if (opc
== 7 && I
== 0 && G
== 0)
1173 OUTS (outf
, "CC = A0 <= A1");
1181 decode_CC2dreg_0 (TIword iw0
, disassemble_info
*outf
)
1184 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1185 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |.op....|.reg.......|
1186 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1187 int op
= ((iw0
>> CC2dreg_op_bits
) & CC2dreg_op_mask
);
1188 int reg
= ((iw0
>> CC2dreg_reg_bits
) & CC2dreg_reg_mask
);
1192 OUTS (outf
, dregs (reg
));
1193 OUTS (outf
, " = CC");
1197 OUTS (outf
, "CC = ");
1198 OUTS (outf
, dregs (reg
));
1201 OUTS (outf
, "CC = !CC");
1209 decode_CC2stat_0 (TIword iw0
, disassemble_info
*outf
)
1212 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1213 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |.D.|.op....|.cbit..............|
1214 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1215 int D
= ((iw0
>> CC2stat_D_bits
) & CC2stat_D_mask
);
1216 int op
= ((iw0
>> CC2stat_op_bits
) & CC2stat_op_mask
);
1217 int cbit
= ((iw0
>> CC2stat_cbit_bits
) & CC2stat_cbit_mask
);
1219 if (op
== 0 && D
== 0)
1221 OUTS (outf
, "CC = ");
1222 OUTS (outf
, statbits (cbit
));
1224 else if (op
== 1 && D
== 0)
1226 OUTS (outf
, "CC |= ");
1227 OUTS (outf
, statbits (cbit
));
1229 else if (op
== 2 && D
== 0)
1231 OUTS (outf
, "CC &= ");
1232 OUTS (outf
, statbits (cbit
));
1234 else if (op
== 3 && D
== 0)
1236 OUTS (outf
, "CC ^= ");
1237 OUTS (outf
, statbits (cbit
));
1239 else if (op
== 0 && D
== 1)
1241 OUTS (outf
, statbits (cbit
));
1242 OUTS (outf
, " = CC");
1244 else if (op
== 1 && D
== 1)
1246 OUTS (outf
, statbits (cbit
));
1247 OUTS (outf
, " |= CC");
1249 else if (op
== 2 && D
== 1)
1251 OUTS (outf
, statbits (cbit
));
1252 OUTS (outf
, " &= CC");
1254 else if (op
== 3 && D
== 1)
1256 OUTS (outf
, statbits (cbit
));
1257 OUTS (outf
, " ^= CC");
1266 decode_BRCC_0 (TIword iw0
, bfd_vma pc
, disassemble_info
*outf
)
1269 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1270 | 0 | 0 | 0 | 1 |.T.|.B.|.offset................................|
1271 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1272 int B
= ((iw0
>> BRCC_B_bits
) & BRCC_B_mask
);
1273 int T
= ((iw0
>> BRCC_T_bits
) & BRCC_T_mask
);
1274 int offset
= ((iw0
>> BRCC_offset_bits
) & BRCC_offset_mask
);
1276 if (T
== 1 && B
== 1)
1278 OUTS (outf
, "IF CC JUMP 0x");
1279 OUTS (outf
, pcrel10 (offset
));
1280 OUTS (outf
, " (BP)");
1282 else if (T
== 0 && B
== 1)
1284 OUTS (outf
, "IF !CC JUMP 0x");
1285 OUTS (outf
, pcrel10 (offset
));
1286 OUTS (outf
, " (BP)");
1290 OUTS (outf
, "IF CC JUMP 0x");
1291 OUTS (outf
, pcrel10 (offset
));
1295 OUTS (outf
, "IF !CC JUMP 0x");
1296 OUTS (outf
, pcrel10 (offset
));
1305 decode_UJUMP_0 (TIword iw0
, bfd_vma pc
, disassemble_info
*outf
)
1308 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1309 | 0 | 0 | 1 | 0 |.offset........................................|
1310 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1311 int offset
= ((iw0
>> UJump_offset_bits
) & UJump_offset_mask
);
1313 OUTS (outf
, "JUMP.S 0x");
1314 OUTS (outf
, pcrel12 (offset
));
1319 decode_REGMV_0 (TIword iw0
, disassemble_info
*outf
)
1322 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1323 | 0 | 0 | 1 | 1 |.gd........|.gs........|.dst.......|.src.......|
1324 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1325 int gs
= ((iw0
>> RegMv_gs_bits
) & RegMv_gs_mask
);
1326 int gd
= ((iw0
>> RegMv_gd_bits
) & RegMv_gd_mask
);
1327 int src
= ((iw0
>> RegMv_src_bits
) & RegMv_src_mask
);
1328 int dst
= ((iw0
>> RegMv_dst_bits
) & RegMv_dst_mask
);
1330 if (!((IS_GENREG (gd
, dst
) && IS_GENREG (gs
, src
))
1331 || (IS_GENREG (gd
, dst
) && IS_DAGREG (gs
, src
))
1332 || (IS_DAGREG (gd
, dst
) && IS_GENREG (gs
, src
))
1333 || (IS_DAGREG (gd
, dst
) && IS_DAGREG (gs
, src
))
1334 || (IS_GENREG (gd
, dst
) && gs
== 7 && src
== 0)
1335 || (gd
== 7 && dst
== 0 && IS_GENREG (gs
, src
))
1336 || (IS_DREG (gd
, dst
) && IS_SYSREG (gs
, src
))
1337 || (IS_PREG (gd
, dst
) && IS_SYSREG (gs
, src
))
1338 || (IS_SYSREG (gd
, dst
) && IS_DREG (gs
, src
))
1339 || (IS_SYSREG (gd
, dst
) && IS_PREG (gs
, src
))
1340 || (IS_SYSREG (gd
, dst
) && gs
== 7 && src
== 0)))
1343 OUTS (outf
, allregs (dst
, gd
));
1345 OUTS (outf
, allregs (src
, gs
));
1350 decode_ALU2op_0 (TIword iw0
, disassemble_info
*outf
)
1353 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1354 | 0 | 1 | 0 | 0 | 0 | 0 |.opc...........|.src.......|.dst.......|
1355 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1356 int src
= ((iw0
>> ALU2op_src_bits
) & ALU2op_src_mask
);
1357 int opc
= ((iw0
>> ALU2op_opc_bits
) & ALU2op_opc_mask
);
1358 int dst
= ((iw0
>> ALU2op_dst_bits
) & ALU2op_dst_mask
);
1362 OUTS (outf
, dregs (dst
));
1363 OUTS (outf
, " >>>= ");
1364 OUTS (outf
, dregs (src
));
1368 OUTS (outf
, dregs (dst
));
1369 OUTS (outf
, " >>= ");
1370 OUTS (outf
, dregs (src
));
1374 OUTS (outf
, dregs (dst
));
1375 OUTS (outf
, " <<= ");
1376 OUTS (outf
, dregs (src
));
1380 OUTS (outf
, dregs (dst
));
1381 OUTS (outf
, " *= ");
1382 OUTS (outf
, dregs (src
));
1386 OUTS (outf
, dregs (dst
));
1387 OUTS (outf
, " = (");
1388 OUTS (outf
, dregs (dst
));
1390 OUTS (outf
, dregs (src
));
1391 OUTS (outf
, ") << 0x1");
1395 OUTS (outf
, dregs (dst
));
1396 OUTS (outf
, " = (");
1397 OUTS (outf
, dregs (dst
));
1399 OUTS (outf
, dregs (src
));
1400 OUTS (outf
, ") << 0x2");
1404 OUTS (outf
, "DIVQ (");
1405 OUTS (outf
, dregs (dst
));
1407 OUTS (outf
, dregs (src
));
1412 OUTS (outf
, "DIVS (");
1413 OUTS (outf
, dregs (dst
));
1415 OUTS (outf
, dregs (src
));
1420 OUTS (outf
, dregs (dst
));
1422 OUTS (outf
, dregs_lo (src
));
1423 OUTS (outf
, " (X)");
1427 OUTS (outf
, dregs (dst
));
1429 OUTS (outf
, dregs_lo (src
));
1430 OUTS (outf
, " (Z)");
1434 OUTS (outf
, dregs (dst
));
1436 OUTS (outf
, dregs_byte (src
));
1437 OUTS (outf
, " (X)");
1441 OUTS (outf
, dregs (dst
));
1443 OUTS (outf
, dregs_byte (src
));
1444 OUTS (outf
, " (Z)");
1448 OUTS (outf
, dregs (dst
));
1449 OUTS (outf
, " = -");
1450 OUTS (outf
, dregs (src
));
1454 OUTS (outf
, dregs (dst
));
1455 OUTS (outf
, " =~ ");
1456 OUTS (outf
, dregs (src
));
1465 decode_PTR2op_0 (TIword iw0
, disassemble_info
*outf
)
1468 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1469 | 0 | 1 | 0 | 0 | 0 | 1 | 0 |.opc.......|.src.......|.dst.......|
1470 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1471 int src
= ((iw0
>> PTR2op_src_bits
) & PTR2op_dst_mask
);
1472 int opc
= ((iw0
>> PTR2op_opc_bits
) & PTR2op_opc_mask
);
1473 int dst
= ((iw0
>> PTR2op_dst_bits
) & PTR2op_dst_mask
);
1477 OUTS (outf
, pregs (dst
));
1478 OUTS (outf
, " -= ");
1479 OUTS (outf
, pregs (src
));
1483 OUTS (outf
, pregs (dst
));
1485 OUTS (outf
, pregs (src
));
1486 OUTS (outf
, " << 0x2");
1490 OUTS (outf
, pregs (dst
));
1492 OUTS (outf
, pregs (src
));
1493 OUTS (outf
, " >> 0x2");
1497 OUTS (outf
, pregs (dst
));
1499 OUTS (outf
, pregs (src
));
1500 OUTS (outf
, " >> 0x1");
1504 OUTS (outf
, pregs (dst
));
1505 OUTS (outf
, " += ");
1506 OUTS (outf
, pregs (src
));
1507 OUTS (outf
, " (BREV)");
1511 OUTS (outf
, pregs (dst
));
1512 OUTS (outf
, " = (");
1513 OUTS (outf
, pregs (dst
));
1515 OUTS (outf
, pregs (src
));
1516 OUTS (outf
, ") << 0x1");
1520 OUTS (outf
, pregs (dst
));
1521 OUTS (outf
, " = (");
1522 OUTS (outf
, pregs (dst
));
1524 OUTS (outf
, pregs (src
));
1525 OUTS (outf
, ") << 0x2");
1534 decode_LOGI2op_0 (TIword iw0
, disassemble_info
*outf
)
1537 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1538 | 0 | 1 | 0 | 0 | 1 |.opc.......|.src...............|.dst.......|
1539 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1540 int src
= ((iw0
>> LOGI2op_src_bits
) & LOGI2op_src_mask
);
1541 int opc
= ((iw0
>> LOGI2op_opc_bits
) & LOGI2op_opc_mask
);
1542 int dst
= ((iw0
>> LOGI2op_dst_bits
) & LOGI2op_dst_mask
);
1546 OUTS (outf
, "CC = !BITTST (");
1547 OUTS (outf
, dregs (dst
));
1549 OUTS (outf
, uimm5 (src
));
1550 OUTS (outf
, ");\t\t/* bit");
1551 OUTS (outf
, imm7d (src
));
1557 OUTS (outf
, "CC = BITTST (");
1558 OUTS (outf
, dregs (dst
));
1560 OUTS (outf
, uimm5 (src
));
1561 OUTS (outf
, ");\t\t/* bit");
1562 OUTS (outf
, imm7d (src
));
1568 OUTS (outf
, "BITSET (");
1569 OUTS (outf
, dregs (dst
));
1571 OUTS (outf
, uimm5 (src
));
1572 OUTS (outf
, ");\t\t/* bit");
1573 OUTS (outf
, imm7d (src
));
1579 OUTS (outf
, "BITTGL (");
1580 OUTS (outf
, dregs (dst
));
1582 OUTS (outf
, uimm5 (src
));
1583 OUTS (outf
, ");\t\t/* bit");
1584 OUTS (outf
, imm7d (src
));
1590 OUTS (outf
, "BITCLR (");
1591 OUTS (outf
, dregs (dst
));
1593 OUTS (outf
, uimm5 (src
));
1594 OUTS (outf
, ");\t\t/* bit");
1595 OUTS (outf
, imm7d (src
));
1601 OUTS (outf
, dregs (dst
));
1602 OUTS (outf
, " >>>= ");
1603 OUTS (outf
, uimm5 (src
));
1607 OUTS (outf
, dregs (dst
));
1608 OUTS (outf
, " >>= ");
1609 OUTS (outf
, uimm5 (src
));
1613 OUTS (outf
, dregs (dst
));
1614 OUTS (outf
, " <<= ");
1615 OUTS (outf
, uimm5 (src
));
1624 decode_COMP3op_0 (TIword iw0
, disassemble_info
*outf
)
1627 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1628 | 0 | 1 | 0 | 1 |.opc.......|.dst.......|.src1......|.src0......|
1629 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1630 int opc
= ((iw0
>> COMP3op_opc_bits
) & COMP3op_opc_mask
);
1631 int dst
= ((iw0
>> COMP3op_dst_bits
) & COMP3op_dst_mask
);
1632 int src0
= ((iw0
>> COMP3op_src0_bits
) & COMP3op_src0_mask
);
1633 int src1
= ((iw0
>> COMP3op_src1_bits
) & COMP3op_src1_mask
);
1635 if (opc
== 5 && src1
== src0
)
1637 OUTS (outf
, pregs (dst
));
1639 OUTS (outf
, pregs (src0
));
1640 OUTS (outf
, " << 0x1");
1644 OUTS (outf
, dregs (dst
));
1646 OUTS (outf
, dregs (src0
));
1648 OUTS (outf
, dregs (src1
));
1652 OUTS (outf
, dregs (dst
));
1654 OUTS (outf
, dregs (src0
));
1656 OUTS (outf
, dregs (src1
));
1660 OUTS (outf
, dregs (dst
));
1662 OUTS (outf
, dregs (src0
));
1664 OUTS (outf
, dregs (src1
));
1668 OUTS (outf
, dregs (dst
));
1670 OUTS (outf
, dregs (src0
));
1672 OUTS (outf
, dregs (src1
));
1676 OUTS (outf
, pregs (dst
));
1678 OUTS (outf
, pregs (src0
));
1680 OUTS (outf
, pregs (src1
));
1684 OUTS (outf
, pregs (dst
));
1686 OUTS (outf
, pregs (src0
));
1687 OUTS (outf
, " + (");
1688 OUTS (outf
, pregs (src1
));
1689 OUTS (outf
, " << 0x1)");
1693 OUTS (outf
, pregs (dst
));
1695 OUTS (outf
, pregs (src0
));
1696 OUTS (outf
, " + (");
1697 OUTS (outf
, pregs (src1
));
1698 OUTS (outf
, " << 0x2)");
1702 OUTS (outf
, dregs (dst
));
1704 OUTS (outf
, dregs (src0
));
1706 OUTS (outf
, dregs (src1
));
1715 decode_COMPI2opD_0 (TIword iw0
, disassemble_info
*outf
)
1718 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1719 | 0 | 1 | 1 | 0 | 0 |.op|..src......................|.dst.......|
1720 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1721 int op
= ((iw0
>> COMPI2opD_op_bits
) & COMPI2opD_op_mask
);
1722 int dst
= ((iw0
>> COMPI2opD_dst_bits
) & COMPI2opD_dst_mask
);
1723 int src
= ((iw0
>> COMPI2opD_src_bits
) & COMPI2opD_src_mask
);
1725 bu32
*pval
= get_allreg (0, dst
);
1727 /* Since we don't have 32-bit immediate loads, we allow the disassembler
1728 to combine them, so it prints out the right values.
1729 Here we keep track of the registers. */
1732 *pval
= imm7_val (src
);
1734 *pval
|= 0xFFFFFF80;
1741 OUTS (outf
, dregs (dst
));
1743 OUTS (outf
, imm7 (src
));
1744 OUTS (outf
, " (X);\t\t/*\t\t");
1745 OUTS (outf
, dregs (dst
));
1747 OUTS (outf
, uimm32 (*pval
));
1749 OUTS (outf
, imm32 (*pval
));
1750 OUTS (outf
, ") */");
1755 OUTS (outf
, dregs (dst
));
1756 OUTS (outf
, " += ");
1757 OUTS (outf
, imm7 (src
));
1758 OUTS (outf
, ";\t\t/* (");
1759 OUTS (outf
, imm7d (src
));
1760 OUTS (outf
, ") */");
1770 decode_COMPI2opP_0 (TIword iw0
, disassemble_info
*outf
)
1773 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1774 | 0 | 1 | 1 | 0 | 1 |.op|.src.......................|.dst.......|
1775 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1776 int op
= ((iw0
>> COMPI2opP_op_bits
) & COMPI2opP_op_mask
);
1777 int src
= ((iw0
>> COMPI2opP_src_bits
) & COMPI2opP_src_mask
);
1778 int dst
= ((iw0
>> COMPI2opP_dst_bits
) & COMPI2opP_dst_mask
);
1780 bu32
*pval
= get_allreg (1, dst
);
1784 *pval
= imm7_val (src
);
1786 *pval
|= 0xFFFFFF80;
1793 OUTS (outf
, pregs (dst
));
1795 OUTS (outf
, imm7 (src
));
1796 OUTS (outf
, " (X);\t\t/*\t\t");
1797 OUTS (outf
, pregs (dst
));
1799 OUTS (outf
, uimm32 (*pval
));
1801 OUTS (outf
, imm32 (*pval
));
1802 OUTS (outf
, ") */");
1807 OUTS (outf
, pregs (dst
));
1808 OUTS (outf
, " += ");
1809 OUTS (outf
, imm7 (src
));
1810 OUTS (outf
, ";\t\t/* (");
1811 OUTS (outf
, imm7d (src
));
1812 OUTS (outf
, ") */");
1822 decode_LDSTpmod_0 (TIword iw0
, disassemble_info
*outf
)
1825 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1826 | 1 | 0 | 0 | 0 |.W.|.aop...|.reg.......|.idx.......|.ptr.......|
1827 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1828 int W
= ((iw0
>> LDSTpmod_W_bits
) & LDSTpmod_W_mask
);
1829 int aop
= ((iw0
>> LDSTpmod_aop_bits
) & LDSTpmod_aop_mask
);
1830 int idx
= ((iw0
>> LDSTpmod_idx_bits
) & LDSTpmod_idx_mask
);
1831 int ptr
= ((iw0
>> LDSTpmod_ptr_bits
) & LDSTpmod_ptr_mask
);
1832 int reg
= ((iw0
>> LDSTpmod_reg_bits
) & LDSTpmod_reg_mask
);
1834 if (aop
== 1 && W
== 0 && idx
== ptr
)
1836 OUTS (outf
, dregs_lo (reg
));
1837 OUTS (outf
, " = W[");
1838 OUTS (outf
, pregs (ptr
));
1841 else if (aop
== 2 && W
== 0 && idx
== ptr
)
1843 OUTS (outf
, dregs_hi (reg
));
1844 OUTS (outf
, " = W[");
1845 OUTS (outf
, pregs (ptr
));
1848 else if (aop
== 1 && W
== 1 && idx
== ptr
)
1851 OUTS (outf
, pregs (ptr
));
1852 OUTS (outf
, "] = ");
1853 OUTS (outf
, dregs_lo (reg
));
1855 else if (aop
== 2 && W
== 1 && idx
== ptr
)
1858 OUTS (outf
, pregs (ptr
));
1859 OUTS (outf
, "] = ");
1860 OUTS (outf
, dregs_hi (reg
));
1862 else if (aop
== 0 && W
== 0)
1864 OUTS (outf
, dregs (reg
));
1865 OUTS (outf
, " = [");
1866 OUTS (outf
, pregs (ptr
));
1867 OUTS (outf
, " ++ ");
1868 OUTS (outf
, pregs (idx
));
1871 else if (aop
== 1 && W
== 0)
1873 OUTS (outf
, dregs_lo (reg
));
1874 OUTS (outf
, " = W[");
1875 OUTS (outf
, pregs (ptr
));
1876 OUTS (outf
, " ++ ");
1877 OUTS (outf
, pregs (idx
));
1880 else if (aop
== 2 && W
== 0)
1882 OUTS (outf
, dregs_hi (reg
));
1883 OUTS (outf
, " = W[");
1884 OUTS (outf
, pregs (ptr
));
1885 OUTS (outf
, " ++ ");
1886 OUTS (outf
, pregs (idx
));
1889 else if (aop
== 3 && W
== 0)
1891 OUTS (outf
, dregs (reg
));
1892 OUTS (outf
, " = W[");
1893 OUTS (outf
, pregs (ptr
));
1894 OUTS (outf
, " ++ ");
1895 OUTS (outf
, pregs (idx
));
1896 OUTS (outf
, "] (Z)");
1898 else if (aop
== 3 && W
== 1)
1900 OUTS (outf
, dregs (reg
));
1901 OUTS (outf
, " = W[");
1902 OUTS (outf
, pregs (ptr
));
1903 OUTS (outf
, " ++ ");
1904 OUTS (outf
, pregs (idx
));
1905 OUTS (outf
, "] (X)");
1907 else if (aop
== 0 && W
== 1)
1910 OUTS (outf
, pregs (ptr
));
1911 OUTS (outf
, " ++ ");
1912 OUTS (outf
, pregs (idx
));
1913 OUTS (outf
, "] = ");
1914 OUTS (outf
, dregs (reg
));
1916 else if (aop
== 1 && W
== 1)
1919 OUTS (outf
, pregs (ptr
));
1920 OUTS (outf
, " ++ ");
1921 OUTS (outf
, pregs (idx
));
1922 OUTS (outf
, "] = ");
1923 OUTS (outf
, dregs_lo (reg
));
1925 else if (aop
== 2 && W
== 1)
1928 OUTS (outf
, pregs (ptr
));
1929 OUTS (outf
, " ++ ");
1930 OUTS (outf
, pregs (idx
));
1931 OUTS (outf
, "] = ");
1932 OUTS (outf
, dregs_hi (reg
));
1941 decode_dagMODim_0 (TIword iw0
, disassemble_info
*outf
)
1944 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1945 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 |.br| 1 | 1 |.op|.m.....|.i.....|
1946 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1947 int i
= ((iw0
>> DagMODim_i_bits
) & DagMODim_i_mask
);
1948 int m
= ((iw0
>> DagMODim_m_bits
) & DagMODim_m_mask
);
1949 int br
= ((iw0
>> DagMODim_br_bits
) & DagMODim_br_mask
);
1950 int op
= ((iw0
>> DagMODim_op_bits
) & DagMODim_op_mask
);
1952 if (op
== 0 && br
== 1)
1954 OUTS (outf
, iregs (i
));
1955 OUTS (outf
, " += ");
1956 OUTS (outf
, mregs (m
));
1957 OUTS (outf
, " (BREV)");
1961 OUTS (outf
, iregs (i
));
1962 OUTS (outf
, " += ");
1963 OUTS (outf
, mregs (m
));
1967 OUTS (outf
, iregs (i
));
1968 OUTS (outf
, " -= ");
1969 OUTS (outf
, mregs (m
));
1978 decode_dagMODik_0 (TIword iw0
, disassemble_info
*outf
)
1981 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1982 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 0 |.op....|.i.....|
1983 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1984 int i
= ((iw0
>> DagMODik_i_bits
) & DagMODik_i_mask
);
1985 int op
= ((iw0
>> DagMODik_op_bits
) & DagMODik_op_mask
);
1989 OUTS (outf
, iregs (i
));
1990 OUTS (outf
, " += 0x2");
1994 OUTS (outf
, iregs (i
));
1995 OUTS (outf
, " -= 0x2");
1999 OUTS (outf
, iregs (i
));
2000 OUTS (outf
, " += 0x4");
2004 OUTS (outf
, iregs (i
));
2005 OUTS (outf
, " -= 0x4");
2012 OUTS (outf
, ";\t\t/* ( ");
2013 if (op
== 0 || op
== 1)
2015 else if (op
== 2 || op
== 3)
2017 OUTS (outf
, ") */");
2025 decode_dspLDST_0 (TIword iw0
, disassemble_info
*outf
)
2028 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2029 | 1 | 0 | 0 | 1 | 1 | 1 |.W.|.aop...|.m.....|.i.....|.reg.......|
2030 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2031 int i
= ((iw0
>> DspLDST_i_bits
) & DspLDST_i_mask
);
2032 int m
= ((iw0
>> DspLDST_m_bits
) & DspLDST_m_mask
);
2033 int W
= ((iw0
>> DspLDST_W_bits
) & DspLDST_W_mask
);
2034 int aop
= ((iw0
>> DspLDST_aop_bits
) & DspLDST_aop_mask
);
2035 int reg
= ((iw0
>> DspLDST_reg_bits
) & DspLDST_reg_mask
);
2037 if (aop
== 0 && W
== 0 && m
== 0)
2039 OUTS (outf
, dregs (reg
));
2040 OUTS (outf
, " = [");
2041 OUTS (outf
, iregs (i
));
2044 else if (aop
== 0 && W
== 0 && m
== 1)
2046 OUTS (outf
, dregs_lo (reg
));
2047 OUTS (outf
, " = W[");
2048 OUTS (outf
, iregs (i
));
2051 else if (aop
== 0 && W
== 0 && m
== 2)
2053 OUTS (outf
, dregs_hi (reg
));
2054 OUTS (outf
, " = W[");
2055 OUTS (outf
, iregs (i
));
2058 else if (aop
== 1 && W
== 0 && m
== 0)
2060 OUTS (outf
, dregs (reg
));
2061 OUTS (outf
, " = [");
2062 OUTS (outf
, iregs (i
));
2065 else if (aop
== 1 && W
== 0 && m
== 1)
2067 OUTS (outf
, dregs_lo (reg
));
2068 OUTS (outf
, " = W[");
2069 OUTS (outf
, iregs (i
));
2072 else if (aop
== 1 && W
== 0 && m
== 2)
2074 OUTS (outf
, dregs_hi (reg
));
2075 OUTS (outf
, " = W[");
2076 OUTS (outf
, iregs (i
));
2079 else if (aop
== 2 && W
== 0 && m
== 0)
2081 OUTS (outf
, dregs (reg
));
2082 OUTS (outf
, " = [");
2083 OUTS (outf
, iregs (i
));
2086 else if (aop
== 2 && W
== 0 && m
== 1)
2088 OUTS (outf
, dregs_lo (reg
));
2089 OUTS (outf
, " = W[");
2090 OUTS (outf
, iregs (i
));
2093 else if (aop
== 2 && W
== 0 && m
== 2)
2095 OUTS (outf
, dregs_hi (reg
));
2096 OUTS (outf
, " = W[");
2097 OUTS (outf
, iregs (i
));
2100 else if (aop
== 0 && W
== 1 && m
== 0)
2103 OUTS (outf
, iregs (i
));
2104 OUTS (outf
, "++] = ");
2105 OUTS (outf
, dregs (reg
));
2107 else if (aop
== 0 && W
== 1 && m
== 1)
2110 OUTS (outf
, iregs (i
));
2111 OUTS (outf
, "++] = ");
2112 OUTS (outf
, dregs_lo (reg
));
2114 else if (aop
== 0 && W
== 1 && m
== 2)
2117 OUTS (outf
, iregs (i
));
2118 OUTS (outf
, "++] = ");
2119 OUTS (outf
, dregs_hi (reg
));
2121 else if (aop
== 1 && W
== 1 && m
== 0)
2124 OUTS (outf
, iregs (i
));
2125 OUTS (outf
, "--] = ");
2126 OUTS (outf
, dregs (reg
));
2128 else if (aop
== 1 && W
== 1 && m
== 1)
2131 OUTS (outf
, iregs (i
));
2132 OUTS (outf
, "--] = ");
2133 OUTS (outf
, dregs_lo (reg
));
2135 else if (aop
== 1 && W
== 1 && m
== 2)
2138 OUTS (outf
, iregs (i
));
2139 OUTS (outf
, "--] = ");
2140 OUTS (outf
, dregs_hi (reg
));
2142 else if (aop
== 2 && W
== 1 && m
== 0)
2145 OUTS (outf
, iregs (i
));
2146 OUTS (outf
, "] = ");
2147 OUTS (outf
, dregs (reg
));
2149 else if (aop
== 2 && W
== 1 && m
== 1)
2152 OUTS (outf
, iregs (i
));
2153 OUTS (outf
, "] = ");
2154 OUTS (outf
, dregs_lo (reg
));
2156 else if (aop
== 2 && W
== 1 && m
== 2)
2159 OUTS (outf
, iregs (i
));
2160 OUTS (outf
, "] = ");
2161 OUTS (outf
, dregs_hi (reg
));
2163 else if (aop
== 3 && W
== 0)
2165 OUTS (outf
, dregs (reg
));
2166 OUTS (outf
, " = [");
2167 OUTS (outf
, iregs (i
));
2168 OUTS (outf
, " ++ ");
2169 OUTS (outf
, mregs (m
));
2172 else if (aop
== 3 && W
== 1)
2175 OUTS (outf
, iregs (i
));
2176 OUTS (outf
, " ++ ");
2177 OUTS (outf
, mregs (m
));
2178 OUTS (outf
, "] = ");
2179 OUTS (outf
, dregs (reg
));
2188 decode_LDST_0 (TIword iw0
, disassemble_info
*outf
)
2191 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2192 | 1 | 0 | 0 | 1 |.sz....|.W.|.aop...|.Z.|.ptr.......|.reg.......|
2193 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2194 int Z
= ((iw0
>> LDST_Z_bits
) & LDST_Z_mask
);
2195 int W
= ((iw0
>> LDST_W_bits
) & LDST_W_mask
);
2196 int sz
= ((iw0
>> LDST_sz_bits
) & LDST_sz_mask
);
2197 int aop
= ((iw0
>> LDST_aop_bits
) & LDST_aop_mask
);
2198 int reg
= ((iw0
>> LDST_reg_bits
) & LDST_reg_mask
);
2199 int ptr
= ((iw0
>> LDST_ptr_bits
) & LDST_ptr_mask
);
2201 if (aop
== 0 && sz
== 0 && Z
== 0 && W
== 0)
2203 OUTS (outf
, dregs (reg
));
2204 OUTS (outf
, " = [");
2205 OUTS (outf
, pregs (ptr
));
2208 else if (aop
== 0 && sz
== 0 && Z
== 1 && W
== 0)
2210 OUTS (outf
, pregs (reg
));
2211 OUTS (outf
, " = [");
2212 OUTS (outf
, pregs (ptr
));
2215 else if (aop
== 0 && sz
== 1 && Z
== 0 && W
== 0)
2217 OUTS (outf
, dregs (reg
));
2218 OUTS (outf
, " = W[");
2219 OUTS (outf
, pregs (ptr
));
2220 OUTS (outf
, "++] (Z)");
2222 else if (aop
== 0 && sz
== 1 && Z
== 1 && W
== 0)
2224 OUTS (outf
, dregs (reg
));
2225 OUTS (outf
, " = W[");
2226 OUTS (outf
, pregs (ptr
));
2227 OUTS (outf
, "++] (X)");
2229 else if (aop
== 0 && sz
== 2 && Z
== 0 && W
== 0)
2231 OUTS (outf
, dregs (reg
));
2232 OUTS (outf
, " = B[");
2233 OUTS (outf
, pregs (ptr
));
2234 OUTS (outf
, "++] (Z)");
2236 else if (aop
== 0 && sz
== 2 && Z
== 1 && W
== 0)
2238 OUTS (outf
, dregs (reg
));
2239 OUTS (outf
, " = B[");
2240 OUTS (outf
, pregs (ptr
));
2241 OUTS (outf
, "++] (X)");
2243 else if (aop
== 1 && sz
== 0 && Z
== 0 && W
== 0)
2245 OUTS (outf
, dregs (reg
));
2246 OUTS (outf
, " = [");
2247 OUTS (outf
, pregs (ptr
));
2250 else if (aop
== 1 && sz
== 0 && Z
== 1 && W
== 0)
2252 OUTS (outf
, pregs (reg
));
2253 OUTS (outf
, " = [");
2254 OUTS (outf
, pregs (ptr
));
2257 else if (aop
== 1 && sz
== 1 && Z
== 0 && W
== 0)
2259 OUTS (outf
, dregs (reg
));
2260 OUTS (outf
, " = W[");
2261 OUTS (outf
, pregs (ptr
));
2262 OUTS (outf
, "--] (Z)");
2264 else if (aop
== 1 && sz
== 1 && Z
== 1 && W
== 0)
2266 OUTS (outf
, dregs (reg
));
2267 OUTS (outf
, " = W[");
2268 OUTS (outf
, pregs (ptr
));
2269 OUTS (outf
, "--] (X)");
2271 else if (aop
== 1 && sz
== 2 && Z
== 0 && W
== 0)
2273 OUTS (outf
, dregs (reg
));
2274 OUTS (outf
, " = B[");
2275 OUTS (outf
, pregs (ptr
));
2276 OUTS (outf
, "--] (Z)");
2278 else if (aop
== 1 && sz
== 2 && Z
== 1 && W
== 0)
2280 OUTS (outf
, dregs (reg
));
2281 OUTS (outf
, " = B[");
2282 OUTS (outf
, pregs (ptr
));
2283 OUTS (outf
, "--] (X)");
2285 else if (aop
== 2 && sz
== 0 && Z
== 0 && W
== 0)
2287 OUTS (outf
, dregs (reg
));
2288 OUTS (outf
, " = [");
2289 OUTS (outf
, pregs (ptr
));
2292 else if (aop
== 2 && sz
== 0 && Z
== 1 && W
== 0)
2294 OUTS (outf
, pregs (reg
));
2295 OUTS (outf
, " = [");
2296 OUTS (outf
, pregs (ptr
));
2299 else if (aop
== 2 && sz
== 1 && Z
== 0 && W
== 0)
2301 OUTS (outf
, dregs (reg
));
2302 OUTS (outf
, " = W[");
2303 OUTS (outf
, pregs (ptr
));
2304 OUTS (outf
, "] (Z)");
2306 else if (aop
== 2 && sz
== 1 && Z
== 1 && W
== 0)
2308 OUTS (outf
, dregs (reg
));
2309 OUTS (outf
, " = W[");
2310 OUTS (outf
, pregs (ptr
));
2311 OUTS (outf
, "] (X)");
2313 else if (aop
== 2 && sz
== 2 && Z
== 0 && W
== 0)
2315 OUTS (outf
, dregs (reg
));
2316 OUTS (outf
, " = B[");
2317 OUTS (outf
, pregs (ptr
));
2318 OUTS (outf
, "] (Z)");
2320 else if (aop
== 2 && sz
== 2 && Z
== 1 && W
== 0)
2322 OUTS (outf
, dregs (reg
));
2323 OUTS (outf
, " = B[");
2324 OUTS (outf
, pregs (ptr
));
2325 OUTS (outf
, "] (X)");
2327 else if (aop
== 0 && sz
== 0 && Z
== 0 && W
== 1)
2330 OUTS (outf
, pregs (ptr
));
2331 OUTS (outf
, "++] = ");
2332 OUTS (outf
, dregs (reg
));
2334 else if (aop
== 0 && sz
== 0 && Z
== 1 && W
== 1)
2337 OUTS (outf
, pregs (ptr
));
2338 OUTS (outf
, "++] = ");
2339 OUTS (outf
, pregs (reg
));
2341 else if (aop
== 0 && sz
== 1 && Z
== 0 && W
== 1)
2344 OUTS (outf
, pregs (ptr
));
2345 OUTS (outf
, "++] = ");
2346 OUTS (outf
, dregs (reg
));
2348 else if (aop
== 0 && sz
== 2 && Z
== 0 && W
== 1)
2351 OUTS (outf
, pregs (ptr
));
2352 OUTS (outf
, "++] = ");
2353 OUTS (outf
, dregs (reg
));
2355 else if (aop
== 1 && sz
== 0 && Z
== 0 && W
== 1)
2358 OUTS (outf
, pregs (ptr
));
2359 OUTS (outf
, "--] = ");
2360 OUTS (outf
, dregs (reg
));
2362 else if (aop
== 1 && sz
== 0 && Z
== 1 && W
== 1)
2365 OUTS (outf
, pregs (ptr
));
2366 OUTS (outf
, "--] = ");
2367 OUTS (outf
, pregs (reg
));
2369 else if (aop
== 1 && sz
== 1 && Z
== 0 && W
== 1)
2372 OUTS (outf
, pregs (ptr
));
2373 OUTS (outf
, "--] = ");
2374 OUTS (outf
, dregs (reg
));
2376 else if (aop
== 1 && sz
== 2 && Z
== 0 && W
== 1)
2379 OUTS (outf
, pregs (ptr
));
2380 OUTS (outf
, "--] = ");
2381 OUTS (outf
, dregs (reg
));
2383 else if (aop
== 2 && sz
== 0 && Z
== 0 && W
== 1)
2386 OUTS (outf
, pregs (ptr
));
2387 OUTS (outf
, "] = ");
2388 OUTS (outf
, dregs (reg
));
2390 else if (aop
== 2 && sz
== 0 && Z
== 1 && W
== 1)
2393 OUTS (outf
, pregs (ptr
));
2394 OUTS (outf
, "] = ");
2395 OUTS (outf
, pregs (reg
));
2397 else if (aop
== 2 && sz
== 1 && Z
== 0 && W
== 1)
2400 OUTS (outf
, pregs (ptr
));
2401 OUTS (outf
, "] = ");
2402 OUTS (outf
, dregs (reg
));
2404 else if (aop
== 2 && sz
== 2 && Z
== 0 && W
== 1)
2407 OUTS (outf
, pregs (ptr
));
2408 OUTS (outf
, "] = ");
2409 OUTS (outf
, dregs (reg
));
2418 decode_LDSTiiFP_0 (TIword iw0
, disassemble_info
*outf
)
2421 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2422 | 1 | 0 | 1 | 1 | 1 | 0 |.W.|.offset............|.reg...........|
2423 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2424 int reg
= ((iw0
>> LDSTiiFP_reg_bits
) & LDSTiiFP_reg_mask
);
2425 int offset
= ((iw0
>> LDSTiiFP_offset_bits
) & LDSTiiFP_offset_mask
);
2426 int W
= ((iw0
>> LDSTiiFP_W_bits
) & LDSTiiFP_W_mask
);
2430 OUTS (outf
, dpregs (reg
));
2431 OUTS (outf
, " = [FP ");
2432 OUTS (outf
, negimm5s4 (offset
));
2437 OUTS (outf
, "[FP ");
2438 OUTS (outf
, negimm5s4 (offset
));
2439 OUTS (outf
, "] = ");
2440 OUTS (outf
, dpregs (reg
));
2449 decode_LDSTii_0 (TIword iw0
, disassemble_info
*outf
)
2452 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2453 | 1 | 0 | 1 |.W.|.op....|.offset........|.ptr.......|.reg.......|
2454 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2455 int reg
= ((iw0
>> LDSTii_reg_bit
) & LDSTii_reg_mask
);
2456 int ptr
= ((iw0
>> LDSTii_ptr_bit
) & LDSTii_ptr_mask
);
2457 int offset
= ((iw0
>> LDSTii_offset_bit
) & LDSTii_offset_mask
);
2458 int op
= ((iw0
>> LDSTii_op_bit
) & LDSTii_op_mask
);
2459 int W
= ((iw0
>> LDSTii_W_bit
) & LDSTii_W_mask
);
2461 if (W
== 0 && op
== 0)
2463 OUTS (outf
, dregs (reg
));
2464 OUTS (outf
, " = [");
2465 OUTS (outf
, pregs (ptr
));
2467 OUTS (outf
, uimm4s4 (offset
));
2470 else if (W
== 0 && op
== 1)
2472 OUTS (outf
, dregs (reg
));
2473 OUTS (outf
, " = W[");
2474 OUTS (outf
, pregs (ptr
));
2476 OUTS (outf
, uimm4s2 (offset
));
2477 OUTS (outf
, "] (Z)");
2479 else if (W
== 0 && op
== 2)
2481 OUTS (outf
, dregs (reg
));
2482 OUTS (outf
, " = W[");
2483 OUTS (outf
, pregs (ptr
));
2485 OUTS (outf
, uimm4s2 (offset
));
2486 OUTS (outf
, "] (X)");
2488 else if (W
== 0 && op
== 3)
2490 OUTS (outf
, pregs (reg
));
2491 OUTS (outf
, " = [");
2492 OUTS (outf
, pregs (ptr
));
2494 OUTS (outf
, uimm4s4 (offset
));
2497 else if (W
== 1 && op
== 0)
2500 OUTS (outf
, pregs (ptr
));
2502 OUTS (outf
, uimm4s4 (offset
));
2503 OUTS (outf
, "] = ");
2504 OUTS (outf
, dregs (reg
));
2506 else if (W
== 1 && op
== 1)
2509 OUTS (outf
, pregs (ptr
));
2511 OUTS (outf
, uimm4s2 (offset
));
2512 OUTS (outf
, "] = ");
2513 OUTS (outf
, dregs (reg
));
2515 else if (W
== 1 && op
== 3)
2518 OUTS (outf
, pregs (ptr
));
2520 OUTS (outf
, uimm4s4 (offset
));
2521 OUTS (outf
, "] = ");
2522 OUTS (outf
, pregs (reg
));
2531 decode_LoopSetup_0 (TIword iw0
, TIword iw1
, bfd_vma pc
, disassemble_info
*outf
)
2534 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2535 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 |.rop...|.c.|.soffset.......|
2536 |.reg...........| - | - |.eoffset...............................|
2537 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2538 int c
= ((iw0
>> (LoopSetup_c_bits
- 16)) & LoopSetup_c_mask
);
2539 int reg
= ((iw1
>> LoopSetup_reg_bits
) & LoopSetup_reg_mask
);
2540 int rop
= ((iw0
>> (LoopSetup_rop_bits
- 16)) & LoopSetup_rop_mask
);
2541 int soffset
= ((iw0
>> (LoopSetup_soffset_bits
- 16)) & LoopSetup_soffset_mask
);
2542 int eoffset
= ((iw1
>> LoopSetup_eoffset_bits
) & LoopSetup_eoffset_mask
);
2546 OUTS (outf
, "LSETUP");
2548 OUTS (outf
, pcrel4 (soffset
));
2549 OUTS (outf
, ", 0x");
2550 OUTS (outf
, lppcrel10 (eoffset
));
2552 OUTS (outf
, counters (c
));
2556 OUTS (outf
, "LSETUP");
2558 OUTS (outf
, pcrel4 (soffset
));
2559 OUTS (outf
, ", 0x");
2560 OUTS (outf
, lppcrel10 (eoffset
));
2562 OUTS (outf
, counters (c
));
2564 OUTS (outf
, pregs (reg
));
2568 OUTS (outf
, "LSETUP");
2570 OUTS (outf
, pcrel4 (soffset
));
2571 OUTS (outf
, ", 0x");
2572 OUTS (outf
, lppcrel10 (eoffset
));
2574 OUTS (outf
, counters (c
));
2576 OUTS (outf
, pregs (reg
));
2577 OUTS (outf
, " >> 0x1");
2586 decode_LDIMMhalf_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2589 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2590 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 |.Z.|.H.|.S.|.grp...|.reg.......|
2591 |.hword.........................................................|
2592 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2593 int H
= ((iw0
>> (LDIMMhalf_H_bits
- 16)) & LDIMMhalf_H_mask
);
2594 int Z
= ((iw0
>> (LDIMMhalf_Z_bits
- 16)) & LDIMMhalf_Z_mask
);
2595 int S
= ((iw0
>> (LDIMMhalf_S_bits
- 16)) & LDIMMhalf_S_mask
);
2596 int reg
= ((iw0
>> (LDIMMhalf_reg_bits
- 16)) & LDIMMhalf_reg_mask
);
2597 int grp
= ((iw0
>> (LDIMMhalf_grp_bits
- 16)) & LDIMMhalf_grp_mask
);
2598 int hword
= ((iw1
>> LDIMMhalf_hword_bits
) & LDIMMhalf_hword_mask
);
2600 bu32
*pval
= get_allreg (grp
, reg
);
2602 /* Since we don't have 32-bit immediate loads, we allow the disassembler
2603 to combine them, so it prints out the right values.
2604 Here we keep track of the registers. */
2605 if (H
== 0 && S
== 1 && Z
== 0)
2607 /* regs = imm16 (x) */
2608 *pval
= imm16_val (hword
);
2610 *pval
|= 0xFFFF0000;
2614 else if (H
== 0 && S
== 0 && Z
== 1)
2616 /* regs = luimm16 (Z) */
2617 *pval
= luimm16_val (hword
);
2620 else if (H
== 0 && S
== 0 && Z
== 0)
2622 /* regs_lo = luimm16 */
2623 *pval
&= 0xFFFF0000;
2624 *pval
|= luimm16_val (hword
);
2626 else if (H
== 1 && S
== 0 && Z
== 0)
2628 /* regs_hi = huimm16 */
2630 *pval
|= luimm16_val (hword
) << 16;
2633 /* Here we do the disassembly */
2634 if (grp
== 0 && H
== 0 && S
== 0 && Z
== 0)
2636 OUTS (outf
, dregs_lo (reg
));
2638 OUTS (outf
, uimm16 (hword
));
2640 else if (grp
== 0 && H
== 1 && S
== 0 && Z
== 0)
2642 OUTS (outf
, dregs_hi (reg
));
2644 OUTS (outf
, uimm16 (hword
));
2646 else if (grp
== 0 && H
== 0 && S
== 1 && Z
== 0)
2648 OUTS (outf
, dregs (reg
));
2650 OUTS (outf
, imm16 (hword
));
2651 OUTS (outf
, " (X)");
2653 else if (H
== 0 && S
== 1 && Z
== 0)
2655 OUTS (outf
, regs (reg
, grp
));
2657 OUTS (outf
, imm16 (hword
));
2658 OUTS (outf
, " (X)");
2660 else if (H
== 0 && S
== 0 && Z
== 1)
2662 OUTS (outf
, regs (reg
, grp
));
2664 OUTS (outf
, uimm16 (hword
));
2665 OUTS (outf
, " (Z)");
2667 else if (H
== 0 && S
== 0 && Z
== 0)
2669 OUTS (outf
, regs_lo (reg
, grp
));
2671 OUTS (outf
, uimm16 (hword
));
2673 else if (H
== 1 && S
== 0 && Z
== 0)
2675 OUTS (outf
, regs_hi (reg
, grp
));
2677 OUTS (outf
, uimm16 (hword
));
2682 /* And we print out the 32-bit value if it is a pointer. */
2683 if (S
== 0 && Z
== 0)
2685 OUTS (outf
, ";\t\t/* (");
2686 OUTS (outf
, imm16d (hword
));
2689 /* If it is an MMR, don't print the symbol. */
2690 if (*pval
< 0xFFC00000 && grp
== 1)
2692 OUTS (outf
, regs (reg
, grp
));
2694 OUTS (outf
, huimm32e (*pval
));
2698 OUTS (outf
, regs (reg
, grp
));
2700 OUTS (outf
, huimm32e (*pval
));
2702 OUTS (outf
, imm32 (*pval
));
2709 if (S
== 1 || Z
== 1)
2711 OUTS (outf
, ";\t\t/*\t\t");
2712 OUTS (outf
, regs (reg
, grp
));
2714 OUTS (outf
, huimm32e (*pval
));
2716 OUTS (outf
, imm32 (*pval
));
2717 OUTS (outf
, ") */");
2724 decode_CALLa_0 (TIword iw0
, TIword iw1
, bfd_vma pc
, disassemble_info
*outf
)
2727 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2728 | 1 | 1 | 1 | 0 | 0 | 0 | 1 |.S.|.msw...........................|
2729 |.lsw...........................................................|
2730 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2731 int S
= ((iw0
>> (CALLa_S_bits
- 16)) & CALLa_S_mask
);
2732 int lsw
= ((iw1
>> 0) & 0xffff);
2733 int msw
= ((iw0
>> 0) & 0xff);
2736 OUTS (outf
, "CALL 0x");
2738 OUTS (outf
, "JUMP.L 0x");
2742 OUTS (outf
, pcrel24 (((msw
) << 16) | (lsw
)));
2747 decode_LDSTidxI_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2750 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2751 | 1 | 1 | 1 | 0 | 0 | 1 |.W.|.Z.|.sz....|.ptr.......|.reg.......|
2752 |.offset........................................................|
2753 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2754 int Z
= ((iw0
>> (LDSTidxI_Z_bits
- 16)) & LDSTidxI_Z_mask
);
2755 int W
= ((iw0
>> (LDSTidxI_W_bits
- 16)) & LDSTidxI_W_mask
);
2756 int sz
= ((iw0
>> (LDSTidxI_sz_bits
- 16)) & LDSTidxI_sz_mask
);
2757 int reg
= ((iw0
>> (LDSTidxI_reg_bits
- 16)) & LDSTidxI_reg_mask
);
2758 int ptr
= ((iw0
>> (LDSTidxI_ptr_bits
- 16)) & LDSTidxI_ptr_mask
);
2759 int offset
= ((iw1
>> LDSTidxI_offset_bits
) & LDSTidxI_offset_mask
);
2761 if (W
== 0 && sz
== 0 && Z
== 0)
2763 OUTS (outf
, dregs (reg
));
2764 OUTS (outf
, " = [");
2765 OUTS (outf
, pregs (ptr
));
2767 OUTS (outf
, imm16s4 (offset
));
2770 else if (W
== 0 && sz
== 0 && Z
== 1)
2772 OUTS (outf
, pregs (reg
));
2773 OUTS (outf
, " = [");
2774 OUTS (outf
, pregs (ptr
));
2776 OUTS (outf
, imm16s4 (offset
));
2779 else if (W
== 0 && sz
== 1 && Z
== 0)
2781 OUTS (outf
, dregs (reg
));
2782 OUTS (outf
, " = W[");
2783 OUTS (outf
, pregs (ptr
));
2785 OUTS (outf
, imm16s2 (offset
));
2786 OUTS (outf
, "] (Z)");
2788 else if (W
== 0 && sz
== 1 && Z
== 1)
2790 OUTS (outf
, dregs (reg
));
2791 OUTS (outf
, " = W[");
2792 OUTS (outf
, pregs (ptr
));
2794 OUTS (outf
, imm16s2 (offset
));
2795 OUTS (outf
, "] (X)");
2797 else if (W
== 0 && sz
== 2 && Z
== 0)
2799 OUTS (outf
, dregs (reg
));
2800 OUTS (outf
, " = B[");
2801 OUTS (outf
, pregs (ptr
));
2803 OUTS (outf
, imm16 (offset
));
2804 OUTS (outf
, "] (Z)");
2806 else if (W
== 0 && sz
== 2 && Z
== 1)
2808 OUTS (outf
, dregs (reg
));
2809 OUTS (outf
, " = B[");
2810 OUTS (outf
, pregs (ptr
));
2812 OUTS (outf
, imm16 (offset
));
2813 OUTS (outf
, "] (X)");
2815 else if (W
== 1 && sz
== 0 && Z
== 0)
2818 OUTS (outf
, pregs (ptr
));
2820 OUTS (outf
, imm16s4 (offset
));
2821 OUTS (outf
, "] = ");
2822 OUTS (outf
, dregs (reg
));
2824 else if (W
== 1 && sz
== 0 && Z
== 1)
2827 OUTS (outf
, pregs (ptr
));
2829 OUTS (outf
, imm16s4 (offset
));
2830 OUTS (outf
, "] = ");
2831 OUTS (outf
, pregs (reg
));
2833 else if (W
== 1 && sz
== 1 && Z
== 0)
2836 OUTS (outf
, pregs (ptr
));
2838 OUTS (outf
, imm16s2 (offset
));
2839 OUTS (outf
, "] = ");
2840 OUTS (outf
, dregs (reg
));
2842 else if (W
== 1 && sz
== 2 && Z
== 0)
2845 OUTS (outf
, pregs (ptr
));
2847 OUTS (outf
, imm16 (offset
));
2848 OUTS (outf
, "] = ");
2849 OUTS (outf
, dregs (reg
));
2858 decode_linkage_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2861 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2862 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |.R.|
2863 |.framesize.....................................................|
2864 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2865 int R
= ((iw0
>> (Linkage_R_bits
- 16)) & Linkage_R_mask
);
2866 int framesize
= ((iw1
>> Linkage_framesize_bits
) & Linkage_framesize_mask
);
2870 OUTS (outf
, "LINK ");
2871 OUTS (outf
, uimm16s4 (framesize
));
2872 OUTS (outf
, ";\t\t/* (");
2873 OUTS (outf
, uimm16s4d (framesize
));
2874 OUTS (outf
, ") */");
2878 OUTS (outf
, "UNLINK");
2886 decode_dsp32mac_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2889 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2890 | 1 | 1 | 0 | 0 |.M.| 0 | 0 |.mmod..........|.MM|.P.|.w1|.op1...|
2891 |.h01|.h11|.w0|.op0...|.h00|.h10|.dst.......|.src0......|.src1..|
2892 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2893 int op1
= ((iw0
>> (DSP32Mac_op1_bits
- 16)) & DSP32Mac_op1_mask
);
2894 int w1
= ((iw0
>> (DSP32Mac_w1_bits
- 16)) & DSP32Mac_w1_mask
);
2895 int P
= ((iw0
>> (DSP32Mac_p_bits
- 16)) & DSP32Mac_p_mask
);
2896 int MM
= ((iw0
>> (DSP32Mac_MM_bits
- 16)) & DSP32Mac_MM_mask
);
2897 int mmod
= ((iw0
>> (DSP32Mac_mmod_bits
- 16)) & DSP32Mac_mmod_mask
);
2898 int w0
= ((iw1
>> DSP32Mac_w0_bits
) & DSP32Mac_w0_mask
);
2899 int src0
= ((iw1
>> DSP32Mac_src0_bits
) & DSP32Mac_src0_mask
);
2900 int src1
= ((iw1
>> DSP32Mac_src1_bits
) & DSP32Mac_src1_mask
);
2901 int dst
= ((iw1
>> DSP32Mac_dst_bits
) & DSP32Mac_dst_mask
);
2902 int h10
= ((iw1
>> DSP32Mac_h10_bits
) & DSP32Mac_h10_mask
);
2903 int h00
= ((iw1
>> DSP32Mac_h00_bits
) & DSP32Mac_h00_mask
);
2904 int op0
= ((iw1
>> DSP32Mac_op0_bits
) & DSP32Mac_op0_mask
);
2905 int h11
= ((iw1
>> DSP32Mac_h11_bits
) & DSP32Mac_h11_mask
);
2906 int h01
= ((iw1
>> DSP32Mac_h01_bits
) & DSP32Mac_h01_mask
);
2908 if (w0
== 0 && w1
== 0 && op1
== 3 && op0
== 3)
2914 if ((w1
|| w0
) && mmod
== M_W32
)
2917 if (((1 << mmod
) & (P
? 0x131b : 0x1b5f)) == 0)
2920 if (w1
== 1 || op1
!= 3)
2923 OUTS (outf
, P
? dregs (dst
+ 1) : dregs_hi (dst
));
2926 OUTS (outf
, " = A1");
2930 OUTS (outf
, " = (");
2931 decode_macfunc (1, op1
, h01
, h11
, src0
, src1
, outf
);
2936 if (w0
== 1 || op0
!= 3)
2939 OUTS (outf
, " (M)");
2945 if (w0
== 1 || op0
!= 3)
2948 OUTS (outf
, P
? dregs (dst
) : dregs_lo (dst
));
2951 OUTS (outf
, " = A0");
2955 OUTS (outf
, " = (");
2956 decode_macfunc (0, op0
, h00
, h10
, src0
, src1
, outf
);
2962 decode_optmode (mmod
, MM
, outf
);
2968 decode_dsp32mult_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2971 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2972 | 1 | 1 | 0 | 0 |.M.| 0 | 1 |.mmod..........|.MM|.P.|.w1|.op1...|
2973 |.h01|.h11|.w0|.op0...|.h00|.h10|.dst.......|.src0......|.src1..|
2974 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2975 int w1
= ((iw0
>> (DSP32Mac_w1_bits
- 16)) & DSP32Mac_w1_mask
);
2976 int P
= ((iw0
>> (DSP32Mac_p_bits
- 16)) & DSP32Mac_p_mask
);
2977 int MM
= ((iw0
>> (DSP32Mac_MM_bits
- 16)) & DSP32Mac_MM_mask
);
2978 int mmod
= ((iw0
>> (DSP32Mac_mmod_bits
- 16)) & DSP32Mac_mmod_mask
);
2979 int w0
= ((iw1
>> DSP32Mac_w0_bits
) & DSP32Mac_w0_mask
);
2980 int src0
= ((iw1
>> DSP32Mac_src0_bits
) & DSP32Mac_src0_mask
);
2981 int src1
= ((iw1
>> DSP32Mac_src1_bits
) & DSP32Mac_src1_mask
);
2982 int dst
= ((iw1
>> DSP32Mac_dst_bits
) & DSP32Mac_dst_mask
);
2983 int h10
= ((iw1
>> DSP32Mac_h10_bits
) & DSP32Mac_h10_mask
);
2984 int h00
= ((iw1
>> DSP32Mac_h00_bits
) & DSP32Mac_h00_mask
);
2985 int h11
= ((iw1
>> DSP32Mac_h11_bits
) & DSP32Mac_h11_mask
);
2986 int h01
= ((iw1
>> DSP32Mac_h01_bits
) & DSP32Mac_h01_mask
);
2988 if (w1
== 0 && w0
== 0)
2991 if (((1 << mmod
) & (P
? 0x313 : 0x1b57)) == 0)
2996 OUTS (outf
, P
? dregs (dst
| 1) : dregs_hi (dst
));
2998 decode_multfunc (h01
, h11
, src0
, src1
, outf
);
3003 OUTS (outf
, " (M)");
3011 OUTS (outf
, dregs (dst
));
3013 decode_multfunc (h00
, h10
, src0
, src1
, outf
);
3016 decode_optmode (mmod
, MM
, outf
);
3021 decode_dsp32alu_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
3024 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
3025 | 1 | 1 | 0 | 0 |.M.| 1 | 0 | - | - | - |.HL|.aopcde............|
3026 |.aop...|.s.|.x.|.dst0......|.dst1......|.src0......|.src1......|
3027 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
3028 int s
= ((iw1
>> DSP32Alu_s_bits
) & DSP32Alu_s_mask
);
3029 int x
= ((iw1
>> DSP32Alu_x_bits
) & DSP32Alu_x_mask
);
3030 int aop
= ((iw1
>> DSP32Alu_aop_bits
) & DSP32Alu_aop_mask
);
3031 int src0
= ((iw1
>> DSP32Alu_src0_bits
) & DSP32Alu_src0_mask
);
3032 int src1
= ((iw1
>> DSP32Alu_src1_bits
) & DSP32Alu_src1_mask
);
3033 int dst0
= ((iw1
>> DSP32Alu_dst0_bits
) & DSP32Alu_dst0_mask
);
3034 int dst1
= ((iw1
>> DSP32Alu_dst1_bits
) & DSP32Alu_dst1_mask
);
3035 int HL
= ((iw0
>> (DSP32Alu_HL_bits
- 16)) & DSP32Alu_HL_mask
);
3036 int aopcde
= ((iw0
>> (DSP32Alu_aopcde_bits
- 16)) & DSP32Alu_aopcde_mask
);
3038 if (aop
== 0 && aopcde
== 9 && HL
== 0 && s
== 0)
3040 OUTS (outf
, "A0.L = ");
3041 OUTS (outf
, dregs_lo (src0
));
3043 else if (aop
== 2 && aopcde
== 9 && HL
== 1 && s
== 0)
3045 OUTS (outf
, "A1.H = ");
3046 OUTS (outf
, dregs_hi (src0
));
3048 else if (aop
== 2 && aopcde
== 9 && HL
== 0 && s
== 0)
3050 OUTS (outf
, "A1.L = ");
3051 OUTS (outf
, dregs_lo (src0
));
3053 else if (aop
== 0 && aopcde
== 9 && HL
== 1 && s
== 0)
3055 OUTS (outf
, "A0.H = ");
3056 OUTS (outf
, dregs_hi (src0
));
3058 else if (x
== 1 && HL
== 1 && aop
== 3 && aopcde
== 5)
3060 OUTS (outf
, dregs_hi (dst0
));
3062 OUTS (outf
, dregs (src0
));
3064 OUTS (outf
, dregs (src1
));
3065 OUTS (outf
, " (RND20)");
3067 else if (x
== 1 && HL
== 1 && aop
== 2 && aopcde
== 5)
3069 OUTS (outf
, dregs_hi (dst0
));
3071 OUTS (outf
, dregs (src0
));
3073 OUTS (outf
, dregs (src1
));
3074 OUTS (outf
, " (RND20)");
3076 else if (x
== 0 && HL
== 0 && aop
== 1 && aopcde
== 5)
3078 OUTS (outf
, dregs_lo (dst0
));
3080 OUTS (outf
, dregs (src0
));
3082 OUTS (outf
, dregs (src1
));
3083 OUTS (outf
, " (RND12)");
3085 else if (x
== 0 && HL
== 0 && aop
== 0 && aopcde
== 5)
3087 OUTS (outf
, dregs_lo (dst0
));
3089 OUTS (outf
, dregs (src0
));
3091 OUTS (outf
, dregs (src1
));
3092 OUTS (outf
, " (RND12)");
3094 else if (x
== 1 && HL
== 0 && aop
== 3 && aopcde
== 5)
3096 OUTS (outf
, dregs_lo (dst0
));
3098 OUTS (outf
, dregs (src0
));
3100 OUTS (outf
, dregs (src1
));
3101 OUTS (outf
, " (RND20)");
3103 else if (x
== 0 && HL
== 1 && aop
== 0 && aopcde
== 5)
3105 OUTS (outf
, dregs_hi (dst0
));
3107 OUTS (outf
, dregs (src0
));
3109 OUTS (outf
, dregs (src1
));
3110 OUTS (outf
, " (RND12)");
3112 else if (x
== 1 && HL
== 0 && aop
== 2 && aopcde
== 5)
3114 OUTS (outf
, dregs_lo (dst0
));
3116 OUTS (outf
, dregs (src0
));
3118 OUTS (outf
, dregs (src1
));
3119 OUTS (outf
, " (RND20)");
3121 else if (x
== 0 && HL
== 1 && aop
== 1 && aopcde
== 5)
3123 OUTS (outf
, dregs_hi (dst0
));
3125 OUTS (outf
, dregs (src0
));
3127 OUTS (outf
, dregs (src1
));
3128 OUTS (outf
, " (RND12)");
3130 else if (HL
== 1 && aop
== 0 && aopcde
== 2)
3132 OUTS (outf
, dregs_hi (dst0
));
3134 OUTS (outf
, dregs_lo (src0
));
3136 OUTS (outf
, dregs_lo (src1
));
3139 else if (HL
== 1 && aop
== 1 && aopcde
== 2)
3141 OUTS (outf
, dregs_hi (dst0
));
3143 OUTS (outf
, dregs_lo (src0
));
3145 OUTS (outf
, dregs_hi (src1
));
3148 else if (HL
== 1 && aop
== 2 && aopcde
== 2)
3150 OUTS (outf
, dregs_hi (dst0
));
3152 OUTS (outf
, dregs_hi (src0
));
3154 OUTS (outf
, dregs_lo (src1
));
3157 else if (HL
== 1 && aop
== 3 && aopcde
== 2)
3159 OUTS (outf
, dregs_hi (dst0
));
3161 OUTS (outf
, dregs_hi (src0
));
3163 OUTS (outf
, dregs_hi (src1
));
3166 else if (HL
== 0 && aop
== 0 && aopcde
== 3)
3168 OUTS (outf
, dregs_lo (dst0
));
3170 OUTS (outf
, dregs_lo (src0
));
3172 OUTS (outf
, dregs_lo (src1
));
3175 else if (HL
== 0 && aop
== 1 && aopcde
== 3)
3177 OUTS (outf
, dregs_lo (dst0
));
3179 OUTS (outf
, dregs_lo (src0
));
3181 OUTS (outf
, dregs_hi (src1
));
3184 else if (HL
== 0 && aop
== 3 && aopcde
== 2)
3186 OUTS (outf
, dregs_lo (dst0
));
3188 OUTS (outf
, dregs_hi (src0
));
3190 OUTS (outf
, dregs_hi (src1
));
3193 else if (HL
== 1 && aop
== 0 && aopcde
== 3)
3195 OUTS (outf
, dregs_hi (dst0
));
3197 OUTS (outf
, dregs_lo (src0
));
3199 OUTS (outf
, dregs_lo (src1
));
3202 else if (HL
== 1 && aop
== 1 && aopcde
== 3)
3204 OUTS (outf
, dregs_hi (dst0
));
3206 OUTS (outf
, dregs_lo (src0
));
3208 OUTS (outf
, dregs_hi (src1
));
3211 else if (HL
== 1 && aop
== 2 && aopcde
== 3)
3213 OUTS (outf
, dregs_hi (dst0
));
3215 OUTS (outf
, dregs_hi (src0
));
3217 OUTS (outf
, dregs_lo (src1
));
3220 else if (HL
== 1 && aop
== 3 && aopcde
== 3)
3222 OUTS (outf
, dregs_hi (dst0
));
3224 OUTS (outf
, dregs_hi (src0
));
3226 OUTS (outf
, dregs_hi (src1
));
3229 else if (HL
== 0 && aop
== 2 && aopcde
== 2)
3231 OUTS (outf
, dregs_lo (dst0
));
3233 OUTS (outf
, dregs_hi (src0
));
3235 OUTS (outf
, dregs_lo (src1
));
3238 else if (HL
== 0 && aop
== 1 && aopcde
== 2)
3240 OUTS (outf
, dregs_lo (dst0
));
3242 OUTS (outf
, dregs_lo (src0
));
3244 OUTS (outf
, dregs_hi (src1
));
3247 else if (HL
== 0 && aop
== 2 && aopcde
== 3)
3249 OUTS (outf
, dregs_lo (dst0
));
3251 OUTS (outf
, dregs_hi (src0
));
3253 OUTS (outf
, dregs_lo (src1
));
3256 else if (HL
== 0 && aop
== 3 && aopcde
== 3)
3258 OUTS (outf
, dregs_lo (dst0
));
3260 OUTS (outf
, dregs_hi (src0
));
3262 OUTS (outf
, dregs_hi (src1
));
3265 else if (HL
== 0 && aop
== 0 && aopcde
== 2)
3267 OUTS (outf
, dregs_lo (dst0
));
3269 OUTS (outf
, dregs_lo (src0
));
3271 OUTS (outf
, dregs_lo (src1
));
3274 else if (aop
== 0 && aopcde
== 9 && s
== 1)
3276 OUTS (outf
, "A0 = ");
3277 OUTS (outf
, dregs (src0
));
3279 else if (aop
== 3 && aopcde
== 11 && s
== 0)
3280 OUTS (outf
, "A0 -= A1");
3282 else if (aop
== 3 && aopcde
== 11 && s
== 1)
3283 OUTS (outf
, "A0 -= A1 (W32)");
3285 else if (aop
== 3 && aopcde
== 22 && HL
== 1)
3287 OUTS (outf
, dregs (dst0
));
3288 OUTS (outf
, " = BYTEOP2M (");
3289 OUTS (outf
, dregs (src0
+ 1));
3291 OUTS (outf
, imm5 (src0
));
3293 OUTS (outf
, dregs (src1
+ 1));
3295 OUTS (outf
, imm5 (src1
));
3296 OUTS (outf
, ") (TH");
3298 OUTS (outf
, ", R)");
3302 else if (aop
== 3 && aopcde
== 22 && HL
== 0)
3304 OUTS (outf
, dregs (dst0
));
3305 OUTS (outf
, " = BYTEOP2M (");
3306 OUTS (outf
, dregs (src0
+ 1));
3308 OUTS (outf
, imm5 (src0
));
3310 OUTS (outf
, dregs (src1
+ 1));
3312 OUTS (outf
, imm5 (src1
));
3313 OUTS (outf
, ") (TL");
3315 OUTS (outf
, ", R)");
3319 else if (aop
== 2 && aopcde
== 22 && HL
== 1)
3321 OUTS (outf
, dregs (dst0
));
3322 OUTS (outf
, " = BYTEOP2M (");
3323 OUTS (outf
, dregs (src0
+ 1));
3325 OUTS (outf
, imm5 (src0
));
3327 OUTS (outf
, dregs (src1
+ 1));
3329 OUTS (outf
, imm5 (src1
));
3330 OUTS (outf
, ") (RNDH");
3332 OUTS (outf
, ", R)");
3336 else if (aop
== 2 && aopcde
== 22 && HL
== 0)
3338 OUTS (outf
, dregs (dst0
));
3339 OUTS (outf
, " = BYTEOP2M (");
3340 OUTS (outf
, dregs (src0
+ 1));
3342 OUTS (outf
, imm5 (src0
));
3344 OUTS (outf
, dregs (src1
+ 1));
3346 OUTS (outf
, imm5 (src1
));
3347 OUTS (outf
, ") (RNDL");
3349 OUTS (outf
, ", R)");
3353 else if (aop
== 1 && aopcde
== 22 && HL
== 1)
3355 OUTS (outf
, dregs (dst0
));
3356 OUTS (outf
, " = BYTEOP2P (");
3357 OUTS (outf
, dregs (src0
+ 1));
3359 OUTS (outf
, imm5d (src0
));
3361 OUTS (outf
, dregs (src1
+ 1));
3363 OUTS (outf
, imm5d (src1
));
3364 OUTS (outf
, ") (TH");
3366 OUTS (outf
, ", R)");
3370 else if (aop
== 1 && aopcde
== 22 && HL
== 0)
3372 OUTS (outf
, dregs (dst0
));
3373 OUTS (outf
, " = BYTEOP2P (");
3374 OUTS (outf
, dregs (src0
+ 1));
3376 OUTS (outf
, imm5d (src0
));
3378 OUTS (outf
, dregs (src1
+ 1));
3380 OUTS (outf
, imm5d (src1
));
3381 OUTS (outf
, ") (TL");
3383 OUTS (outf
, ", R)");
3387 else if (aop
== 0 && aopcde
== 22 && HL
== 1)
3389 OUTS (outf
, dregs (dst0
));
3390 OUTS (outf
, " = BYTEOP2P (");
3391 OUTS (outf
, dregs (src0
+ 1));
3393 OUTS (outf
, imm5d (src0
));
3395 OUTS (outf
, dregs (src1
+ 1));
3397 OUTS (outf
, imm5d (src1
));
3398 OUTS (outf
, ") (RNDH");
3400 OUTS (outf
, ", R)");
3404 else if (aop
== 0 && aopcde
== 22 && HL
== 0)
3406 OUTS (outf
, dregs (dst0
));
3407 OUTS (outf
, " = BYTEOP2P (");
3408 OUTS (outf
, dregs (src0
+ 1));
3410 OUTS (outf
, imm5d (src0
));
3412 OUTS (outf
, dregs (src1
+ 1));
3414 OUTS (outf
, imm5d (src1
));
3415 OUTS (outf
, ") (RNDL");
3417 OUTS (outf
, ", R)");
3421 else if (aop
== 0 && s
== 0 && aopcde
== 8)
3422 OUTS (outf
, "A0 = 0");
3424 else if (aop
== 0 && s
== 1 && aopcde
== 8)
3425 OUTS (outf
, "A0 = A0 (S)");
3427 else if (aop
== 1 && s
== 0 && aopcde
== 8)
3428 OUTS (outf
, "A1 = 0");
3430 else if (aop
== 1 && s
== 1 && aopcde
== 8)
3431 OUTS (outf
, "A1 = A1 (S)");
3433 else if (aop
== 2 && s
== 0 && aopcde
== 8)
3434 OUTS (outf
, "A1 = A0 = 0");
3436 else if (aop
== 2 && s
== 1 && aopcde
== 8)
3437 OUTS (outf
, "A1 = A1 (S), A0 = A0 (S)");
3439 else if (aop
== 3 && s
== 0 && aopcde
== 8)
3440 OUTS (outf
, "A0 = A1");
3442 else if (aop
== 3 && s
== 1 && aopcde
== 8)
3443 OUTS (outf
, "A1 = A0");
3445 else if (aop
== 1 && aopcde
== 9 && s
== 0)
3447 OUTS (outf
, "A0.X = ");
3448 OUTS (outf
, dregs_lo (src0
));
3450 else if (aop
== 1 && HL
== 0 && aopcde
== 11)
3452 OUTS (outf
, dregs_lo (dst0
));
3453 OUTS (outf
, " = (A0 += A1)");
3455 else if (aop
== 3 && HL
== 0 && aopcde
== 16)
3456 OUTS (outf
, "A1 = ABS A0, A0 = ABS A0");
3458 else if (aop
== 0 && aopcde
== 23 && HL
== 1)
3460 OUTS (outf
, dregs (dst0
));
3461 OUTS (outf
, " = BYTEOP3P (");
3462 OUTS (outf
, dregs (src0
+ 1));
3464 OUTS (outf
, imm5d (src0
));
3466 OUTS (outf
, dregs (src1
+ 1));
3468 OUTS (outf
, imm5d (src1
));
3469 OUTS (outf
, ") (HI");
3471 OUTS (outf
, ", R)");
3475 else if (aop
== 3 && aopcde
== 9 && s
== 0)
3477 OUTS (outf
, "A1.X = ");
3478 OUTS (outf
, dregs_lo (src0
));
3480 else if (aop
== 1 && HL
== 1 && aopcde
== 16)
3481 OUTS (outf
, "A1 = ABS A1");
3483 else if (aop
== 0 && HL
== 1 && aopcde
== 16)
3484 OUTS (outf
, "A1 = ABS A0");
3486 else if (aop
== 2 && aopcde
== 9 && s
== 1)
3488 OUTS (outf
, "A1 = ");
3489 OUTS (outf
, dregs (src0
));
3491 else if (HL
== 0 && aop
== 3 && aopcde
== 12)
3493 OUTS (outf
, dregs_lo (dst0
));
3495 OUTS (outf
, dregs (src0
));
3496 OUTS (outf
, " (RND)");
3498 else if (aop
== 1 && HL
== 0 && aopcde
== 16)
3499 OUTS (outf
, "A0 = ABS A1");
3501 else if (aop
== 0 && HL
== 0 && aopcde
== 16)
3502 OUTS (outf
, "A0 = ABS A0");
3504 else if (aop
== 3 && HL
== 0 && aopcde
== 15)
3506 OUTS (outf
, dregs (dst0
));
3507 OUTS (outf
, " = -");
3508 OUTS (outf
, dregs (src0
));
3509 OUTS (outf
, " (V)");
3511 else if (aop
== 3 && s
== 1 && HL
== 0 && aopcde
== 7)
3513 OUTS (outf
, dregs (dst0
));
3514 OUTS (outf
, " = -");
3515 OUTS (outf
, dregs (src0
));
3516 OUTS (outf
, " (S)");
3518 else if (aop
== 3 && s
== 0 && HL
== 0 && aopcde
== 7)
3520 OUTS (outf
, dregs (dst0
));
3521 OUTS (outf
, " = -");
3522 OUTS (outf
, dregs (src0
));
3523 OUTS (outf
, " (NS)");
3525 else if (aop
== 1 && HL
== 1 && aopcde
== 11)
3527 OUTS (outf
, dregs_hi (dst0
));
3528 OUTS (outf
, " = (A0 += A1)");
3530 else if (aop
== 2 && aopcde
== 11 && s
== 0)
3531 OUTS (outf
, "A0 += A1");
3533 else if (aop
== 2 && aopcde
== 11 && s
== 1)
3534 OUTS (outf
, "A0 += A1 (W32)");
3536 else if (aop
== 3 && HL
== 0 && aopcde
== 14)
3537 OUTS (outf
, "A1 = -A1, A0 = -A0");
3539 else if (HL
== 1 && aop
== 3 && aopcde
== 12)
3541 OUTS (outf
, dregs_hi (dst0
));
3543 OUTS (outf
, dregs (src0
));
3544 OUTS (outf
, " (RND)");
3546 else if (aop
== 0 && aopcde
== 23 && HL
== 0)
3548 OUTS (outf
, dregs (dst0
));
3549 OUTS (outf
, " = BYTEOP3P (");
3550 OUTS (outf
, dregs (src0
+ 1));
3552 OUTS (outf
, imm5d (src0
));
3554 OUTS (outf
, dregs (src1
+ 1));
3556 OUTS (outf
, imm5d (src1
));
3557 OUTS (outf
, ") (LO");
3559 OUTS (outf
, ", R)");
3563 else if (aop
== 0 && HL
== 0 && aopcde
== 14)
3564 OUTS (outf
, "A0 = -A0");
3566 else if (aop
== 1 && HL
== 0 && aopcde
== 14)
3567 OUTS (outf
, "A0 = -A1");
3569 else if (aop
== 0 && HL
== 1 && aopcde
== 14)
3570 OUTS (outf
, "A1 = -A0");
3572 else if (aop
== 1 && HL
== 1 && aopcde
== 14)
3573 OUTS (outf
, "A1 = -A1");
3575 else if (aop
== 0 && aopcde
== 12)
3577 OUTS (outf
, dregs_hi (dst0
));
3579 OUTS (outf
, dregs_lo (dst0
));
3580 OUTS (outf
, " = SIGN (");
3581 OUTS (outf
, dregs_hi (src0
));
3582 OUTS (outf
, ") * ");
3583 OUTS (outf
, dregs_hi (src1
));
3584 OUTS (outf
, " + SIGN (");
3585 OUTS (outf
, dregs_lo (src0
));
3586 OUTS (outf
, ") * ");
3587 OUTS (outf
, dregs_lo (src1
));
3589 else if (aop
== 2 && aopcde
== 0)
3591 OUTS (outf
, dregs (dst0
));
3593 OUTS (outf
, dregs (src0
));
3594 OUTS (outf
, " -|+ ");
3595 OUTS (outf
, dregs (src1
));
3598 else if (aop
== 1 && aopcde
== 12)
3600 OUTS (outf
, dregs (dst1
));
3601 OUTS (outf
, " = A1.L + A1.H, ");
3602 OUTS (outf
, dregs (dst0
));
3603 OUTS (outf
, " = A0.L + A0.H");
3605 else if (aop
== 2 && aopcde
== 4)
3607 OUTS (outf
, dregs (dst1
));
3609 OUTS (outf
, dregs (src0
));
3611 OUTS (outf
, dregs (src1
));
3613 OUTS (outf
, dregs (dst0
));
3615 OUTS (outf
, dregs (src0
));
3617 OUTS (outf
, dregs (src1
));
3620 else if (HL
== 0 && aopcde
== 1)
3622 OUTS (outf
, dregs (dst1
));
3624 OUTS (outf
, dregs (src0
));
3625 OUTS (outf
, " +|+ ");
3626 OUTS (outf
, dregs (src1
));
3628 OUTS (outf
, dregs (dst0
));
3630 OUTS (outf
, dregs (src0
));
3631 OUTS (outf
, " -|- ");
3632 OUTS (outf
, dregs (src1
));
3633 amod0amod2 (s
, x
, aop
, outf
);
3635 else if (aop
== 0 && aopcde
== 11)
3637 OUTS (outf
, dregs (dst0
));
3638 OUTS (outf
, " = (A0 += A1)");
3640 else if (aop
== 0 && aopcde
== 10)
3642 OUTS (outf
, dregs_lo (dst0
));
3643 OUTS (outf
, " = A0.X");
3645 else if (aop
== 1 && aopcde
== 10)
3647 OUTS (outf
, dregs_lo (dst0
));
3648 OUTS (outf
, " = A1.X");
3650 else if (aop
== 1 && aopcde
== 0)
3652 OUTS (outf
, dregs (dst0
));
3654 OUTS (outf
, dregs (src0
));
3655 OUTS (outf
, " +|- ");
3656 OUTS (outf
, dregs (src1
));
3659 else if (aop
== 3 && aopcde
== 0)
3661 OUTS (outf
, dregs (dst0
));
3663 OUTS (outf
, dregs (src0
));
3664 OUTS (outf
, " -|- ");
3665 OUTS (outf
, dregs (src1
));
3668 else if (aop
== 1 && aopcde
== 4)
3670 OUTS (outf
, dregs (dst0
));
3672 OUTS (outf
, dregs (src0
));
3674 OUTS (outf
, dregs (src1
));
3677 else if (aop
== 0 && aopcde
== 17)
3679 OUTS (outf
, dregs (dst1
));
3680 OUTS (outf
, " = A1 + A0, ");
3681 OUTS (outf
, dregs (dst0
));
3682 OUTS (outf
, " = A1 - A0");
3685 else if (aop
== 1 && aopcde
== 17)
3687 OUTS (outf
, dregs (dst1
));
3688 OUTS (outf
, " = A0 + A1, ");
3689 OUTS (outf
, dregs (dst0
));
3690 OUTS (outf
, " = A0 - A1");
3693 else if (aop
== 0 && aopcde
== 18)
3695 OUTS (outf
, "SAA (");
3696 OUTS (outf
, dregs (src0
+ 1));
3698 OUTS (outf
, imm5d (src0
));
3700 OUTS (outf
, dregs (src1
+ 1));
3702 OUTS (outf
, imm5d (src1
));
3706 else if (aop
== 3 && aopcde
== 18)
3707 OUTS (outf
, "DISALGNEXCPT");
3709 else if (aop
== 0 && aopcde
== 20)
3711 OUTS (outf
, dregs (dst0
));
3712 OUTS (outf
, " = BYTEOP1P (");
3713 OUTS (outf
, dregs (src0
+ 1));
3715 OUTS (outf
, imm5d (src0
));
3717 OUTS (outf
, dregs (src1
+ 1));
3719 OUTS (outf
, imm5d (src1
));
3723 else if (aop
== 1 && aopcde
== 20)
3725 OUTS (outf
, dregs (dst0
));
3726 OUTS (outf
, " = BYTEOP1P (");
3727 OUTS (outf
, dregs (src0
+ 1));
3729 OUTS (outf
, imm5d (src0
));
3731 OUTS (outf
, dregs (src1
+ 1));
3733 OUTS (outf
, imm5d (src1
));
3734 OUTS (outf
, ") (T");
3736 OUTS (outf
, ", R)");
3740 else if (aop
== 0 && aopcde
== 21)
3743 OUTS (outf
, dregs (dst1
));
3745 OUTS (outf
, dregs (dst0
));
3746 OUTS (outf
, ") = BYTEOP16P (");
3747 OUTS (outf
, dregs (src0
+ 1));
3749 OUTS (outf
, imm5d (src0
));
3751 OUTS (outf
, dregs (src1
+ 1));
3753 OUTS (outf
, imm5d (src1
));
3757 else if (aop
== 1 && aopcde
== 21)
3760 OUTS (outf
, dregs (dst1
));
3762 OUTS (outf
, dregs (dst0
));
3763 OUTS (outf
, ") = BYTEOP16M (");
3764 OUTS (outf
, dregs (src0
+ 1));
3766 OUTS (outf
, imm5d (src0
));
3768 OUTS (outf
, dregs (src1
+ 1));
3770 OUTS (outf
, imm5d (src1
));
3774 else if (aop
== 2 && aopcde
== 7)
3776 OUTS (outf
, dregs (dst0
));
3777 OUTS (outf
, " = ABS ");
3778 OUTS (outf
, dregs (src0
));
3780 else if (aop
== 1 && aopcde
== 7)
3782 OUTS (outf
, dregs (dst0
));
3783 OUTS (outf
, " = MIN (");
3784 OUTS (outf
, dregs (src0
));
3786 OUTS (outf
, dregs (src1
));
3789 else if (aop
== 0 && aopcde
== 7)
3791 OUTS (outf
, dregs (dst0
));
3792 OUTS (outf
, " = MAX (");
3793 OUTS (outf
, dregs (src0
));
3795 OUTS (outf
, dregs (src1
));
3798 else if (aop
== 2 && aopcde
== 6)
3800 OUTS (outf
, dregs (dst0
));
3801 OUTS (outf
, " = ABS ");
3802 OUTS (outf
, dregs (src0
));
3803 OUTS (outf
, " (V)");
3805 else if (aop
== 1 && aopcde
== 6)
3807 OUTS (outf
, dregs (dst0
));
3808 OUTS (outf
, " = MIN (");
3809 OUTS (outf
, dregs (src0
));
3811 OUTS (outf
, dregs (src1
));
3812 OUTS (outf
, ") (V)");
3814 else if (aop
== 0 && aopcde
== 6)
3816 OUTS (outf
, dregs (dst0
));
3817 OUTS (outf
, " = MAX (");
3818 OUTS (outf
, dregs (src0
));
3820 OUTS (outf
, dregs (src1
));
3821 OUTS (outf
, ") (V)");
3823 else if (HL
== 1 && aopcde
== 1)
3825 OUTS (outf
, dregs (dst1
));
3827 OUTS (outf
, dregs (src0
));
3828 OUTS (outf
, " +|- ");
3829 OUTS (outf
, dregs (src1
));
3831 OUTS (outf
, dregs (dst0
));
3833 OUTS (outf
, dregs (src0
));
3834 OUTS (outf
, " -|+ ");
3835 OUTS (outf
, dregs (src1
));
3836 amod0amod2 (s
, x
, aop
, outf
);
3838 else if (aop
== 0 && aopcde
== 4)
3840 OUTS (outf
, dregs (dst0
));
3842 OUTS (outf
, dregs (src0
));
3844 OUTS (outf
, dregs (src1
));
3847 else if (aop
== 0 && aopcde
== 0)
3849 OUTS (outf
, dregs (dst0
));
3851 OUTS (outf
, dregs (src0
));
3852 OUTS (outf
, " +|+ ");
3853 OUTS (outf
, dregs (src1
));
3856 else if (aop
== 0 && aopcde
== 24)
3858 OUTS (outf
, dregs (dst0
));
3859 OUTS (outf
, " = BYTEPACK (");
3860 OUTS (outf
, dregs (src0
));
3862 OUTS (outf
, dregs (src1
));
3865 else if (aop
== 1 && aopcde
== 24)
3868 OUTS (outf
, dregs (dst1
));
3870 OUTS (outf
, dregs (dst0
));
3871 OUTS (outf
, ") = BYTEUNPACK ");
3872 OUTS (outf
, dregs (src0
+ 1));
3874 OUTS (outf
, imm5d (src0
));
3877 else if (aopcde
== 13)
3880 OUTS (outf
, dregs (dst1
));
3882 OUTS (outf
, dregs (dst0
));
3883 OUTS (outf
, ") = SEARCH ");
3884 OUTS (outf
, dregs (src0
));
3886 searchmod (aop
, outf
);
3896 decode_dsp32shift_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
3899 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
3900 | 1 | 1 | 0 | 0 |.M.| 1 | 1 | 0 | 0 | - | - |.sopcde............|
3901 |.sop...|.HLs...|.dst0......| - | - | - |.src0......|.src1......|
3902 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
3903 int HLs
= ((iw1
>> DSP32Shift_HLs_bits
) & DSP32Shift_HLs_mask
);
3904 int sop
= ((iw1
>> DSP32Shift_sop_bits
) & DSP32Shift_sop_mask
);
3905 int src0
= ((iw1
>> DSP32Shift_src0_bits
) & DSP32Shift_src0_mask
);
3906 int src1
= ((iw1
>> DSP32Shift_src1_bits
) & DSP32Shift_src1_mask
);
3907 int dst0
= ((iw1
>> DSP32Shift_dst0_bits
) & DSP32Shift_dst0_mask
);
3908 int sopcde
= ((iw0
>> (DSP32Shift_sopcde_bits
- 16)) & DSP32Shift_sopcde_mask
);
3909 const char *acc01
= (HLs
& 1) == 0 ? "A0" : "A1";
3911 if (HLs
== 0 && sop
== 0 && sopcde
== 0)
3913 OUTS (outf
, dregs_lo (dst0
));
3914 OUTS (outf
, " = ASHIFT ");
3915 OUTS (outf
, dregs_lo (src1
));
3916 OUTS (outf
, " BY ");
3917 OUTS (outf
, dregs_lo (src0
));
3919 else if (HLs
== 1 && sop
== 0 && sopcde
== 0)
3921 OUTS (outf
, dregs_lo (dst0
));
3922 OUTS (outf
, " = ASHIFT ");
3923 OUTS (outf
, dregs_hi (src1
));
3924 OUTS (outf
, " BY ");
3925 OUTS (outf
, dregs_lo (src0
));
3927 else if (HLs
== 2 && sop
== 0 && sopcde
== 0)
3929 OUTS (outf
, dregs_hi (dst0
));
3930 OUTS (outf
, " = ASHIFT ");
3931 OUTS (outf
, dregs_lo (src1
));
3932 OUTS (outf
, " BY ");
3933 OUTS (outf
, dregs_lo (src0
));
3935 else if (HLs
== 3 && sop
== 0 && sopcde
== 0)
3937 OUTS (outf
, dregs_hi (dst0
));
3938 OUTS (outf
, " = ASHIFT ");
3939 OUTS (outf
, dregs_hi (src1
));
3940 OUTS (outf
, " BY ");
3941 OUTS (outf
, dregs_lo (src0
));
3943 else if (HLs
== 0 && sop
== 1 && sopcde
== 0)
3945 OUTS (outf
, dregs_lo (dst0
));
3946 OUTS (outf
, " = ASHIFT ");
3947 OUTS (outf
, dregs_lo (src1
));
3948 OUTS (outf
, " BY ");
3949 OUTS (outf
, dregs_lo (src0
));
3950 OUTS (outf
, " (S)");
3952 else if (HLs
== 1 && sop
== 1 && sopcde
== 0)
3954 OUTS (outf
, dregs_lo (dst0
));
3955 OUTS (outf
, " = ASHIFT ");
3956 OUTS (outf
, dregs_hi (src1
));
3957 OUTS (outf
, " BY ");
3958 OUTS (outf
, dregs_lo (src0
));
3959 OUTS (outf
, " (S)");
3961 else if (HLs
== 2 && sop
== 1 && sopcde
== 0)
3963 OUTS (outf
, dregs_hi (dst0
));
3964 OUTS (outf
, " = ASHIFT ");
3965 OUTS (outf
, dregs_lo (src1
));
3966 OUTS (outf
, " BY ");
3967 OUTS (outf
, dregs_lo (src0
));
3968 OUTS (outf
, " (S)");
3970 else if (HLs
== 3 && sop
== 1 && sopcde
== 0)
3972 OUTS (outf
, dregs_hi (dst0
));
3973 OUTS (outf
, " = ASHIFT ");
3974 OUTS (outf
, dregs_hi (src1
));
3975 OUTS (outf
, " BY ");
3976 OUTS (outf
, dregs_lo (src0
));
3977 OUTS (outf
, " (S)");
3979 else if (sop
== 2 && sopcde
== 0)
3981 OUTS (outf
, (HLs
& 2) == 0 ? dregs_lo (dst0
) : dregs_hi (dst0
));
3982 OUTS (outf
, " = LSHIFT ");
3983 OUTS (outf
, (HLs
& 1) == 0 ? dregs_lo (src1
) : dregs_hi (src1
));
3984 OUTS (outf
, " BY ");
3985 OUTS (outf
, dregs_lo (src0
));
3987 else if (sop
== 0 && sopcde
== 3)
3990 OUTS (outf
, " = ASHIFT ");
3992 OUTS (outf
, " BY ");
3993 OUTS (outf
, dregs_lo (src0
));
3995 else if (sop
== 1 && sopcde
== 3)
3998 OUTS (outf
, " = LSHIFT ");
4000 OUTS (outf
, " BY ");
4001 OUTS (outf
, dregs_lo (src0
));
4003 else if (sop
== 2 && sopcde
== 3)
4006 OUTS (outf
, " = ROT ");
4008 OUTS (outf
, " BY ");
4009 OUTS (outf
, dregs_lo (src0
));
4011 else if (sop
== 3 && sopcde
== 3)
4013 OUTS (outf
, dregs (dst0
));
4014 OUTS (outf
, " = ROT ");
4015 OUTS (outf
, dregs (src1
));
4016 OUTS (outf
, " BY ");
4017 OUTS (outf
, dregs_lo (src0
));
4019 else if (sop
== 1 && sopcde
== 1)
4021 OUTS (outf
, dregs (dst0
));
4022 OUTS (outf
, " = ASHIFT ");
4023 OUTS (outf
, dregs (src1
));
4024 OUTS (outf
, " BY ");
4025 OUTS (outf
, dregs_lo (src0
));
4026 OUTS (outf
, " (V, S)");
4028 else if (sop
== 0 && sopcde
== 1)
4030 OUTS (outf
, dregs (dst0
));
4031 OUTS (outf
, " = ASHIFT ");
4032 OUTS (outf
, dregs (src1
));
4033 OUTS (outf
, " BY ");
4034 OUTS (outf
, dregs_lo (src0
));
4035 OUTS (outf
, " (V)");
4037 else if (sop
== 0 && sopcde
== 2)
4039 OUTS (outf
, dregs (dst0
));
4040 OUTS (outf
, " = ASHIFT ");
4041 OUTS (outf
, dregs (src1
));
4042 OUTS (outf
, " BY ");
4043 OUTS (outf
, dregs_lo (src0
));
4045 else if (sop
== 1 && sopcde
== 2)
4047 OUTS (outf
, dregs (dst0
));
4048 OUTS (outf
, " = ASHIFT ");
4049 OUTS (outf
, dregs (src1
));
4050 OUTS (outf
, " BY ");
4051 OUTS (outf
, dregs_lo (src0
));
4052 OUTS (outf
, " (S)");
4054 else if (sop
== 2 && sopcde
== 2)
4056 OUTS (outf
, dregs (dst0
));
4057 OUTS (outf
, " = LSHIFT ");
4058 OUTS (outf
, dregs (src1
));
4059 OUTS (outf
, " BY ");
4060 OUTS (outf
, dregs_lo (src0
));
4062 else if (sop
== 3 && sopcde
== 2)
4064 OUTS (outf
, dregs (dst0
));
4065 OUTS (outf
, " = ROT ");
4066 OUTS (outf
, dregs (src1
));
4067 OUTS (outf
, " BY ");
4068 OUTS (outf
, dregs_lo (src0
));
4070 else if (sop
== 2 && sopcde
== 1)
4072 OUTS (outf
, dregs (dst0
));
4073 OUTS (outf
, " = LSHIFT ");
4074 OUTS (outf
, dregs (src1
));
4075 OUTS (outf
, " BY ");
4076 OUTS (outf
, dregs_lo (src0
));
4077 OUTS (outf
, " (V)");
4079 else if (sop
== 0 && sopcde
== 4)
4081 OUTS (outf
, dregs (dst0
));
4082 OUTS (outf
, " = PACK (");
4083 OUTS (outf
, dregs_lo (src1
));
4085 OUTS (outf
, dregs_lo (src0
));
4088 else if (sop
== 1 && sopcde
== 4)
4090 OUTS (outf
, dregs (dst0
));
4091 OUTS (outf
, " = PACK (");
4092 OUTS (outf
, dregs_lo (src1
));
4094 OUTS (outf
, dregs_hi (src0
));
4097 else if (sop
== 2 && sopcde
== 4)
4099 OUTS (outf
, dregs (dst0
));
4100 OUTS (outf
, " = PACK (");
4101 OUTS (outf
, dregs_hi (src1
));
4103 OUTS (outf
, dregs_lo (src0
));
4106 else if (sop
== 3 && sopcde
== 4)
4108 OUTS (outf
, dregs (dst0
));
4109 OUTS (outf
, " = PACK (");
4110 OUTS (outf
, dregs_hi (src1
));
4112 OUTS (outf
, dregs_hi (src0
));
4115 else if (sop
== 0 && sopcde
== 5)
4117 OUTS (outf
, dregs_lo (dst0
));
4118 OUTS (outf
, " = SIGNBITS ");
4119 OUTS (outf
, dregs (src1
));
4121 else if (sop
== 1 && sopcde
== 5)
4123 OUTS (outf
, dregs_lo (dst0
));
4124 OUTS (outf
, " = SIGNBITS ");
4125 OUTS (outf
, dregs_lo (src1
));
4127 else if (sop
== 2 && sopcde
== 5)
4129 OUTS (outf
, dregs_lo (dst0
));
4130 OUTS (outf
, " = SIGNBITS ");
4131 OUTS (outf
, dregs_hi (src1
));
4133 else if (sop
== 0 && sopcde
== 6)
4135 OUTS (outf
, dregs_lo (dst0
));
4136 OUTS (outf
, " = SIGNBITS A0");
4138 else if (sop
== 1 && sopcde
== 6)
4140 OUTS (outf
, dregs_lo (dst0
));
4141 OUTS (outf
, " = SIGNBITS A1");
4143 else if (sop
== 3 && sopcde
== 6)
4145 OUTS (outf
, dregs_lo (dst0
));
4146 OUTS (outf
, " = ONES ");
4147 OUTS (outf
, dregs (src1
));
4149 else if (sop
== 0 && sopcde
== 7)
4151 OUTS (outf
, dregs_lo (dst0
));
4152 OUTS (outf
, " = EXPADJ (");
4153 OUTS (outf
, dregs (src1
));
4155 OUTS (outf
, dregs_lo (src0
));
4158 else if (sop
== 1 && sopcde
== 7)
4160 OUTS (outf
, dregs_lo (dst0
));
4161 OUTS (outf
, " = EXPADJ (");
4162 OUTS (outf
, dregs (src1
));
4164 OUTS (outf
, dregs_lo (src0
));
4165 OUTS (outf
, ") (V)");
4167 else if (sop
== 2 && sopcde
== 7)
4169 OUTS (outf
, dregs_lo (dst0
));
4170 OUTS (outf
, " = EXPADJ (");
4171 OUTS (outf
, dregs_lo (src1
));
4173 OUTS (outf
, dregs_lo (src0
));
4176 else if (sop
== 3 && sopcde
== 7)
4178 OUTS (outf
, dregs_lo (dst0
));
4179 OUTS (outf
, " = EXPADJ (");
4180 OUTS (outf
, dregs_hi (src1
));
4182 OUTS (outf
, dregs_lo (src0
));
4185 else if (sop
== 0 && sopcde
== 8)
4187 OUTS (outf
, "BITMUX (");
4188 OUTS (outf
, dregs (src0
));
4190 OUTS (outf
, dregs (src1
));
4191 OUTS (outf
, ", A0) (ASR)");
4193 else if (sop
== 1 && sopcde
== 8)
4195 OUTS (outf
, "BITMUX (");
4196 OUTS (outf
, dregs (src0
));
4198 OUTS (outf
, dregs (src1
));
4199 OUTS (outf
, ", A0) (ASL)");
4201 else if (sop
== 0 && sopcde
== 9)
4203 OUTS (outf
, dregs_lo (dst0
));
4204 OUTS (outf
, " = VIT_MAX (");
4205 OUTS (outf
, dregs (src1
));
4206 OUTS (outf
, ") (ASL)");
4208 else if (sop
== 1 && sopcde
== 9)
4210 OUTS (outf
, dregs_lo (dst0
));
4211 OUTS (outf
, " = VIT_MAX (");
4212 OUTS (outf
, dregs (src1
));
4213 OUTS (outf
, ") (ASR)");
4215 else if (sop
== 2 && sopcde
== 9)
4217 OUTS (outf
, dregs (dst0
));
4218 OUTS (outf
, " = VIT_MAX (");
4219 OUTS (outf
, dregs (src1
));
4221 OUTS (outf
, dregs (src0
));
4222 OUTS (outf
, ") (ASL)");
4224 else if (sop
== 3 && sopcde
== 9)
4226 OUTS (outf
, dregs (dst0
));
4227 OUTS (outf
, " = VIT_MAX (");
4228 OUTS (outf
, dregs (src1
));
4230 OUTS (outf
, dregs (src0
));
4231 OUTS (outf
, ") (ASR)");
4233 else if (sop
== 0 && sopcde
== 10)
4235 OUTS (outf
, dregs (dst0
));
4236 OUTS (outf
, " = EXTRACT (");
4237 OUTS (outf
, dregs (src1
));
4239 OUTS (outf
, dregs_lo (src0
));
4240 OUTS (outf
, ") (Z)");
4242 else if (sop
== 1 && sopcde
== 10)
4244 OUTS (outf
, dregs (dst0
));
4245 OUTS (outf
, " = EXTRACT (");
4246 OUTS (outf
, dregs (src1
));
4248 OUTS (outf
, dregs_lo (src0
));
4249 OUTS (outf
, ") (X)");
4251 else if (sop
== 2 && sopcde
== 10)
4253 OUTS (outf
, dregs (dst0
));
4254 OUTS (outf
, " = DEPOSIT (");
4255 OUTS (outf
, dregs (src1
));
4257 OUTS (outf
, dregs (src0
));
4260 else if (sop
== 3 && sopcde
== 10)
4262 OUTS (outf
, dregs (dst0
));
4263 OUTS (outf
, " = DEPOSIT (");
4264 OUTS (outf
, dregs (src1
));
4266 OUTS (outf
, dregs (src0
));
4267 OUTS (outf
, ") (X)");
4269 else if (sop
== 0 && sopcde
== 11)
4271 OUTS (outf
, dregs_lo (dst0
));
4272 OUTS (outf
, " = CC = BXORSHIFT (A0, ");
4273 OUTS (outf
, dregs (src0
));
4276 else if (sop
== 1 && sopcde
== 11)
4278 OUTS (outf
, dregs_lo (dst0
));
4279 OUTS (outf
, " = CC = BXOR (A0, ");
4280 OUTS (outf
, dregs (src0
));
4283 else if (sop
== 0 && sopcde
== 12)
4284 OUTS (outf
, "A0 = BXORSHIFT (A0, A1, CC)");
4286 else if (sop
== 1 && sopcde
== 12)
4288 OUTS (outf
, dregs_lo (dst0
));
4289 OUTS (outf
, " = CC = BXOR (A0, A1, CC)");
4291 else if (sop
== 0 && sopcde
== 13)
4293 OUTS (outf
, dregs (dst0
));
4294 OUTS (outf
, " = ALIGN8 (");
4295 OUTS (outf
, dregs (src1
));
4297 OUTS (outf
, dregs (src0
));
4300 else if (sop
== 1 && sopcde
== 13)
4302 OUTS (outf
, dregs (dst0
));
4303 OUTS (outf
, " = ALIGN16 (");
4304 OUTS (outf
, dregs (src1
));
4306 OUTS (outf
, dregs (src0
));
4309 else if (sop
== 2 && sopcde
== 13)
4311 OUTS (outf
, dregs (dst0
));
4312 OUTS (outf
, " = ALIGN24 (");
4313 OUTS (outf
, dregs (src1
));
4315 OUTS (outf
, dregs (src0
));
4325 decode_dsp32shiftimm_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
4328 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
4329 | 1 | 1 | 0 | 0 |.M.| 1 | 1 | 0 | 1 | - | - |.sopcde............|
4330 |.sop...|.HLs...|.dst0......|.immag.................|.src1......|
4331 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
4332 int src1
= ((iw1
>> DSP32ShiftImm_src1_bits
) & DSP32ShiftImm_src1_mask
);
4333 int sop
= ((iw1
>> DSP32ShiftImm_sop_bits
) & DSP32ShiftImm_sop_mask
);
4334 int bit8
= ((iw1
>> 8) & 0x1);
4335 int immag
= ((iw1
>> DSP32ShiftImm_immag_bits
) & DSP32ShiftImm_immag_mask
);
4336 int newimmag
= (-(iw1
>> DSP32ShiftImm_immag_bits
) & DSP32ShiftImm_immag_mask
);
4337 int dst0
= ((iw1
>> DSP32ShiftImm_dst0_bits
) & DSP32ShiftImm_dst0_mask
);
4338 int sopcde
= ((iw0
>> (DSP32ShiftImm_sopcde_bits
- 16)) & DSP32ShiftImm_sopcde_mask
);
4339 int HLs
= ((iw1
>> DSP32ShiftImm_HLs_bits
) & DSP32ShiftImm_HLs_mask
);
4342 if (sop
== 0 && sopcde
== 0)
4344 OUTS (outf
, (HLs
& 2) ? dregs_hi (dst0
) : dregs_lo (dst0
));
4346 OUTS (outf
, (HLs
& 1) ? dregs_hi (src1
) : dregs_lo (src1
));
4347 OUTS (outf
, " >>> ");
4348 OUTS (outf
, uimm4 (newimmag
));
4350 else if (sop
== 1 && sopcde
== 0 && bit8
== 0)
4352 OUTS (outf
, (HLs
& 2) ? dregs_hi (dst0
) : dregs_lo (dst0
));
4354 OUTS (outf
, (HLs
& 1) ? dregs_hi (src1
) : dregs_lo (src1
));
4355 OUTS (outf
, " << ");
4356 OUTS (outf
, uimm4 (immag
));
4357 OUTS (outf
, " (S)");
4359 else if (sop
== 1 && sopcde
== 0 && bit8
== 1)
4361 OUTS (outf
, (HLs
& 2) ? dregs_hi (dst0
) : dregs_lo (dst0
));
4363 OUTS (outf
, (HLs
& 1) ? dregs_hi (src1
) : dregs_lo (src1
));
4364 OUTS (outf
, " >>> ");
4365 OUTS (outf
, uimm4 (newimmag
));
4366 OUTS (outf
, " (S)");
4368 else if (sop
== 2 && sopcde
== 0 && bit8
== 0)
4370 OUTS (outf
, (HLs
& 2) ? dregs_hi (dst0
) : dregs_lo (dst0
));
4372 OUTS (outf
, (HLs
& 1) ? dregs_hi (src1
) : dregs_lo (src1
));
4373 OUTS (outf
, " << ");
4374 OUTS (outf
, uimm4 (immag
));
4376 else if (sop
== 2 && sopcde
== 0 && bit8
== 1)
4378 OUTS (outf
, (HLs
& 2) ? dregs_hi (dst0
) : dregs_lo (dst0
));
4380 OUTS (outf
, (HLs
& 1) ? dregs_hi (src1
) : dregs_lo (src1
));
4381 OUTS (outf
, " >> ");
4382 OUTS (outf
, uimm4 (newimmag
));
4384 else if (sop
== 2 && sopcde
== 3 && HLs
== 1)
4386 OUTS (outf
, "A1 = ROT A1 BY ");
4387 OUTS (outf
, imm6 (immag
));
4389 else if (sop
== 0 && sopcde
== 3 && HLs
== 0 && bit8
== 0)
4391 OUTS (outf
, "A0 = A0 << ");
4392 OUTS (outf
, uimm5 (immag
));
4394 else if (sop
== 0 && sopcde
== 3 && HLs
== 0 && bit8
== 1)
4396 OUTS (outf
, "A0 = A0 >>> ");
4397 OUTS (outf
, uimm5 (newimmag
));
4399 else if (sop
== 0 && sopcde
== 3 && HLs
== 1 && bit8
== 0)
4401 OUTS (outf
, "A1 = A1 << ");
4402 OUTS (outf
, uimm5 (immag
));
4404 else if (sop
== 0 && sopcde
== 3 && HLs
== 1 && bit8
== 1)
4406 OUTS (outf
, "A1 = A1 >>> ");
4407 OUTS (outf
, uimm5 (newimmag
));
4409 else if (sop
== 1 && sopcde
== 3 && HLs
== 0)
4411 OUTS (outf
, "A0 = A0 >> ");
4412 OUTS (outf
, uimm5 (newimmag
));
4414 else if (sop
== 1 && sopcde
== 3 && HLs
== 1)
4416 OUTS (outf
, "A1 = A1 >> ");
4417 OUTS (outf
, uimm5 (newimmag
));
4419 else if (sop
== 2 && sopcde
== 3 && HLs
== 0)
4421 OUTS (outf
, "A0 = ROT A0 BY ");
4422 OUTS (outf
, imm6 (immag
));
4424 else if (sop
== 1 && sopcde
== 1 && bit8
== 0)
4426 OUTS (outf
, dregs (dst0
));
4428 OUTS (outf
, dregs (src1
));
4429 OUTS (outf
, " << ");
4430 OUTS (outf
, uimm5 (immag
));
4431 OUTS (outf
, " (V, S)");
4433 else if (sop
== 1 && sopcde
== 1 && bit8
== 1)
4435 OUTS (outf
, dregs (dst0
));
4437 OUTS (outf
, dregs (src1
));
4438 OUTS (outf
, " >>> ");
4439 OUTS (outf
, imm5 (-immag
));
4440 OUTS (outf
, " (V)");
4442 else if (sop
== 2 && sopcde
== 1 && bit8
== 1)
4444 OUTS (outf
, dregs (dst0
));
4446 OUTS (outf
, dregs (src1
));
4447 OUTS (outf
, " >> ");
4448 OUTS (outf
, uimm5 (newimmag
));
4449 OUTS (outf
, " (V)");
4451 else if (sop
== 2 && sopcde
== 1 && bit8
== 0)
4453 OUTS (outf
, dregs (dst0
));
4455 OUTS (outf
, dregs (src1
));
4456 OUTS (outf
, " << ");
4457 OUTS (outf
, imm5 (immag
));
4458 OUTS (outf
, " (V)");
4460 else if (sop
== 0 && sopcde
== 1)
4462 OUTS (outf
, dregs (dst0
));
4464 OUTS (outf
, dregs (src1
));
4465 OUTS (outf
, " >>> ");
4466 OUTS (outf
, uimm5 (newimmag
));
4467 OUTS (outf
, " (V)");
4469 else if (sop
== 1 && sopcde
== 2)
4471 OUTS (outf
, dregs (dst0
));
4473 OUTS (outf
, dregs (src1
));
4474 OUTS (outf
, " << ");
4475 OUTS (outf
, uimm5 (immag
));
4476 OUTS (outf
, " (S)");
4478 else if (sop
== 2 && sopcde
== 2 && bit8
== 1)
4480 OUTS (outf
, dregs (dst0
));
4482 OUTS (outf
, dregs (src1
));
4483 OUTS (outf
, " >> ");
4484 OUTS (outf
, uimm5 (newimmag
));
4486 else if (sop
== 2 && sopcde
== 2 && bit8
== 0)
4488 OUTS (outf
, dregs (dst0
));
4490 OUTS (outf
, dregs (src1
));
4491 OUTS (outf
, " << ");
4492 OUTS (outf
, uimm5 (immag
));
4494 else if (sop
== 3 && sopcde
== 2)
4496 OUTS (outf
, dregs (dst0
));
4497 OUTS (outf
, " = ROT ");
4498 OUTS (outf
, dregs (src1
));
4499 OUTS (outf
, " BY ");
4500 OUTS (outf
, imm6 (immag
));
4502 else if (sop
== 0 && sopcde
== 2)
4504 OUTS (outf
, dregs (dst0
));
4506 OUTS (outf
, dregs (src1
));
4507 OUTS (outf
, " >>> ");
4508 OUTS (outf
, uimm5 (newimmag
));
4517 decode_pseudoDEBUG_0 (TIword iw0
, disassemble_info
*outf
)
4520 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
4521 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |.fn....|.grp.......|.reg.......|
4522 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
4523 int fn
= ((iw0
>> PseudoDbg_fn_bits
) & PseudoDbg_fn_mask
);
4524 int grp
= ((iw0
>> PseudoDbg_grp_bits
) & PseudoDbg_grp_mask
);
4525 int reg
= ((iw0
>> PseudoDbg_reg_bits
) & PseudoDbg_reg_mask
);
4527 if (reg
== 0 && fn
== 3)
4528 OUTS (outf
, "DBG A0");
4530 else if (reg
== 1 && fn
== 3)
4531 OUTS (outf
, "DBG A1");
4533 else if (reg
== 3 && fn
== 3)
4534 OUTS (outf
, "ABORT");
4536 else if (reg
== 4 && fn
== 3)
4539 else if (reg
== 5 && fn
== 3)
4540 OUTS (outf
, "DBGHALT");
4542 else if (reg
== 6 && fn
== 3)
4544 OUTS (outf
, "DBGCMPLX (");
4545 OUTS (outf
, dregs (grp
));
4548 else if (reg
== 7 && fn
== 3)
4551 else if (grp
== 0 && fn
== 2)
4553 OUTS (outf
, "OUTC");
4554 OUTS (outf
, dregs (reg
));
4559 OUTS (outf
, allregs (reg
, grp
));
4563 OUTS (outf
, "PRNT");
4564 OUTS (outf
, allregs (reg
, grp
));
4573 decode_pseudodbg_assert_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
4576 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
4577 | 1 | 1 | 1 | 1 | 0 | - | - | - | dbgop |.grp.......|.regtest...|
4578 |.expected......................................................|
4579 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
4580 int expected
= ((iw1
>> PseudoDbg_Assert_expected_bits
) & PseudoDbg_Assert_expected_mask
);
4581 int dbgop
= ((iw0
>> (PseudoDbg_Assert_dbgop_bits
- 16)) & PseudoDbg_Assert_dbgop_mask
);
4582 int grp
= ((iw0
>> (PseudoDbg_Assert_grp_bits
- 16)) & PseudoDbg_Assert_grp_mask
);
4583 int regtest
= ((iw0
>> (PseudoDbg_Assert_regtest_bits
- 16)) & PseudoDbg_Assert_regtest_mask
);
4587 OUTS (outf
, "DBGA (");
4588 OUTS (outf
, regs_lo (regtest
, grp
));
4590 OUTS (outf
, uimm16 (expected
));
4593 else if (dbgop
== 1)
4595 OUTS (outf
, "DBGA (");
4596 OUTS (outf
, regs_hi (regtest
, grp
));
4598 OUTS (outf
, uimm16 (expected
));
4601 else if (dbgop
== 2)
4603 OUTS (outf
, "DBGAL (");
4604 OUTS (outf
, allregs (regtest
, grp
));
4606 OUTS (outf
, uimm16 (expected
));
4609 else if (dbgop
== 3)
4611 OUTS (outf
, "DBGAH (");
4612 OUTS (outf
, allregs (regtest
, grp
));
4614 OUTS (outf
, uimm16 (expected
));
4623 _print_insn_bfin (bfd_vma pc
, disassemble_info
*outf
)
4631 status
= (*outf
->read_memory_func
) (pc
& ~0x1, buf
, 2, outf
);
4634 status
= (*outf
->read_memory_func
) ((pc
+ 2) & ~0x1, buf
+ 2, 2, outf
);
4638 iw0
= bfd_getl16 (buf
);
4639 iw1
= bfd_getl16 (buf
+ 2);
4641 if ((iw0
& 0xf7ff) == 0xc003 && iw1
== 0x1800)
4643 OUTS (outf
, "MNOP");
4646 else if ((iw0
& 0xff00) == 0x0000)
4647 rv
= decode_ProgCtrl_0 (iw0
, outf
);
4648 else if ((iw0
& 0xffc0) == 0x0240)
4649 rv
= decode_CaCTRL_0 (iw0
, outf
);
4650 else if ((iw0
& 0xff80) == 0x0100)
4651 rv
= decode_PushPopReg_0 (iw0
, outf
);
4652 else if ((iw0
& 0xfe00) == 0x0400)
4653 rv
= decode_PushPopMultiple_0 (iw0
, outf
);
4654 else if ((iw0
& 0xfe00) == 0x0600)
4655 rv
= decode_ccMV_0 (iw0
, outf
);
4656 else if ((iw0
& 0xf800) == 0x0800)
4657 rv
= decode_CCflag_0 (iw0
, outf
);
4658 else if ((iw0
& 0xffe0) == 0x0200)
4659 rv
= decode_CC2dreg_0 (iw0
, outf
);
4660 else if ((iw0
& 0xff00) == 0x0300)
4661 rv
= decode_CC2stat_0 (iw0
, outf
);
4662 else if ((iw0
& 0xf000) == 0x1000)
4663 rv
= decode_BRCC_0 (iw0
, pc
, outf
);
4664 else if ((iw0
& 0xf000) == 0x2000)
4665 rv
= decode_UJUMP_0 (iw0
, pc
, outf
);
4666 else if ((iw0
& 0xf000) == 0x3000)
4667 rv
= decode_REGMV_0 (iw0
, outf
);
4668 else if ((iw0
& 0xfc00) == 0x4000)
4669 rv
= decode_ALU2op_0 (iw0
, outf
);
4670 else if ((iw0
& 0xfe00) == 0x4400)
4671 rv
= decode_PTR2op_0 (iw0
, outf
);
4672 else if ((iw0
& 0xf800) == 0x4800)
4673 rv
= decode_LOGI2op_0 (iw0
, outf
);
4674 else if ((iw0
& 0xf000) == 0x5000)
4675 rv
= decode_COMP3op_0 (iw0
, outf
);
4676 else if ((iw0
& 0xf800) == 0x6000)
4677 rv
= decode_COMPI2opD_0 (iw0
, outf
);
4678 else if ((iw0
& 0xf800) == 0x6800)
4679 rv
= decode_COMPI2opP_0 (iw0
, outf
);
4680 else if ((iw0
& 0xf000) == 0x8000)
4681 rv
= decode_LDSTpmod_0 (iw0
, outf
);
4682 else if ((iw0
& 0xff60) == 0x9e60)
4683 rv
= decode_dagMODim_0 (iw0
, outf
);
4684 else if ((iw0
& 0xfff0) == 0x9f60)
4685 rv
= decode_dagMODik_0 (iw0
, outf
);
4686 else if ((iw0
& 0xfc00) == 0x9c00)
4687 rv
= decode_dspLDST_0 (iw0
, outf
);
4688 else if ((iw0
& 0xf000) == 0x9000)
4689 rv
= decode_LDST_0 (iw0
, outf
);
4690 else if ((iw0
& 0xfc00) == 0xb800)
4691 rv
= decode_LDSTiiFP_0 (iw0
, outf
);
4692 else if ((iw0
& 0xe000) == 0xA000)
4693 rv
= decode_LDSTii_0 (iw0
, outf
);
4694 else if ((iw0
& 0xff80) == 0xe080 && (iw1
& 0x0C00) == 0x0000)
4695 rv
= decode_LoopSetup_0 (iw0
, iw1
, pc
, outf
);
4696 else if ((iw0
& 0xff00) == 0xe100 && (iw1
& 0x0000) == 0x0000)
4697 rv
= decode_LDIMMhalf_0 (iw0
, iw1
, outf
);
4698 else if ((iw0
& 0xfe00) == 0xe200 && (iw1
& 0x0000) == 0x0000)
4699 rv
= decode_CALLa_0 (iw0
, iw1
, pc
, outf
);
4700 else if ((iw0
& 0xfc00) == 0xe400 && (iw1
& 0x0000) == 0x0000)
4701 rv
= decode_LDSTidxI_0 (iw0
, iw1
, outf
);
4702 else if ((iw0
& 0xfffe) == 0xe800 && (iw1
& 0x0000) == 0x0000)
4703 rv
= decode_linkage_0 (iw0
, iw1
, outf
);
4704 else if ((iw0
& 0xf600) == 0xc000 && (iw1
& 0x0000) == 0x0000)
4705 rv
= decode_dsp32mac_0 (iw0
, iw1
, outf
);
4706 else if ((iw0
& 0xf600) == 0xc200 && (iw1
& 0x0000) == 0x0000)
4707 rv
= decode_dsp32mult_0 (iw0
, iw1
, outf
);
4708 else if ((iw0
& 0xf7c0) == 0xc400 && (iw1
& 0x0000) == 0x0000)
4709 rv
= decode_dsp32alu_0 (iw0
, iw1
, outf
);
4710 else if ((iw0
& 0xf780) == 0xc600 && (iw1
& 0x01c0) == 0x0000)
4711 rv
= decode_dsp32shift_0 (iw0
, iw1
, outf
);
4712 else if ((iw0
& 0xf780) == 0xc680 && (iw1
& 0x0000) == 0x0000)
4713 rv
= decode_dsp32shiftimm_0 (iw0
, iw1
, outf
);
4714 else if ((iw0
& 0xff00) == 0xf800)
4715 rv
= decode_pseudoDEBUG_0 (iw0
, outf
);
4717 else if ((iw0
& 0xFF00) == 0xF900)
4718 rv
= decode_pseudoOChar_0 (iw0
, iw1
, pc
, outf
);
4720 else if ((iw0
& 0xFF00) == 0xf000 && (iw1
& 0x0000) == 0x0000)
4721 rv
= decode_pseudodbg_assert_0 (iw0
, iw1
, outf
);
4728 print_insn_bfin (bfd_vma pc
, disassemble_info
*outf
)
4735 status
= (*outf
->read_memory_func
) (pc
& ~0x01, buf
, 2, outf
);
4738 iw0
= bfd_getl16 (buf
);
4740 count
+= _print_insn_bfin (pc
, outf
);
4742 /* Proper display of multiple issue instructions. */
4744 if ((iw0
& 0xc000) == 0xc000 && (iw0
& BIT_MULTI_INS
)
4745 && ((iw0
& 0xe800) != 0xe800 /* Not Linkage. */ ))
4748 outf
->fprintf_func (outf
->stream
, " || ");
4749 count
+= _print_insn_bfin (pc
+ 4, outf
);
4750 outf
->fprintf_func (outf
->stream
, " || ");
4751 count
+= _print_insn_bfin (pc
+ 6, outf
);
4756 outf
->fprintf_func (outf
->stream
, "ILLEGAL");
4760 outf
->fprintf_func (outf
->stream
, ";");