1 /* Disassemble ADI Blackfin Instructions.
2 Copyright 2005 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
17 MA 02110-1301, USA. */
23 #include "opcode/bfin.h"
45 #define HOST_LONG_WORD_SIZE (sizeof (long) * 8)
46 #define XFIELD(w,p,s) (((w) & ((1 << (s)) - 1) << (p)) >> (p))
47 #define SIGNEXTEND(v, n) ((v << (HOST_LONG_WORD_SIZE - (n))) >> (HOST_LONG_WORD_SIZE - (n)))
48 #define MASKBITS(val, bits) (val & ((1 << bits) - 1))
54 c_0
, c_1
, c_4
, c_2
, c_uimm2
, c_uimm3
, c_imm3
, c_pcrel4
,
55 c_imm4
, c_uimm4s4
, c_uimm4
, c_uimm4s2
, c_negimm5s4
, c_imm5
, c_uimm5
, c_imm6
,
56 c_imm7
, c_imm8
, c_uimm8
, c_pcrel8
, c_uimm8s4
, c_pcrel8s4
, c_lppcrel10
, c_pcrel10
,
57 c_pcrel12
, c_imm16s4
, c_luimm16
, c_imm16
, c_huimm16
, c_rimm16
, c_imm16s2
, c_uimm16s4
,
72 } constant_formats
[] =
74 { "0", 0, 0, 1, 0, 0, 0, 0, 0},
75 { "1", 0, 0, 1, 0, 0, 0, 0, 0},
76 { "4", 0, 0, 1, 0, 0, 0, 0, 0},
77 { "2", 0, 0, 1, 0, 0, 0, 0, 0},
78 { "uimm2", 2, 0, 0, 0, 0, 0, 0, 0},
79 { "uimm3", 3, 0, 0, 0, 0, 0, 0, 0},
80 { "imm3", 3, 0, 1, 0, 0, 0, 0, 0},
81 { "pcrel4", 4, 1, 0, 1, 1, 0, 0, 0},
82 { "imm4", 4, 0, 1, 0, 0, 0, 0, 0},
83 { "uimm4s4", 4, 0, 0, 0, 2, 0, 0, 1},
84 { "uimm4", 4, 0, 0, 0, 0, 0, 0, 0},
85 { "uimm4s2", 4, 0, 0, 0, 1, 0, 0, 1},
86 { "negimm5s4", 5, 0, 1, 0, 2, 0, 1, 0},
87 { "imm5", 5, 0, 1, 0, 0, 0, 0, 0},
88 { "uimm5", 5, 0, 0, 0, 0, 0, 0, 0},
89 { "imm6", 6, 0, 1, 0, 0, 0, 0, 0},
90 { "imm7", 7, 0, 1, 0, 0, 0, 0, 0},
91 { "imm8", 8, 0, 1, 0, 0, 0, 0, 0},
92 { "uimm8", 8, 0, 0, 0, 0, 0, 0, 0},
93 { "pcrel8", 8, 1, 0, 1, 1, 0, 0, 0},
94 { "uimm8s4", 8, 0, 0, 0, 2, 0, 0, 0},
95 { "pcrel8s4", 8, 1, 1, 1, 2, 0, 0, 0},
96 { "lppcrel10", 10, 1, 0, 1, 1, 0, 0, 0},
97 { "pcrel10", 10, 1, 1, 1, 1, 0, 0, 0},
98 { "pcrel12", 12, 1, 1, 1, 1, 0, 0, 0},
99 { "imm16s4", 16, 0, 1, 0, 2, 0, 0, 0},
100 { "luimm16", 16, 1, 0, 0, 0, 0, 0, 0},
101 { "imm16", 16, 0, 1, 0, 0, 0, 0, 0},
102 { "huimm16", 16, 1, 0, 0, 0, 0, 0, 0},
103 { "rimm16", 16, 1, 1, 0, 0, 0, 0, 0},
104 { "imm16s2", 16, 0, 1, 0, 1, 0, 0, 0},
105 { "uimm16s4", 16, 0, 0, 0, 2, 0, 0, 0},
106 { "uimm16", 16, 0, 0, 0, 0, 0, 0, 0},
107 { "pcrel24", 24, 1, 1, 1, 1, 0, 0, 0}
110 int _print_insn_bfin (bfd_vma pc
, disassemble_info
* outf
);
111 int print_insn_bfin (bfd_vma pc
, disassemble_info
* outf
);
114 fmtconst (const_forms_t cf
, TIword x
, bfd_vma pc
, disassemble_info
* outf
)
118 if (constant_formats
[cf
].reloc
)
120 bfd_vma ea
= (((constant_formats
[cf
].pcrel
? SIGNEXTEND (x
, constant_formats
[cf
].nbits
)
121 : x
) + constant_formats
[cf
].offset
) << constant_formats
[cf
].scale
);
122 if (constant_formats
[cf
].pcrel
)
125 outf
->print_address_func (ea
, outf
);
129 /* Negative constants have an implied sign bit. */
130 if (constant_formats
[cf
].negative
)
132 int nb
= constant_formats
[cf
].nbits
+ 1;
134 x
= x
| (1 << constant_formats
[cf
].nbits
);
135 x
= SIGNEXTEND (x
, nb
);
138 x
= constant_formats
[cf
].issigned
? SIGNEXTEND (x
, constant_formats
[cf
].nbits
) : x
;
140 if (constant_formats
[cf
].offset
)
141 x
+= constant_formats
[cf
].offset
;
143 if (constant_formats
[cf
].scale
)
144 x
<<= constant_formats
[cf
].scale
;
146 if (constant_formats
[cf
].issigned
&& x
< 0)
147 sprintf (buf
, "%ld", x
);
149 sprintf (buf
, "0x%lx", x
);
154 enum machine_registers
156 REG_RL0
, REG_RL1
, REG_RL2
, REG_RL3
, REG_RL4
, REG_RL5
, REG_RL6
, REG_RL7
,
157 REG_RH0
, REG_RH1
, REG_RH2
, REG_RH3
, REG_RH4
, REG_RH5
, REG_RH6
, REG_RH7
,
158 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
159 REG_R1_0
, REG_R3_2
, REG_R5_4
, REG_R7_6
, REG_P0
, REG_P1
, REG_P2
, REG_P3
,
160 REG_P4
, REG_P5
, REG_SP
, REG_FP
, REG_A0x
, REG_A1x
, REG_A0w
, REG_A1w
,
161 REG_A0
, REG_A1
, REG_I0
, REG_I1
, REG_I2
, REG_I3
, REG_M0
, REG_M1
,
162 REG_M2
, REG_M3
, REG_B0
, REG_B1
, REG_B2
, REG_B3
, REG_L0
, REG_L1
,
164 REG_AZ
, REG_AN
, REG_AC0
, REG_AC1
, REG_AV0
, REG_AV1
, REG_AV0S
, REG_AV1S
,
165 REG_AQ
, REG_V
, REG_VS
,
166 REG_sftreset
, REG_omode
, REG_excause
, REG_emucause
, REG_idle_req
, REG_hwerrcause
, REG_CC
, REG_LC0
,
167 REG_LC1
, REG_GP
, REG_ASTAT
, REG_RETS
, REG_LT0
, REG_LB0
, REG_LT1
, REG_LB1
,
168 REG_CYCLES
, REG_CYCLES2
, REG_USP
, REG_SEQSTAT
, REG_SYSCFG
, REG_RETI
, REG_RETX
, REG_RETN
,
169 REG_RETE
, REG_EMUDAT
, REG_BR0
, REG_BR1
, REG_BR2
, REG_BR3
, REG_BR4
, REG_BR5
, REG_BR6
,
170 REG_BR7
, REG_PL0
, REG_PL1
, REG_PL2
, REG_PL3
, REG_PL4
, REG_PL5
, REG_SLP
, REG_FLP
,
171 REG_PH0
, REG_PH1
, REG_PH2
, REG_PH3
, REG_PH4
, REG_PH5
, REG_SHP
, REG_FHP
,
172 REG_IL0
, REG_IL1
, REG_IL2
, REG_IL3
, REG_ML0
, REG_ML1
, REG_ML2
, REG_ML3
,
173 REG_BL0
, REG_BL1
, REG_BL2
, REG_BL3
, REG_LL0
, REG_LL1
, REG_LL2
, REG_LL3
,
174 REG_IH0
, REG_IH1
, REG_IH2
, REG_IH3
, REG_MH0
, REG_MH1
, REG_MH2
, REG_MH3
,
175 REG_BH0
, REG_BH1
, REG_BH2
, REG_BH3
, REG_LH0
, REG_LH1
, REG_LH2
, REG_LH3
,
181 rc_dregs_lo
, rc_dregs_hi
, rc_dregs
, rc_dregs_pair
, rc_pregs
, rc_spfp
, rc_dregs_hilo
, rc_accum_ext
,
182 rc_accum_word
, rc_accum
, rc_iregs
, rc_mregs
, rc_bregs
, rc_lregs
, rc_dpregs
, rc_gregs
,
183 rc_regs
, rc_statbits
, rc_ignore_bits
, rc_ccstat
, rc_counters
, rc_dregs2_sysregs1
, rc_open
, rc_sysregs2
,
184 rc_sysregs3
, rc_allregs
,
188 static char *reg_names
[] =
190 "R0.L", "R1.L", "R2.L", "R3.L", "R4.L", "R5.L", "R6.L", "R7.L",
191 "R0.H", "R1.H", "R2.H", "R3.H", "R4.H", "R5.H", "R6.H", "R7.H",
192 "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7",
193 "R1:0", "R3:2", "R5:4", "R7:6", "P0", "P1", "P2", "P3",
194 "P4", "P5", "SP", "FP", "A0.x", "A1.x", "A0.w", "A1.w",
195 "A0", "A1", "I0", "I1", "I2", "I3", "M0", "M1",
196 "M2", "M3", "B0", "B1", "B2", "B3", "L0", "L1",
198 "AZ", "AN", "AC0", "AC1", "AV0", "AV1", "AV0S", "AV1S",
200 "sftreset", "omode", "excause", "emucause", "idle_req", "hwerrcause", "CC", "LC0",
201 "LC1", "GP", "ASTAT", "RETS", "LT0", "LB0", "LT1", "LB1",
202 "CYCLES", "CYCLES2", "USP", "SEQSTAT", "SYSCFG", "RETI", "RETX", "RETN",
204 "R0.B", "R1.B", "R2.B", "R3.B", "R4.B", "R5.B", "R6.B", "R7.B",
205 "P0.L", "P1.L", "P2.L", "P3.L", "P4.L", "P5.L", "SP.L", "FP.L",
206 "P0.H", "P1.H", "P2.H", "P3.H", "P4.H", "P5.H", "SP.H", "FP.H",
207 "I0.L", "I1.L", "I2.L", "I3.L", "M0.L", "M1.L", "M2.L", "M3.L",
208 "B0.L", "B1.L", "B2.L", "B3.L", "L0.L", "L1.L", "L2.L", "L3.L",
209 "I0.H", "I1.H", "I2.H", "I3.H", "M0.H", "M1.H", "M2.H", "M3.H",
210 "B0.H", "B1.H", "B2.H", "B3.H", "L0.H", "L1.H", "L2.H", "L3.H",
215 #define REGNAME(x) ((x) < REG_LASTREG ? (reg_names[x]) : "...... Illegal register .......")
218 static enum machine_registers decode_dregs_lo
[] =
220 REG_RL0
, REG_RL1
, REG_RL2
, REG_RL3
, REG_RL4
, REG_RL5
, REG_RL6
, REG_RL7
,
223 #define dregs_lo(x) REGNAME (decode_dregs_lo[(x) & 7])
226 static enum machine_registers decode_dregs_hi
[] =
228 REG_RH0
, REG_RH1
, REG_RH2
, REG_RH3
, REG_RH4
, REG_RH5
, REG_RH6
, REG_RH7
,
231 #define dregs_hi(x) REGNAME (decode_dregs_hi[(x) & 7])
234 static enum machine_registers decode_dregs
[] =
236 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
239 #define dregs(x) REGNAME (decode_dregs[(x) & 7])
242 static enum machine_registers decode_dregs_byte
[] =
244 REG_BR0
, REG_BR1
, REG_BR2
, REG_BR3
, REG_BR4
, REG_BR5
, REG_BR6
, REG_BR7
,
247 #define dregs_byte(x) REGNAME (decode_dregs_byte[(x) & 7])
248 #define dregs_pair(x) REGNAME (decode_dregs_pair[(x) & 7])
251 static enum machine_registers decode_pregs
[] =
253 REG_P0
, REG_P1
, REG_P2
, REG_P3
, REG_P4
, REG_P5
, REG_SP
, REG_FP
,
256 #define pregs(x) REGNAME (decode_pregs[(x) & 7])
257 #define spfp(x) REGNAME (decode_spfp[(x) & 1])
258 #define dregs_hilo(x,i) REGNAME (decode_dregs_hilo[((i) << 3)|x])
259 #define accum_ext(x) REGNAME (decode_accum_ext[(x) & 1])
260 #define accum_word(x) REGNAME (decode_accum_word[(x) & 1])
261 #define accum(x) REGNAME (decode_accum[(x) & 1])
264 static enum machine_registers decode_iregs
[] =
266 REG_I0
, REG_I1
, REG_I2
, REG_I3
,
269 #define iregs(x) REGNAME (decode_iregs[(x) & 3])
272 static enum machine_registers decode_mregs
[] =
274 REG_M0
, REG_M1
, REG_M2
, REG_M3
,
277 #define mregs(x) REGNAME (decode_mregs[(x) & 3])
278 #define bregs(x) REGNAME (decode_bregs[(x) & 3])
279 #define lregs(x) REGNAME (decode_lregs[(x) & 3])
282 static enum machine_registers decode_dpregs
[] =
284 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
285 REG_P0
, REG_P1
, REG_P2
, REG_P3
, REG_P4
, REG_P5
, REG_SP
, REG_FP
,
288 #define dpregs(x) REGNAME (decode_dpregs[(x) & 15])
291 static enum machine_registers decode_gregs
[] =
293 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
294 REG_P0
, REG_P1
, REG_P2
, REG_P3
, REG_P4
, REG_P5
, REG_SP
, REG_FP
,
297 #define gregs(x,i) REGNAME (decode_gregs[((i) << 3)|x])
299 /* [dregs pregs (iregs mregs) (bregs lregs)]. */
300 static enum machine_registers decode_regs
[] =
302 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
303 REG_P0
, REG_P1
, REG_P2
, REG_P3
, REG_P4
, REG_P5
, REG_SP
, REG_FP
,
304 REG_I0
, REG_I1
, REG_I2
, REG_I3
, REG_M0
, REG_M1
, REG_M2
, REG_M3
,
305 REG_B0
, REG_B1
, REG_B2
, REG_B3
, REG_L0
, REG_L1
, REG_L2
, REG_L3
,
308 #define regs(x,i) REGNAME (decode_regs[((i) << 3)|x])
310 /* [dregs pregs (iregs mregs) (bregs lregs) Low Half]. */
311 static enum machine_registers decode_regs_lo
[] =
313 REG_RL0
, REG_RL1
, REG_RL2
, REG_RL3
, REG_RL4
, REG_RL5
, REG_RL6
, REG_RL7
,
314 REG_PL0
, REG_PL1
, REG_PL2
, REG_PL3
, REG_PL4
, REG_PL5
, REG_SLP
, REG_FLP
,
315 REG_IL0
, REG_IL1
, REG_IL2
, REG_IL3
, REG_ML0
, REG_ML1
, REG_ML2
, REG_ML3
,
316 REG_BL0
, REG_BL1
, REG_BL2
, REG_BL3
, REG_LL0
, REG_LL1
, REG_LL2
, REG_LL3
,
319 #define regs_lo(x,i) REGNAME (decode_regs_lo[((i) << 3)|x])
320 /* [dregs pregs (iregs mregs) (bregs lregs) High Half]. */
321 static enum machine_registers decode_regs_hi
[] =
323 REG_RH0
, REG_RH1
, REG_RH2
, REG_RH3
, REG_RH4
, REG_RH5
, REG_RH6
, REG_RH7
,
324 REG_PH0
, REG_PH1
, REG_PH2
, REG_PH3
, REG_PH4
, REG_PH5
, REG_SHP
, REG_FHP
,
325 REG_IH0
, REG_IH1
, REG_IH2
, REG_IH3
, REG_MH0
, REG_MH1
, REG_LH2
, REG_MH3
,
326 REG_BH0
, REG_BH1
, REG_BH2
, REG_BH3
, REG_LH0
, REG_LH1
, REG_LH2
, REG_LH3
,
329 #define regs_hi(x,i) REGNAME (decode_regs_hi[((i) << 3)|x])
331 static enum machine_registers decode_statbits
[] =
333 REG_AZ
, REG_AN
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_AQ
, REG_LASTREG
,
334 REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_AC0
, REG_AC1
, REG_LASTREG
, REG_LASTREG
,
335 REG_AV0
, REG_AV0S
, REG_AV1
, REG_AV1S
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
,
336 REG_V
, REG_VS
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
,
339 #define statbits(x) REGNAME (decode_statbits[(x) & 31])
340 #define ignore_bits(x) REGNAME (decode_ignore_bits[(x) & 7])
341 #define ccstat(x) REGNAME (decode_ccstat[(x) & 0])
344 static enum machine_registers decode_counters
[] =
349 #define counters(x) REGNAME (decode_counters[(x) & 1])
350 #define dregs2_sysregs1(x) REGNAME (decode_dregs2_sysregs1[(x) & 7])
352 /* [dregs pregs (iregs mregs) (bregs lregs)
353 dregs2_sysregs1 open sysregs2 sysregs3]. */
354 static enum machine_registers decode_allregs
[] =
356 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
357 REG_P0
, REG_P1
, REG_P2
, REG_P3
, REG_P4
, REG_P5
, REG_SP
, REG_FP
,
358 REG_I0
, REG_I1
, REG_I2
, REG_I3
, REG_M0
, REG_M1
, REG_M2
, REG_M3
,
359 REG_B0
, REG_B1
, REG_B2
, REG_B3
, REG_L0
, REG_L1
, REG_L2
, REG_L3
,
360 REG_A0x
, REG_A0w
, REG_A1x
, REG_A1w
, REG_GP
, REG_LASTREG
, REG_ASTAT
, REG_RETS
,
361 REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
,
362 REG_LC0
, REG_LT0
, REG_LB0
, REG_LC1
, REG_LT1
, REG_LB1
, REG_CYCLES
, REG_CYCLES2
,
363 REG_USP
, REG_SEQSTAT
, REG_SYSCFG
, REG_RETI
, REG_RETX
, REG_RETN
, REG_RETE
, REG_EMUDAT
, REG_LASTREG
,
366 #define allregs(x,i) REGNAME (decode_allregs[((i) << 3) | x])
367 #define uimm16s4(x) fmtconst (c_uimm16s4, x, 0, outf)
368 #define pcrel4(x) fmtconst (c_pcrel4, x, pc, outf)
369 #define pcrel8(x) fmtconst (c_pcrel8, x, pc, outf)
370 #define pcrel8s4(x) fmtconst (c_pcrel8s4, x, pc, outf)
371 #define pcrel10(x) fmtconst (c_pcrel10, x, pc, outf)
372 #define pcrel12(x) fmtconst (c_pcrel12, x, pc, outf)
373 #define negimm5s4(x) fmtconst (c_negimm5s4, x, 0, outf)
374 #define rimm16(x) fmtconst (c_rimm16, x, 0, outf)
375 #define huimm16(x) fmtconst (c_huimm16, x, 0, outf)
376 #define imm16(x) fmtconst (c_imm16, x, 0, outf)
377 #define uimm2(x) fmtconst (c_uimm2, x, 0, outf)
378 #define uimm3(x) fmtconst (c_uimm3, x, 0, outf)
379 #define luimm16(x) fmtconst (c_luimm16, x, 0, outf)
380 #define uimm4(x) fmtconst (c_uimm4, x, 0, outf)
381 #define uimm5(x) fmtconst (c_uimm5, x, 0, outf)
382 #define imm16s2(x) fmtconst (c_imm16s2, x, 0, outf)
383 #define uimm8(x) fmtconst (c_uimm8, x, 0, outf)
384 #define imm16s4(x) fmtconst (c_imm16s4, x, 0, outf)
385 #define uimm4s2(x) fmtconst (c_uimm4s2, x, 0, outf)
386 #define uimm4s4(x) fmtconst (c_uimm4s4, x, 0, outf)
387 #define lppcrel10(x) fmtconst (c_lppcrel10, x, pc, outf)
388 #define imm3(x) fmtconst (c_imm3, x, 0, outf)
389 #define imm4(x) fmtconst (c_imm4, x, 0, outf)
390 #define uimm8s4(x) fmtconst (c_uimm8s4, x, 0, outf)
391 #define imm5(x) fmtconst (c_imm5, x, 0, outf)
392 #define imm6(x) fmtconst (c_imm6, x, 0, outf)
393 #define imm7(x) fmtconst (c_imm7, x, 0, outf)
394 #define imm8(x) fmtconst (c_imm8, x, 0, outf)
395 #define pcrel24(x) fmtconst (c_pcrel24, x, pc, outf)
396 #define uimm16(x) fmtconst (c_uimm16, x, 0, outf)
398 /* (arch.pm)arch_disassembler_functions. */
400 #define OUTS(p, txt) ((p) ? (((txt)[0]) ? (p->fprintf_func)(p->stream, txt) :0) :0)
404 amod0 (int s0
, int x0
, disassemble_info
*outf
)
406 if (s0
== 1 && x0
== 0)
408 else if (s0
== 0 && x0
== 1)
410 else if (s0
== 1 && x0
== 1)
411 OUTS (outf
, "(SCO)");
415 amod1 (int s0
, int x0
, disassemble_info
*outf
)
417 if (s0
== 0 && x0
== 0)
419 else if (s0
== 1 && x0
== 0)
424 amod0amod2 (int s0
, int x0
, int aop0
, disassemble_info
*outf
)
426 if (s0
== 1 && x0
== 0 && aop0
== 0)
428 else if (s0
== 0 && x0
== 1 && aop0
== 0)
430 else if (s0
== 1 && x0
== 1 && aop0
== 0)
431 OUTS (outf
, "(SCO)");
432 else if (s0
== 0 && x0
== 0 && aop0
== 2)
433 OUTS (outf
, "(ASR)");
434 else if (s0
== 1 && x0
== 0 && aop0
== 2)
435 OUTS (outf
, "(S,ASR)");
436 else if (s0
== 0 && x0
== 1 && aop0
== 2)
437 OUTS (outf
, "(CO,ASR)");
438 else if (s0
== 1 && x0
== 1 && aop0
== 2)
439 OUTS (outf
, "(SCO,ASR)");
440 else if (s0
== 0 && x0
== 0 && aop0
== 3)
441 OUTS (outf
, "(ASL)");
442 else if (s0
== 1 && x0
== 0 && aop0
== 3)
443 OUTS (outf
, "(S,ASL)");
444 else if (s0
== 0 && x0
== 1 && aop0
== 3)
445 OUTS (outf
, "(CO,ASL)");
446 else if (s0
== 1 && x0
== 1 && aop0
== 3)
447 OUTS (outf
, "(SCO,ASL)");
451 searchmod (int r0
, disassemble_info
*outf
)
464 aligndir (int r0
, disassemble_info
*outf
)
471 decode_multfunc (int h0
, int h1
, int src0
, int src1
, disassemble_info
* outf
)
476 s0
= dregs_hi (src0
);
478 s0
= dregs_lo (src0
);
481 s1
= dregs_hi (src1
);
483 s1
= dregs_lo (src1
);
492 decode_macfunc (int which
, int op
, int h0
, int h1
, int src0
, int src1
, disassemble_info
* outf
)
495 char *sop
= "<unknown op>";
510 case 0: sop
= "="; break;
511 case 1: sop
= "+="; break;
512 case 2: sop
= "-="; break;
520 decode_multfunc (h0
, h1
, src0
, src1
, outf
);
526 decode_optmode (int mod
, int MM
, disassemble_info
*outf
)
528 if (mod
== 0 && MM
== 0)
543 OUTS (outf
, "S2RND");
546 else if (mod
== M_W32
)
548 else if (mod
== M_FU
)
550 else if (mod
== M_TFU
)
552 else if (mod
== M_IS
)
554 else if (mod
== M_ISS2
)
556 else if (mod
== M_IH
)
558 else if (mod
== M_IU
)
567 decode_ProgCtrl_0 (TIword iw0
, disassemble_info
*outf
)
570 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |.prgfunc.......|.poprnd........|
572 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
573 int poprnd
= ((iw0
>> ProgCtrl_poprnd_bits
) & ProgCtrl_poprnd_mask
);
574 int prgfunc
= ((iw0
>> ProgCtrl_prgfunc_bits
) & ProgCtrl_prgfunc_mask
);
576 if (prgfunc
== 0 && poprnd
== 0)
578 else if (prgfunc
== 1 && poprnd
== 0)
580 else if (prgfunc
== 1 && poprnd
== 1)
582 else if (prgfunc
== 1 && poprnd
== 2)
584 else if (prgfunc
== 1 && poprnd
== 3)
586 else if (prgfunc
== 1 && poprnd
== 4)
588 else if (prgfunc
== 2 && poprnd
== 0)
590 else if (prgfunc
== 2 && poprnd
== 3)
591 OUTS (outf
, "CSYNC");
592 else if (prgfunc
== 2 && poprnd
== 4)
593 OUTS (outf
, "SSYNC");
594 else if (prgfunc
== 2 && poprnd
== 5)
595 OUTS (outf
, "EMUEXCPT");
596 else if (prgfunc
== 3)
599 OUTS (outf
, dregs (poprnd
));
601 else if (prgfunc
== 4)
604 OUTS (outf
, dregs (poprnd
));
606 else if (prgfunc
== 5)
608 OUTS (outf
, "JUMP (");
609 OUTS (outf
, pregs (poprnd
));
612 else if (prgfunc
== 6)
614 OUTS (outf
, "CALL (");
615 OUTS (outf
, pregs (poprnd
));
618 else if (prgfunc
== 7)
620 OUTS (outf
, "CALL (PC+");
621 OUTS (outf
, pregs (poprnd
));
624 else if (prgfunc
== 8)
626 OUTS (outf
, "JUMP (PC+");
627 OUTS (outf
, pregs (poprnd
));
630 else if (prgfunc
== 9)
632 OUTS (outf
, "RAISE ");
633 OUTS (outf
, uimm4 (poprnd
));
635 else if (prgfunc
== 10)
637 OUTS (outf
, "EXCPT ");
638 OUTS (outf
, uimm4 (poprnd
));
640 else if (prgfunc
== 11)
642 OUTS (outf
, "TESTSET (");
643 OUTS (outf
, pregs (poprnd
));
652 decode_CaCTRL_0 (TIword iw0
, disassemble_info
*outf
)
655 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
656 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 |.a.|.op....|.reg.......|
657 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
658 int a
= ((iw0
>> CaCTRL_a_bits
) & CaCTRL_a_mask
);
659 int op
= ((iw0
>> CaCTRL_op_bits
) & CaCTRL_op_mask
);
660 int reg
= ((iw0
>> CaCTRL_reg_bits
) & CaCTRL_reg_mask
);
662 if (a
== 0 && op
== 0)
664 OUTS (outf
, "PREFETCH[");
665 OUTS (outf
, pregs (reg
));
668 else if (a
== 0 && op
== 1)
670 OUTS (outf
, "FLUSHINV[");
671 OUTS (outf
, pregs (reg
));
674 else if (a
== 0 && op
== 2)
676 OUTS (outf
, "FLUSH[");
677 OUTS (outf
, pregs (reg
));
680 else if (a
== 0 && op
== 3)
682 OUTS (outf
, "IFLUSH[");
683 OUTS (outf
, pregs (reg
));
686 else if (a
== 1 && op
== 0)
688 OUTS (outf
, "PREFETCH[");
689 OUTS (outf
, pregs (reg
));
692 else if (a
== 1 && op
== 1)
694 OUTS (outf
, "FLUSHINV[");
695 OUTS (outf
, pregs (reg
));
698 else if (a
== 1 && op
== 2)
700 OUTS (outf
, "FLUSH[");
701 OUTS (outf
, pregs (reg
));
704 else if (a
== 1 && op
== 3)
706 OUTS (outf
, "IFLUSH[");
707 OUTS (outf
, pregs (reg
));
716 decode_PushPopReg_0 (TIword iw0
, disassemble_info
*outf
)
719 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
720 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |.W.|.grp.......|.reg.......|
721 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
722 int W
= ((iw0
>> PushPopReg_W_bits
) & PushPopReg_W_mask
);
723 int grp
= ((iw0
>> PushPopReg_grp_bits
) & PushPopReg_grp_mask
);
724 int reg
= ((iw0
>> PushPopReg_reg_bits
) & PushPopReg_reg_mask
);
728 OUTS (outf
, allregs (reg
, grp
));
729 OUTS (outf
, " = [SP++]");
733 OUTS (outf
, "[--SP] = ");
734 OUTS (outf
, allregs (reg
, grp
));
742 decode_PushPopMultiple_0 (TIword iw0
, disassemble_info
*outf
)
745 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
746 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |.d.|.p.|.W.|.dr........|.pr........|
747 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
748 int p
= ((iw0
>> PushPopMultiple_p_bits
) & PushPopMultiple_p_mask
);
749 int d
= ((iw0
>> PushPopMultiple_d_bits
) & PushPopMultiple_d_mask
);
750 int W
= ((iw0
>> PushPopMultiple_W_bits
) & PushPopMultiple_W_mask
);
751 int dr
= ((iw0
>> PushPopMultiple_dr_bits
) & PushPopMultiple_dr_mask
);
752 int pr
= ((iw0
>> PushPopMultiple_pr_bits
) & PushPopMultiple_pr_mask
);
755 sprintf (ps
, "%d", pr
);
756 sprintf (ds
, "%d", dr
);
758 if (W
== 1 && d
== 1 && p
== 1)
760 OUTS (outf
, "[--SP] = (R7:");
762 OUTS (outf
, ", P5:");
766 else if (W
== 1 && d
== 1 && p
== 0)
768 OUTS (outf
, "[--SP] = (R7:");
772 else if (W
== 1 && d
== 0 && p
== 1)
774 OUTS (outf
, "[--SP] = (P5:");
778 else if (W
== 0 && d
== 1 && p
== 1)
782 OUTS (outf
, ", P5:");
784 OUTS (outf
, ") = [SP++]");
786 else if (W
== 0 && d
== 1 && p
== 0)
790 OUTS (outf
, ") = [SP++]");
792 else if (W
== 0 && d
== 0 && p
== 1)
796 OUTS (outf
, ") = [SP++]");
804 decode_ccMV_0 (TIword iw0
, disassemble_info
*outf
)
807 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
808 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |.T.|.d.|.s.|.dst.......|.src.......|
809 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
810 int s
= ((iw0
>> CCmv_s_bits
) & CCmv_s_mask
);
811 int d
= ((iw0
>> CCmv_d_bits
) & CCmv_d_mask
);
812 int T
= ((iw0
>> CCmv_T_bits
) & CCmv_T_mask
);
813 int src
= ((iw0
>> CCmv_src_bits
) & CCmv_src_mask
);
814 int dst
= ((iw0
>> CCmv_dst_bits
) & CCmv_dst_mask
);
818 OUTS (outf
, "IF CC ");
819 OUTS (outf
, gregs (dst
, d
));
821 OUTS (outf
, gregs (src
, s
));
825 OUTS (outf
, "IF ! CC ");
826 OUTS (outf
, gregs (dst
, d
));
828 OUTS (outf
, gregs (src
, s
));
836 decode_CCflag_0 (TIword iw0
, disassemble_info
*outf
)
839 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
840 | 0 | 0 | 0 | 0 | 1 |.I.|.opc.......|.G.|.y.........|.x.........|
841 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
842 int x
= ((iw0
>> CCflag_x_bits
) & CCflag_x_mask
);
843 int y
= ((iw0
>> CCflag_y_bits
) & CCflag_y_mask
);
844 int I
= ((iw0
>> CCflag_I_bits
) & CCflag_I_mask
);
845 int G
= ((iw0
>> CCflag_G_bits
) & CCflag_G_mask
);
846 int opc
= ((iw0
>> CCflag_opc_bits
) & CCflag_opc_mask
);
848 if (opc
== 0 && I
== 0 && G
== 0)
851 OUTS (outf
, dregs (x
));
853 OUTS (outf
, dregs (y
));
855 else if (opc
== 1 && I
== 0 && G
== 0)
858 OUTS (outf
, dregs (x
));
860 OUTS (outf
, dregs (y
));
862 else if (opc
== 2 && I
== 0 && G
== 0)
865 OUTS (outf
, dregs (x
));
867 OUTS (outf
, dregs (y
));
869 else if (opc
== 3 && I
== 0 && G
== 0)
872 OUTS (outf
, dregs (x
));
874 OUTS (outf
, dregs (y
));
877 else if (opc
== 4 && I
== 0 && G
== 0)
880 OUTS (outf
, dregs (x
));
882 OUTS (outf
, dregs (y
));
885 else if (opc
== 0 && I
== 1 && G
== 0)
888 OUTS (outf
, dregs (x
));
890 OUTS (outf
, imm3 (y
));
892 else if (opc
== 1 && I
== 1 && G
== 0)
895 OUTS (outf
, dregs (x
));
897 OUTS (outf
, imm3 (y
));
899 else if (opc
== 2 && I
== 1 && G
== 0)
902 OUTS (outf
, dregs (x
));
904 OUTS (outf
, imm3 (y
));
906 else if (opc
== 3 && I
== 1 && G
== 0)
909 OUTS (outf
, dregs (x
));
911 OUTS (outf
, uimm3 (y
));
914 else if (opc
== 4 && I
== 1 && G
== 0)
917 OUTS (outf
, dregs (x
));
919 OUTS (outf
, uimm3 (y
));
922 else if (opc
== 0 && I
== 0 && G
== 1)
925 OUTS (outf
, pregs (x
));
927 OUTS (outf
, pregs (y
));
929 else if (opc
== 1 && I
== 0 && G
== 1)
932 OUTS (outf
, pregs (x
));
934 OUTS (outf
, pregs (y
));
936 else if (opc
== 2 && I
== 0 && G
== 1)
939 OUTS (outf
, pregs (x
));
941 OUTS (outf
, pregs (y
));
943 else if (opc
== 3 && I
== 0 && G
== 1)
946 OUTS (outf
, pregs (x
));
948 OUTS (outf
, pregs (y
));
951 else if (opc
== 4 && I
== 0 && G
== 1)
954 OUTS (outf
, pregs (x
));
956 OUTS (outf
, pregs (y
));
959 else if (opc
== 0 && I
== 1 && G
== 1)
962 OUTS (outf
, pregs (x
));
964 OUTS (outf
, imm3 (y
));
966 else if (opc
== 1 && I
== 1 && G
== 1)
969 OUTS (outf
, pregs (x
));
971 OUTS (outf
, imm3 (y
));
973 else if (opc
== 2 && I
== 1 && G
== 1)
976 OUTS (outf
, pregs (x
));
978 OUTS (outf
, imm3 (y
));
980 else if (opc
== 3 && I
== 1 && G
== 1)
983 OUTS (outf
, pregs (x
));
985 OUTS (outf
, uimm3 (y
));
988 else if (opc
== 4 && I
== 1 && G
== 1)
991 OUTS (outf
, pregs (x
));
993 OUTS (outf
, uimm3 (y
));
996 else if (opc
== 5 && I
== 0 && G
== 0)
997 OUTS (outf
, "CC=A0==A1");
999 else if (opc
== 6 && I
== 0 && G
== 0)
1000 OUTS (outf
, "CC=A0<A1");
1002 else if (opc
== 7 && I
== 0 && G
== 0)
1003 OUTS (outf
, "CC=A0<=A1");
1011 decode_CC2dreg_0 (TIword iw0
, disassemble_info
*outf
)
1014 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1015 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |.op....|.reg.......|
1016 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1017 int op
= ((iw0
>> CC2dreg_op_bits
) & CC2dreg_op_mask
);
1018 int reg
= ((iw0
>> CC2dreg_reg_bits
) & CC2dreg_reg_mask
);
1022 OUTS (outf
, dregs (reg
));
1028 OUTS (outf
, dregs (reg
));
1031 OUTS (outf
, "CC=!CC");
1039 decode_CC2stat_0 (TIword iw0
, disassemble_info
*outf
)
1042 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1043 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |.D.|.op....|.cbit..............|
1044 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1045 int D
= ((iw0
>> CC2stat_D_bits
) & CC2stat_D_mask
);
1046 int op
= ((iw0
>> CC2stat_op_bits
) & CC2stat_op_mask
);
1047 int cbit
= ((iw0
>> CC2stat_cbit_bits
) & CC2stat_cbit_mask
);
1049 if (op
== 0 && D
== 0)
1051 OUTS (outf
, "CC = ");
1052 OUTS (outf
, statbits (cbit
));
1054 else if (op
== 1 && D
== 0)
1056 OUTS (outf
, "CC|=");
1057 OUTS (outf
, statbits (cbit
));
1059 else if (op
== 2 && D
== 0)
1061 OUTS (outf
, "CC&=");
1062 OUTS (outf
, statbits (cbit
));
1064 else if (op
== 3 && D
== 0)
1066 OUTS (outf
, "CC^=");
1067 OUTS (outf
, statbits (cbit
));
1069 else if (op
== 0 && D
== 1)
1071 OUTS (outf
, statbits (cbit
));
1074 else if (op
== 1 && D
== 1)
1076 OUTS (outf
, statbits (cbit
));
1077 OUTS (outf
, "|=CC");
1079 else if (op
== 2 && D
== 1)
1081 OUTS (outf
, statbits (cbit
));
1082 OUTS (outf
, "&=CC");
1084 else if (op
== 3 && D
== 1)
1086 OUTS (outf
, statbits (cbit
));
1087 OUTS (outf
, "^=CC");
1096 decode_BRCC_0 (TIword iw0
, bfd_vma pc
, disassemble_info
*outf
)
1099 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1100 | 0 | 0 | 0 | 1 |.T.|.B.|.offset................................|
1101 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1102 int B
= ((iw0
>> BRCC_B_bits
) & BRCC_B_mask
);
1103 int T
= ((iw0
>> BRCC_T_bits
) & BRCC_T_mask
);
1104 int offset
= ((iw0
>> BRCC_offset_bits
) & BRCC_offset_mask
);
1106 if (T
== 1 && B
== 1)
1108 OUTS (outf
, "IF CC JUMP ");
1109 OUTS (outf
, pcrel10 (offset
));
1110 OUTS (outf
, "(BP)");
1112 else if (T
== 0 && B
== 1)
1114 OUTS (outf
, "IF ! CC JUMP ");
1115 OUTS (outf
, pcrel10 (offset
));
1116 OUTS (outf
, "(BP)");
1120 OUTS (outf
, "IF CC JUMP ");
1121 OUTS (outf
, pcrel10 (offset
));
1125 OUTS (outf
, "IF ! CC JUMP ");
1126 OUTS (outf
, pcrel10 (offset
));
1135 decode_UJUMP_0 (TIword iw0
, bfd_vma pc
, disassemble_info
*outf
)
1138 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1139 | 0 | 0 | 1 | 0 |.offset........................................|
1140 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1141 int offset
= ((iw0
>> UJump_offset_bits
) & UJump_offset_mask
);
1143 OUTS (outf
, "JUMP.S ");
1144 OUTS (outf
, pcrel12 (offset
));
1149 decode_REGMV_0 (TIword iw0
, disassemble_info
*outf
)
1152 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1153 | 0 | 0 | 1 | 1 |.gd........|.gs........|.dst.......|.src.......|
1154 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1155 int gs
= ((iw0
>> RegMv_gs_bits
) & RegMv_gs_mask
);
1156 int gd
= ((iw0
>> RegMv_gd_bits
) & RegMv_gd_mask
);
1157 int src
= ((iw0
>> RegMv_src_bits
) & RegMv_src_mask
);
1158 int dst
= ((iw0
>> RegMv_dst_bits
) & RegMv_dst_mask
);
1160 OUTS (outf
, allregs (dst
, gd
));
1162 OUTS (outf
, allregs (src
, gs
));
1167 decode_ALU2op_0 (TIword iw0
, disassemble_info
*outf
)
1170 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1171 | 0 | 1 | 0 | 0 | 0 | 0 |.opc...........|.src.......|.dst.......|
1172 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1173 int src
= ((iw0
>> ALU2op_src_bits
) & ALU2op_src_mask
);
1174 int opc
= ((iw0
>> ALU2op_opc_bits
) & ALU2op_opc_mask
);
1175 int dst
= ((iw0
>> ALU2op_dst_bits
) & ALU2op_dst_mask
);
1179 OUTS (outf
, dregs (dst
));
1180 OUTS (outf
, ">>>=");
1181 OUTS (outf
, dregs (src
));
1185 OUTS (outf
, dregs (dst
));
1187 OUTS (outf
, dregs (src
));
1191 OUTS (outf
, dregs (dst
));
1193 OUTS (outf
, dregs (src
));
1197 OUTS (outf
, dregs (dst
));
1199 OUTS (outf
, dregs (src
));
1203 OUTS (outf
, dregs (dst
));
1205 OUTS (outf
, dregs (dst
));
1207 OUTS (outf
, dregs (src
));
1208 OUTS (outf
, ")<<1");
1212 OUTS (outf
, dregs (dst
));
1214 OUTS (outf
, dregs (dst
));
1216 OUTS (outf
, dregs (src
));
1217 OUTS (outf
, ")<<2");
1221 OUTS (outf
, "DIVQ(");
1222 OUTS (outf
, dregs (dst
));
1224 OUTS (outf
, dregs (src
));
1229 OUTS (outf
, "DIVS(");
1230 OUTS (outf
, dregs (dst
));
1232 OUTS (outf
, dregs (src
));
1237 OUTS (outf
, dregs (dst
));
1239 OUTS (outf
, dregs_lo (src
));
1244 OUTS (outf
, dregs (dst
));
1246 OUTS (outf
, dregs_lo (src
));
1251 OUTS (outf
, dregs (dst
));
1253 OUTS (outf
, dregs_byte (src
));
1258 OUTS (outf
, dregs (dst
));
1260 OUTS (outf
, dregs_byte (src
));
1265 OUTS (outf
, dregs (dst
));
1267 OUTS (outf
, dregs (src
));
1271 OUTS (outf
, dregs (dst
));
1273 OUTS (outf
, dregs (src
));
1282 decode_PTR2op_0 (TIword iw0
, disassemble_info
*outf
)
1285 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1286 | 0 | 1 | 0 | 0 | 0 | 1 | 0 |.opc.......|.src.......|.dst.......|
1287 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1288 int src
= ((iw0
>> PTR2op_src_bits
) & PTR2op_dst_mask
);
1289 int opc
= ((iw0
>> PTR2op_opc_bits
) & PTR2op_opc_mask
);
1290 int dst
= ((iw0
>> PTR2op_dst_bits
) & PTR2op_dst_mask
);
1294 OUTS (outf
, pregs (dst
));
1296 OUTS (outf
, pregs (src
));
1300 OUTS (outf
, pregs (dst
));
1302 OUTS (outf
, pregs (src
));
1307 OUTS (outf
, pregs (dst
));
1309 OUTS (outf
, pregs (src
));
1314 OUTS (outf
, pregs (dst
));
1316 OUTS (outf
, pregs (src
));
1321 OUTS (outf
, pregs (dst
));
1323 OUTS (outf
, pregs (src
));
1324 OUTS (outf
, "(BREV)");
1328 OUTS (outf
, pregs (dst
));
1330 OUTS (outf
, pregs (dst
));
1332 OUTS (outf
, pregs (src
));
1333 OUTS (outf
, ")<<1");
1337 OUTS (outf
, pregs (dst
));
1339 OUTS (outf
, pregs (dst
));
1341 OUTS (outf
, pregs (src
));
1342 OUTS (outf
, ")<<2");
1351 decode_LOGI2op_0 (TIword iw0
, disassemble_info
*outf
)
1354 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1355 | 0 | 1 | 0 | 0 | 1 |.opc.......|.src...............|.dst.......|
1356 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1357 int src
= ((iw0
>> LOGI2op_src_bits
) & LOGI2op_src_mask
);
1358 int opc
= ((iw0
>> LOGI2op_opc_bits
) & LOGI2op_opc_mask
);
1359 int dst
= ((iw0
>> LOGI2op_dst_bits
) & LOGI2op_dst_mask
);
1363 OUTS (outf
, "CC = ! BITTST (");
1364 OUTS (outf
, dregs (dst
));
1366 OUTS (outf
, uimm5 (src
));
1371 OUTS (outf
, "CC = BITTST (");
1372 OUTS (outf
, dregs (dst
));
1374 OUTS (outf
, uimm5 (src
));
1379 OUTS (outf
, "BITSET (");
1380 OUTS (outf
, dregs (dst
));
1382 OUTS (outf
, uimm5 (src
));
1387 OUTS (outf
, "BITTGL (");
1388 OUTS (outf
, dregs (dst
));
1390 OUTS (outf
, uimm5 (src
));
1395 OUTS (outf
, "BITCLR (");
1396 OUTS (outf
, dregs (dst
));
1398 OUTS (outf
, uimm5 (src
));
1403 OUTS (outf
, dregs (dst
));
1404 OUTS (outf
, ">>>=");
1405 OUTS (outf
, uimm5 (src
));
1409 OUTS (outf
, dregs (dst
));
1411 OUTS (outf
, uimm5 (src
));
1415 OUTS (outf
, dregs (dst
));
1417 OUTS (outf
, uimm5 (src
));
1426 decode_COMP3op_0 (TIword iw0
, disassemble_info
*outf
)
1429 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1430 | 0 | 1 | 0 | 1 |.opc.......|.dst.......|.src1......|.src0......|
1431 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1432 int opc
= ((iw0
>> COMP3op_opc_bits
) & COMP3op_opc_mask
);
1433 int dst
= ((iw0
>> COMP3op_dst_bits
) & COMP3op_dst_mask
);
1434 int src0
= ((iw0
>> COMP3op_src0_bits
) & COMP3op_src0_mask
);
1435 int src1
= ((iw0
>> COMP3op_src1_bits
) & COMP3op_src1_mask
);
1437 if (opc
== 5 && src1
== src0
)
1439 OUTS (outf
, pregs (dst
));
1441 OUTS (outf
, pregs (src0
));
1446 OUTS (outf
, dregs (dst
));
1448 OUTS (outf
, dregs (src0
));
1450 OUTS (outf
, dregs (src1
));
1454 OUTS (outf
, dregs (dst
));
1456 OUTS (outf
, dregs (src0
));
1458 OUTS (outf
, dregs (src1
));
1462 OUTS (outf
, dregs (dst
));
1464 OUTS (outf
, dregs (src0
));
1466 OUTS (outf
, dregs (src1
));
1470 OUTS (outf
, dregs (dst
));
1472 OUTS (outf
, dregs (src0
));
1474 OUTS (outf
, dregs (src1
));
1478 OUTS (outf
, pregs (dst
));
1480 OUTS (outf
, pregs (src0
));
1482 OUTS (outf
, pregs (src1
));
1486 OUTS (outf
, pregs (dst
));
1488 OUTS (outf
, pregs (src0
));
1490 OUTS (outf
, pregs (src1
));
1491 OUTS (outf
, "<<1)");
1495 OUTS (outf
, pregs (dst
));
1497 OUTS (outf
, pregs (src0
));
1499 OUTS (outf
, pregs (src1
));
1500 OUTS (outf
, "<<2)");
1504 OUTS (outf
, dregs (dst
));
1506 OUTS (outf
, dregs (src0
));
1508 OUTS (outf
, dregs (src1
));
1517 decode_COMPI2opD_0 (TIword iw0
, disassemble_info
*outf
)
1520 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1521 | 0 | 1 | 1 | 0 | 0 |.op|..src......................|.dst.......|
1522 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1523 int op
= ((iw0
>> COMPI2opD_op_bits
) & COMPI2opD_op_mask
);
1524 int dst
= ((iw0
>> COMPI2opD_dst_bits
) & COMPI2opD_dst_mask
);
1525 int src
= ((iw0
>> COMPI2opD_src_bits
) & COMPI2opD_src_mask
);
1529 OUTS (outf
, dregs (dst
));
1531 OUTS (outf
, imm7 (src
));
1536 OUTS (outf
, dregs (dst
));
1538 OUTS (outf
, imm7 (src
));
1547 decode_COMPI2opP_0 (TIword iw0
, disassemble_info
*outf
)
1550 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1551 | 0 | 1 | 1 | 0 | 1 |.op|.src.......................|.dst.......|
1552 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1553 int op
= ((iw0
>> COMPI2opP_op_bits
) & COMPI2opP_op_mask
);
1554 int src
= ((iw0
>> COMPI2opP_src_bits
) & COMPI2opP_src_mask
);
1555 int dst
= ((iw0
>> COMPI2opP_dst_bits
) & COMPI2opP_dst_mask
);
1559 OUTS (outf
, pregs (dst
));
1561 OUTS (outf
, imm7 (src
));
1565 OUTS (outf
, pregs (dst
));
1567 OUTS (outf
, imm7 (src
));
1576 decode_LDSTpmod_0 (TIword iw0
, disassemble_info
*outf
)
1579 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1580 | 1 | 0 | 0 | 0 |.W.|.aop...|.reg.......|.idx.......|.ptr.......|
1581 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1582 int W
= ((iw0
>> LDSTpmod_W_bits
) & LDSTpmod_W_mask
);
1583 int aop
= ((iw0
>> LDSTpmod_aop_bits
) & LDSTpmod_aop_mask
);
1584 int idx
= ((iw0
>> LDSTpmod_idx_bits
) & LDSTpmod_idx_mask
);
1585 int ptr
= ((iw0
>> LDSTpmod_ptr_bits
) & LDSTpmod_ptr_mask
);
1586 int reg
= ((iw0
>> LDSTpmod_reg_bits
) & LDSTpmod_reg_mask
);
1588 if (aop
== 1 && W
== 0 && idx
== ptr
)
1590 OUTS (outf
, dregs_lo (reg
));
1592 OUTS (outf
, pregs (ptr
));
1595 else if (aop
== 2 && W
== 0 && idx
== ptr
)
1597 OUTS (outf
, dregs_hi (reg
));
1599 OUTS (outf
, pregs (ptr
));
1602 else if (aop
== 1 && W
== 1 && idx
== ptr
)
1605 OUTS (outf
, pregs (ptr
));
1607 OUTS (outf
, dregs_lo (reg
));
1609 else if (aop
== 2 && W
== 1 && idx
== ptr
)
1612 OUTS (outf
, pregs (ptr
));
1614 OUTS (outf
, dregs_hi (reg
));
1616 else if (aop
== 0 && W
== 0)
1618 OUTS (outf
, dregs (reg
));
1620 OUTS (outf
, pregs (ptr
));
1622 OUTS (outf
, pregs (idx
));
1625 else if (aop
== 1 && W
== 0)
1627 OUTS (outf
, dregs_lo (reg
));
1629 OUTS (outf
, pregs (ptr
));
1631 OUTS (outf
, pregs (idx
));
1634 else if (aop
== 2 && W
== 0)
1636 OUTS (outf
, dregs_hi (reg
));
1638 OUTS (outf
, pregs (ptr
));
1640 OUTS (outf
, pregs (idx
));
1643 else if (aop
== 3 && W
== 0)
1645 OUTS (outf
, dregs (reg
));
1647 OUTS (outf
, pregs (ptr
));
1649 OUTS (outf
, pregs (idx
));
1650 OUTS (outf
, "] (Z)");
1652 else if (aop
== 3 && W
== 1)
1654 OUTS (outf
, dregs (reg
));
1656 OUTS (outf
, pregs (ptr
));
1658 OUTS (outf
, pregs (idx
));
1659 OUTS (outf
, "](X)");
1661 else if (aop
== 0 && W
== 1)
1664 OUTS (outf
, pregs (ptr
));
1666 OUTS (outf
, pregs (idx
));
1668 OUTS (outf
, dregs (reg
));
1670 else if (aop
== 1 && W
== 1)
1673 OUTS (outf
, pregs (ptr
));
1675 OUTS (outf
, pregs (idx
));
1677 OUTS (outf
, dregs_lo (reg
));
1679 else if (aop
== 2 && W
== 1)
1682 OUTS (outf
, pregs (ptr
));
1684 OUTS (outf
, pregs (idx
));
1686 OUTS (outf
, dregs_hi (reg
));
1695 decode_dagMODim_0 (TIword iw0
, disassemble_info
*outf
)
1698 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1699 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 |.br| 1 | 1 |.op|.m.....|.i.....|
1700 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1701 int i
= ((iw0
>> DagMODim_i_bits
) & DagMODim_i_mask
);
1702 int m
= ((iw0
>> DagMODim_m_bits
) & DagMODim_m_mask
);
1703 int br
= ((iw0
>> DagMODim_br_bits
) & DagMODim_br_mask
);
1704 int op
= ((iw0
>> DagMODim_op_bits
) & DagMODim_op_mask
);
1706 if (op
== 0 && br
== 1)
1708 OUTS (outf
, iregs (i
));
1710 OUTS (outf
, mregs (m
));
1711 OUTS (outf
, "(BREV)");
1715 OUTS (outf
, iregs (i
));
1717 OUTS (outf
, mregs (m
));
1721 OUTS (outf
, iregs (i
));
1723 OUTS (outf
, mregs (m
));
1732 decode_dagMODik_0 (TIword iw0
, disassemble_info
*outf
)
1735 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1736 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 0 |.op....|.i.....|
1737 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1738 int i
= ((iw0
>> DagMODik_i_bits
) & DagMODik_i_mask
);
1739 int op
= ((iw0
>> DagMODik_op_bits
) & DagMODik_op_mask
);
1743 OUTS (outf
, iregs (i
));
1748 OUTS (outf
, iregs (i
));
1753 OUTS (outf
, iregs (i
));
1758 OUTS (outf
, iregs (i
));
1768 decode_dspLDST_0 (TIword iw0
, disassemble_info
*outf
)
1771 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1772 | 1 | 0 | 0 | 1 | 1 | 1 |.W.|.aop...|.m.....|.i.....|.reg.......|
1773 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1774 int i
= ((iw0
>> DspLDST_i_bits
) & DspLDST_i_mask
);
1775 int m
= ((iw0
>> DspLDST_m_bits
) & DspLDST_m_mask
);
1776 int W
= ((iw0
>> DspLDST_W_bits
) & DspLDST_W_mask
);
1777 int aop
= ((iw0
>> DspLDST_aop_bits
) & DspLDST_aop_mask
);
1778 int reg
= ((iw0
>> DspLDST_reg_bits
) & DspLDST_reg_mask
);
1780 if (aop
== 0 && W
== 0 && m
== 0)
1782 OUTS (outf
, dregs (reg
));
1784 OUTS (outf
, iregs (i
));
1787 else if (aop
== 0 && W
== 0 && m
== 1)
1789 OUTS (outf
, dregs_lo (reg
));
1791 OUTS (outf
, iregs (i
));
1794 else if (aop
== 0 && W
== 0 && m
== 2)
1796 OUTS (outf
, dregs_hi (reg
));
1798 OUTS (outf
, iregs (i
));
1801 else if (aop
== 1 && W
== 0 && m
== 0)
1803 OUTS (outf
, dregs (reg
));
1805 OUTS (outf
, iregs (i
));
1808 else if (aop
== 1 && W
== 0 && m
== 1)
1810 OUTS (outf
, dregs_lo (reg
));
1812 OUTS (outf
, iregs (i
));
1815 else if (aop
== 1 && W
== 0 && m
== 2)
1817 OUTS (outf
, dregs_hi (reg
));
1819 OUTS (outf
, iregs (i
));
1822 else if (aop
== 2 && W
== 0 && m
== 0)
1824 OUTS (outf
, dregs (reg
));
1826 OUTS (outf
, iregs (i
));
1829 else if (aop
== 2 && W
== 0 && m
== 1)
1831 OUTS (outf
, dregs_lo (reg
));
1833 OUTS (outf
, iregs (i
));
1836 else if (aop
== 2 && W
== 0 && m
== 2)
1838 OUTS (outf
, dregs_hi (reg
));
1840 OUTS (outf
, iregs (i
));
1843 else if (aop
== 0 && W
== 1 && m
== 0)
1846 OUTS (outf
, iregs (i
));
1847 OUTS (outf
, "++]=");
1848 OUTS (outf
, dregs (reg
));
1850 else if (aop
== 0 && W
== 1 && m
== 1)
1853 OUTS (outf
, iregs (i
));
1854 OUTS (outf
, "++]=");
1855 OUTS (outf
, dregs_lo (reg
));
1857 else if (aop
== 0 && W
== 1 && m
== 2)
1860 OUTS (outf
, iregs (i
));
1861 OUTS (outf
, "++]=");
1862 OUTS (outf
, dregs_hi (reg
));
1864 else if (aop
== 1 && W
== 1 && m
== 0)
1867 OUTS (outf
, iregs (i
));
1868 OUTS (outf
, "--]=");
1869 OUTS (outf
, dregs (reg
));
1871 else if (aop
== 1 && W
== 1 && m
== 1)
1874 OUTS (outf
, iregs (i
));
1875 OUTS (outf
, "--]=");
1876 OUTS (outf
, dregs_lo (reg
));
1878 else if (aop
== 1 && W
== 1 && m
== 2)
1881 OUTS (outf
, iregs (i
));
1882 OUTS (outf
, "--]=");
1883 OUTS (outf
, dregs_hi (reg
));
1885 else if (aop
== 2 && W
== 1 && m
== 0)
1888 OUTS (outf
, iregs (i
));
1890 OUTS (outf
, dregs (reg
));
1892 else if (aop
== 2 && W
== 1 && m
== 1)
1895 OUTS (outf
, iregs (i
));
1897 OUTS (outf
, dregs_lo (reg
));
1899 else if (aop
== 2 && W
== 1 && m
== 2)
1902 OUTS (outf
, iregs (i
));
1904 OUTS (outf
, dregs_hi (reg
));
1906 else if (aop
== 3 && W
== 0)
1908 OUTS (outf
, dregs (reg
));
1910 OUTS (outf
, iregs (i
));
1912 OUTS (outf
, mregs (m
));
1915 else if (aop
== 3 && W
== 1)
1918 OUTS (outf
, iregs (i
));
1920 OUTS (outf
, mregs (m
));
1922 OUTS (outf
, dregs (reg
));
1931 decode_LDST_0 (TIword iw0
, disassemble_info
*outf
)
1934 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1935 | 1 | 0 | 0 | 1 |.sz....|.W.|.aop...|.Z.|.ptr.......|.reg.......|
1936 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1937 int Z
= ((iw0
>> LDST_Z_bits
) & LDST_Z_mask
);
1938 int W
= ((iw0
>> LDST_W_bits
) & LDST_W_mask
);
1939 int sz
= ((iw0
>> LDST_sz_bits
) & LDST_sz_mask
);
1940 int aop
= ((iw0
>> LDST_aop_bits
) & LDST_aop_mask
);
1941 int reg
= ((iw0
>> LDST_reg_bits
) & LDST_reg_mask
);
1942 int ptr
= ((iw0
>> LDST_ptr_bits
) & LDST_ptr_mask
);
1944 if (aop
== 0 && sz
== 0 && Z
== 0 && W
== 0)
1946 OUTS (outf
, dregs (reg
));
1948 OUTS (outf
, pregs (ptr
));
1951 else if (aop
== 0 && sz
== 0 && Z
== 1 && W
== 0)
1953 OUTS (outf
, pregs (reg
));
1955 OUTS (outf
, pregs (ptr
));
1958 else if (aop
== 0 && sz
== 1 && Z
== 0 && W
== 0)
1960 OUTS (outf
, dregs (reg
));
1962 OUTS (outf
, pregs (ptr
));
1963 OUTS (outf
, "++] (Z)");
1965 else if (aop
== 0 && sz
== 1 && Z
== 1 && W
== 0)
1967 OUTS (outf
, dregs (reg
));
1969 OUTS (outf
, pregs (ptr
));
1970 OUTS (outf
, "++](X)");
1972 else if (aop
== 0 && sz
== 2 && Z
== 0 && W
== 0)
1974 OUTS (outf
, dregs (reg
));
1976 OUTS (outf
, pregs (ptr
));
1977 OUTS (outf
, "++] (Z)");
1979 else if (aop
== 0 && sz
== 2 && Z
== 1 && W
== 0)
1981 OUTS (outf
, dregs (reg
));
1983 OUTS (outf
, pregs (ptr
));
1984 OUTS (outf
, "++](X)");
1986 else if (aop
== 1 && sz
== 0 && Z
== 0 && W
== 0)
1988 OUTS (outf
, dregs (reg
));
1990 OUTS (outf
, pregs (ptr
));
1993 else if (aop
== 1 && sz
== 0 && Z
== 1 && W
== 0)
1995 OUTS (outf
, pregs (reg
));
1997 OUTS (outf
, pregs (ptr
));
2000 else if (aop
== 1 && sz
== 1 && Z
== 0 && W
== 0)
2002 OUTS (outf
, dregs (reg
));
2004 OUTS (outf
, pregs (ptr
));
2005 OUTS (outf
, "--] (Z)");
2007 else if (aop
== 1 && sz
== 1 && Z
== 1 && W
== 0)
2009 OUTS (outf
, dregs (reg
));
2011 OUTS (outf
, pregs (ptr
));
2012 OUTS (outf
, "--](X)");
2014 else if (aop
== 1 && sz
== 2 && Z
== 0 && W
== 0)
2016 OUTS (outf
, dregs (reg
));
2018 OUTS (outf
, pregs (ptr
));
2019 OUTS (outf
, "--] (Z)");
2021 else if (aop
== 1 && sz
== 2 && Z
== 1 && W
== 0)
2023 OUTS (outf
, dregs (reg
));
2025 OUTS (outf
, pregs (ptr
));
2026 OUTS (outf
, "--](X)");
2028 else if (aop
== 2 && sz
== 0 && Z
== 0 && W
== 0)
2030 OUTS (outf
, dregs (reg
));
2032 OUTS (outf
, pregs (ptr
));
2035 else if (aop
== 2 && sz
== 0 && Z
== 1 && W
== 0)
2037 OUTS (outf
, pregs (reg
));
2039 OUTS (outf
, pregs (ptr
));
2042 else if (aop
== 2 && sz
== 1 && Z
== 0 && W
== 0)
2044 OUTS (outf
, dregs (reg
));
2046 OUTS (outf
, pregs (ptr
));
2047 OUTS (outf
, "] (Z)");
2049 else if (aop
== 2 && sz
== 1 && Z
== 1 && W
== 0)
2051 OUTS (outf
, dregs (reg
));
2053 OUTS (outf
, pregs (ptr
));
2054 OUTS (outf
, "](X)");
2056 else if (aop
== 2 && sz
== 2 && Z
== 0 && W
== 0)
2058 OUTS (outf
, dregs (reg
));
2060 OUTS (outf
, pregs (ptr
));
2061 OUTS (outf
, "] (Z)");
2063 else if (aop
== 2 && sz
== 2 && Z
== 1 && W
== 0)
2065 OUTS (outf
, dregs (reg
));
2067 OUTS (outf
, pregs (ptr
));
2068 OUTS (outf
, "](X)");
2070 else if (aop
== 0 && sz
== 0 && Z
== 0 && W
== 1)
2073 OUTS (outf
, pregs (ptr
));
2074 OUTS (outf
, "++]=");
2075 OUTS (outf
, dregs (reg
));
2077 else if (aop
== 0 && sz
== 0 && Z
== 1 && W
== 1)
2080 OUTS (outf
, pregs (ptr
));
2081 OUTS (outf
, "++]=");
2082 OUTS (outf
, pregs (reg
));
2084 else if (aop
== 0 && sz
== 1 && Z
== 0 && W
== 1)
2087 OUTS (outf
, pregs (ptr
));
2088 OUTS (outf
, "++]=");
2089 OUTS (outf
, dregs (reg
));
2091 else if (aop
== 0 && sz
== 2 && Z
== 0 && W
== 1)
2094 OUTS (outf
, pregs (ptr
));
2095 OUTS (outf
, "++]=");
2096 OUTS (outf
, dregs (reg
));
2098 else if (aop
== 1 && sz
== 0 && Z
== 0 && W
== 1)
2101 OUTS (outf
, pregs (ptr
));
2102 OUTS (outf
, "--]=");
2103 OUTS (outf
, dregs (reg
));
2105 else if (aop
== 1 && sz
== 0 && Z
== 1 && W
== 1)
2108 OUTS (outf
, pregs (ptr
));
2109 OUTS (outf
, "--]=");
2110 OUTS (outf
, pregs (reg
));
2112 else if (aop
== 1 && sz
== 1 && Z
== 0 && W
== 1)
2115 OUTS (outf
, pregs (ptr
));
2116 OUTS (outf
, "--]=");
2117 OUTS (outf
, dregs (reg
));
2119 else if (aop
== 1 && sz
== 2 && Z
== 0 && W
== 1)
2122 OUTS (outf
, pregs (ptr
));
2123 OUTS (outf
, "--]=");
2124 OUTS (outf
, dregs (reg
));
2126 else if (aop
== 2 && sz
== 0 && Z
== 0 && W
== 1)
2129 OUTS (outf
, pregs (ptr
));
2131 OUTS (outf
, dregs (reg
));
2133 else if (aop
== 2 && sz
== 0 && Z
== 1 && W
== 1)
2136 OUTS (outf
, pregs (ptr
));
2138 OUTS (outf
, pregs (reg
));
2140 else if (aop
== 2 && sz
== 1 && Z
== 0 && W
== 1)
2143 OUTS (outf
, pregs (ptr
));
2145 OUTS (outf
, dregs (reg
));
2147 else if (aop
== 2 && sz
== 2 && Z
== 0 && W
== 1)
2150 OUTS (outf
, pregs (ptr
));
2152 OUTS (outf
, dregs (reg
));
2161 decode_LDSTiiFP_0 (TIword iw0
, disassemble_info
*outf
)
2164 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2165 | 1 | 0 | 1 | 1 | 1 | 0 |.W.|.offset............|.reg...........|
2166 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2167 int reg
= ((iw0
>> LDSTiiFP_reg_bits
) & LDSTiiFP_reg_mask
);
2168 int offset
= ((iw0
>> LDSTiiFP_offset_bits
) & LDSTiiFP_offset_mask
);
2169 int W
= ((iw0
>> LDSTiiFP_W_bits
) & LDSTiiFP_W_mask
);
2173 OUTS (outf
, dpregs (reg
));
2174 OUTS (outf
, "=[FP");
2175 OUTS (outf
, negimm5s4 (offset
));
2181 OUTS (outf
, negimm5s4 (offset
));
2183 OUTS (outf
, dpregs (reg
));
2192 decode_LDSTii_0 (TIword iw0
, disassemble_info
*outf
)
2195 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2196 | 1 | 0 | 1 |.W.|.op....|.offset........|.ptr.......|.reg.......|
2197 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2198 int reg
= ((iw0
>> LDSTii_reg_bit
) & LDSTii_reg_mask
);
2199 int ptr
= ((iw0
>> LDSTii_ptr_bit
) & LDSTii_ptr_mask
);
2200 int offset
= ((iw0
>> LDSTii_offset_bit
) & LDSTii_offset_mask
);
2201 int op
= ((iw0
>> LDSTii_op_bit
) & LDSTii_op_mask
);
2202 int W
= ((iw0
>> LDSTii_W_bit
) & LDSTii_W_mask
);
2204 if (W
== 0 && op
== 0)
2206 OUTS (outf
, dregs (reg
));
2208 OUTS (outf
, pregs (ptr
));
2210 OUTS (outf
, uimm4s4 (offset
));
2213 else if (W
== 0 && op
== 1)
2215 OUTS (outf
, dregs (reg
));
2217 OUTS (outf
, pregs (ptr
));
2219 OUTS (outf
, uimm4s2 (offset
));
2220 OUTS (outf
, "] (Z)");
2222 else if (W
== 0 && op
== 2)
2224 OUTS (outf
, dregs (reg
));
2226 OUTS (outf
, pregs (ptr
));
2228 OUTS (outf
, uimm4s2 (offset
));
2229 OUTS (outf
, "](X)");
2231 else if (W
== 0 && op
== 3)
2233 OUTS (outf
, pregs (reg
));
2235 OUTS (outf
, pregs (ptr
));
2237 OUTS (outf
, uimm4s4 (offset
));
2240 else if (W
== 1 && op
== 0)
2243 OUTS (outf
, pregs (ptr
));
2245 OUTS (outf
, uimm4s4 (offset
));
2247 OUTS (outf
, dregs (reg
));
2249 else if (W
== 1 && op
== 1)
2253 OUTS (outf
, pregs (ptr
));
2255 OUTS (outf
, uimm4s2 (offset
));
2258 OUTS (outf
, dregs (reg
));
2260 else if (W
== 1 && op
== 3)
2263 OUTS (outf
, pregs (ptr
));
2265 OUTS (outf
, uimm4s4 (offset
));
2267 OUTS (outf
, pregs (reg
));
2276 decode_LoopSetup_0 (TIword iw0
, TIword iw1
, bfd_vma pc
, disassemble_info
*outf
)
2279 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2280 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 |.rop...|.c.|.soffset.......|
2281 |.reg...........| - | - |.eoffset...............................|
2282 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2283 int c
= ((iw0
>> (LoopSetup_c_bits
- 16)) & LoopSetup_c_mask
);
2284 int reg
= ((iw1
>> LoopSetup_reg_bits
) & LoopSetup_reg_mask
);
2285 int rop
= ((iw0
>> (LoopSetup_rop_bits
- 16)) & LoopSetup_rop_mask
);
2286 int soffset
= ((iw0
>> (LoopSetup_soffset_bits
- 16)) & LoopSetup_soffset_mask
);
2287 int eoffset
= ((iw1
>> LoopSetup_eoffset_bits
) & LoopSetup_eoffset_mask
);
2291 OUTS (outf
, "LSETUP");
2293 OUTS (outf
, pcrel4 (soffset
));
2295 OUTS (outf
, lppcrel10 (eoffset
));
2297 OUTS (outf
, counters (c
));
2301 OUTS (outf
, "LSETUP");
2303 OUTS (outf
, pcrel4 (soffset
));
2305 OUTS (outf
, lppcrel10 (eoffset
));
2307 OUTS (outf
, counters (c
));
2309 OUTS (outf
, pregs (reg
));
2313 OUTS (outf
, "LSETUP");
2315 OUTS (outf
, pcrel4 (soffset
));
2317 OUTS (outf
, lppcrel10 (eoffset
));
2319 OUTS (outf
, counters (c
));
2321 OUTS (outf
, pregs (reg
));
2331 decode_LDIMMhalf_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2334 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2335 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 |.Z.|.H.|.S.|.grp...|.reg.......|
2336 |.hword.........................................................|
2337 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2338 int H
= ((iw0
>> (LDIMMhalf_H_bits
- 16)) & LDIMMhalf_H_mask
);
2339 int Z
= ((iw0
>> (LDIMMhalf_Z_bits
- 16)) & LDIMMhalf_Z_mask
);
2340 int S
= ((iw0
>> (LDIMMhalf_S_bits
- 16)) & LDIMMhalf_S_mask
);
2341 int reg
= ((iw0
>> (LDIMMhalf_reg_bits
- 16)) & LDIMMhalf_reg_mask
);
2342 int grp
= ((iw0
>> (LDIMMhalf_grp_bits
- 16)) & LDIMMhalf_grp_mask
);
2343 int hword
= ((iw1
>> LDIMMhalf_hword_bits
) & LDIMMhalf_hword_mask
);
2345 if (grp
== 0 && H
== 0 && S
== 0 && Z
== 0)
2347 OUTS (outf
, dregs_lo (reg
));
2349 OUTS (outf
, imm16 (hword
));
2351 else if (grp
== 0 && H
== 1 && S
== 0 && Z
== 0)
2353 OUTS (outf
, dregs_hi (reg
));
2355 OUTS (outf
, imm16 (hword
));
2357 else if (grp
== 0 && H
== 0 && S
== 1 && Z
== 0)
2359 OUTS (outf
, dregs (reg
));
2361 OUTS (outf
, imm16 (hword
));
2362 OUTS (outf
, " (X)");
2364 else if (H
== 0 && S
== 1 && Z
== 0)
2366 OUTS (outf
, regs (reg
, grp
));
2368 OUTS (outf
, imm16 (hword
));
2369 OUTS (outf
, " (X)");
2371 else if (H
== 0 && S
== 0 && Z
== 1)
2373 OUTS (outf
, regs (reg
, grp
));
2375 OUTS (outf
, luimm16 (hword
));
2378 else if (H
== 0 && S
== 0 && Z
== 0)
2380 OUTS (outf
, regs_lo (reg
, grp
));
2382 OUTS (outf
, luimm16 (hword
));
2384 else if (H
== 1 && S
== 0 && Z
== 0)
2386 OUTS (outf
, regs_hi (reg
, grp
));
2388 OUTS (outf
, huimm16 (hword
));
2397 decode_CALLa_0 (TIword iw0
, TIword iw1
, bfd_vma pc
, disassemble_info
*outf
)
2400 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2401 | 1 | 1 | 1 | 0 | 0 | 0 | 1 |.S.|.msw...........................|
2402 |.lsw...........................................................|
2403 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2404 int S
= ((iw0
>> (CALLa_S_bits
- 16)) & CALLa_S_mask
);
2405 int lsw
= ((iw1
>> 0) & 0xffff);
2406 int msw
= ((iw0
>> 0) & 0xff);
2409 OUTS (outf
, "CALL ");
2411 OUTS (outf
, "JUMP.L ");
2415 OUTS (outf
, pcrel24 (((msw
) << 16) | (lsw
)));
2420 decode_LDSTidxI_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2423 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2424 | 1 | 1 | 1 | 0 | 0 | 1 |.W.|.Z.|.sz....|.ptr.......|.reg.......|
2425 |.offset........................................................|
2426 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2427 int Z
= ((iw0
>> (LDSTidxI_Z_bits
- 16)) & LDSTidxI_Z_mask
);
2428 int W
= ((iw0
>> (LDSTidxI_W_bits
- 16)) & LDSTidxI_W_mask
);
2429 int sz
= ((iw0
>> (LDSTidxI_sz_bits
- 16)) & LDSTidxI_sz_mask
);
2430 int reg
= ((iw0
>> (LDSTidxI_reg_bits
- 16)) & LDSTidxI_reg_mask
);
2431 int ptr
= ((iw0
>> (LDSTidxI_ptr_bits
- 16)) & LDSTidxI_ptr_mask
);
2432 int offset
= ((iw1
>> LDSTidxI_offset_bits
) & LDSTidxI_offset_mask
);
2434 if (W
== 0 && sz
== 0 && Z
== 0)
2436 OUTS (outf
, dregs (reg
));
2438 OUTS (outf
, pregs (ptr
));
2440 OUTS (outf
, imm16s4 (offset
));
2443 else if (W
== 0 && sz
== 0 && Z
== 1)
2445 OUTS (outf
, pregs (reg
));
2447 OUTS (outf
, pregs (ptr
));
2449 OUTS (outf
, imm16s4 (offset
));
2452 else if (W
== 0 && sz
== 1 && Z
== 0)
2454 OUTS (outf
, dregs (reg
));
2456 OUTS (outf
, pregs (ptr
));
2458 OUTS (outf
, imm16s2 (offset
));
2459 OUTS (outf
, "] (Z)");
2461 else if (W
== 0 && sz
== 1 && Z
== 1)
2463 OUTS (outf
, dregs (reg
));
2465 OUTS (outf
, pregs (ptr
));
2467 OUTS (outf
, imm16s2 (offset
));
2468 OUTS (outf
, "](X)");
2470 else if (W
== 0 && sz
== 2 && Z
== 0)
2472 OUTS (outf
, dregs (reg
));
2474 OUTS (outf
, pregs (ptr
));
2476 OUTS (outf
, imm16 (offset
));
2477 OUTS (outf
, "] (Z)");
2479 else if (W
== 0 && sz
== 2 && Z
== 1)
2481 OUTS (outf
, dregs (reg
));
2483 OUTS (outf
, pregs (ptr
));
2485 OUTS (outf
, imm16 (offset
));
2486 OUTS (outf
, "](X)");
2488 else if (W
== 1 && sz
== 0 && Z
== 0)
2491 OUTS (outf
, pregs (ptr
));
2493 OUTS (outf
, imm16s4 (offset
));
2495 OUTS (outf
, dregs (reg
));
2497 else if (W
== 1 && sz
== 0 && Z
== 1)
2500 OUTS (outf
, pregs (ptr
));
2502 OUTS (outf
, imm16s4 (offset
));
2504 OUTS (outf
, pregs (reg
));
2506 else if (W
== 1 && sz
== 1 && Z
== 0)
2509 OUTS (outf
, pregs (ptr
));
2511 OUTS (outf
, imm16s2 (offset
));
2513 OUTS (outf
, dregs (reg
));
2515 else if (W
== 1 && sz
== 2 && Z
== 0)
2518 OUTS (outf
, pregs (ptr
));
2520 OUTS (outf
, imm16 (offset
));
2522 OUTS (outf
, dregs (reg
));
2531 decode_linkage_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2534 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2535 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |.R.|
2536 |.framesize.....................................................|
2537 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2538 int R
= ((iw0
>> (Linkage_R_bits
- 16)) & Linkage_R_mask
);
2539 int framesize
= ((iw1
>> Linkage_framesize_bits
) & Linkage_framesize_mask
);
2543 OUTS (outf
, "LINK ");
2544 OUTS (outf
, uimm16s4 (framesize
));
2547 OUTS (outf
, "UNLINK");
2555 decode_dsp32mac_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2558 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2559 | 1 | 1 | 0 | 0 |.M.| 0 | 0 |.mmod..........|.MM|.P.|.w1|.op1...|
2560 |.h01|.h11|.w0|.op0...|.h00|.h10|.dst.......|.src0......|.src1..|
2561 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2562 int op1
= ((iw0
>> (DSP32Mac_op1_bits
- 16)) & DSP32Mac_op1_mask
);
2563 int w1
= ((iw0
>> (DSP32Mac_w1_bits
- 16)) & DSP32Mac_w1_mask
);
2564 int P
= ((iw0
>> (DSP32Mac_p_bits
- 16)) & DSP32Mac_p_mask
);
2565 int MM
= ((iw0
>> (DSP32Mac_MM_bits
- 16)) & DSP32Mac_MM_mask
);
2566 int mmod
= ((iw0
>> (DSP32Mac_mmod_bits
- 16)) & DSP32Mac_mmod_mask
);
2567 int w0
= ((iw1
>> DSP32Mac_w0_bits
) & DSP32Mac_w0_mask
);
2568 int src0
= ((iw1
>> DSP32Mac_src0_bits
) & DSP32Mac_src0_mask
);
2569 int src1
= ((iw1
>> DSP32Mac_src1_bits
) & DSP32Mac_src1_mask
);
2570 int dst
= ((iw1
>> DSP32Mac_dst_bits
) & DSP32Mac_dst_mask
);
2571 int h10
= ((iw1
>> DSP32Mac_h10_bits
) & DSP32Mac_h10_mask
);
2572 int h00
= ((iw1
>> DSP32Mac_h00_bits
) & DSP32Mac_h00_mask
);
2573 int op0
= ((iw1
>> DSP32Mac_op0_bits
) & DSP32Mac_op0_mask
);
2574 int h11
= ((iw1
>> DSP32Mac_h11_bits
) & DSP32Mac_h11_mask
);
2575 int h01
= ((iw1
>> DSP32Mac_h01_bits
) & DSP32Mac_h01_mask
);
2577 if (w0
== 0 && w1
== 0 && op1
== 3 && op0
== 3)
2583 if ((w1
|| w0
) && mmod
== M_W32
)
2586 if (((1 << mmod
) & (P
? 0x31b : 0x1b5f)) == 0)
2589 if (w1
== 1 || op1
!= 3)
2592 OUTS (outf
, P
? dregs (dst
+ 1) : dregs_hi (dst
));
2595 OUTS (outf
, " = A1");
2599 OUTS (outf
, " = (");
2600 decode_macfunc (1, op1
, h01
, h11
, src0
, src1
, outf
);
2605 if (w0
== 1 || op0
!= 3)
2608 OUTS (outf
, " (M)");
2614 if (w0
== 1 || op0
!= 3)
2617 OUTS (outf
, P
? dregs (dst
) : dregs_lo (dst
));
2620 OUTS (outf
, " = A0");
2624 OUTS (outf
, " = (");
2625 decode_macfunc (0, op0
, h00
, h10
, src0
, src1
, outf
);
2631 decode_optmode (mmod
, MM
, outf
);
2637 decode_dsp32mult_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2640 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2641 | 1 | 1 | 0 | 0 |.M.| 0 | 1 |.mmod..........|.MM|.P.|.w1|.op1...|
2642 |.h01|.h11|.w0|.op0...|.h00|.h10|.dst.......|.src0......|.src1..|
2643 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2644 int w1
= ((iw0
>> (DSP32Mac_w1_bits
- 16)) & DSP32Mac_w1_mask
);
2645 int P
= ((iw0
>> (DSP32Mac_p_bits
- 16)) & DSP32Mac_p_mask
);
2646 int MM
= ((iw0
>> (DSP32Mac_MM_bits
- 16)) & DSP32Mac_MM_mask
);
2647 int mmod
= ((iw0
>> (DSP32Mac_mmod_bits
- 16)) & DSP32Mac_mmod_mask
);
2648 int w0
= ((iw1
>> DSP32Mac_w0_bits
) & DSP32Mac_w0_mask
);
2649 int src0
= ((iw1
>> DSP32Mac_src0_bits
) & DSP32Mac_src0_mask
);
2650 int src1
= ((iw1
>> DSP32Mac_src1_bits
) & DSP32Mac_src1_mask
);
2651 int dst
= ((iw1
>> DSP32Mac_dst_bits
) & DSP32Mac_dst_mask
);
2652 int h10
= ((iw1
>> DSP32Mac_h10_bits
) & DSP32Mac_h10_mask
);
2653 int h00
= ((iw1
>> DSP32Mac_h00_bits
) & DSP32Mac_h00_mask
);
2654 int h11
= ((iw1
>> DSP32Mac_h11_bits
) & DSP32Mac_h11_mask
);
2655 int h01
= ((iw1
>> DSP32Mac_h01_bits
) & DSP32Mac_h01_mask
);
2657 if (w1
== 0 && w0
== 0)
2660 if (((1 << mmod
) & (P
? 0x313 : 0x1b57)) == 0)
2665 OUTS (outf
, P
? dregs (dst
| 1) : dregs_hi (dst
));
2667 decode_multfunc (h01
, h11
, src0
, src1
, outf
);
2672 OUTS (outf
, " (M)");
2680 OUTS (outf
, dregs (dst
));
2682 decode_multfunc (h00
, h10
, src0
, src1
, outf
);
2685 decode_optmode (mmod
, MM
, outf
);
2690 decode_dsp32alu_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2693 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2694 | 1 | 1 | 0 | 0 |.M.| 1 | 0 | - | - | - |.HL|.aopcde............|
2695 |.aop...|.s.|.x.|.dst0......|.dst1......|.src0......|.src1......|
2696 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2697 int s
= ((iw1
>> DSP32Alu_s_bits
) & DSP32Alu_s_mask
);
2698 int x
= ((iw1
>> DSP32Alu_x_bits
) & DSP32Alu_x_mask
);
2699 int aop
= ((iw1
>> DSP32Alu_aop_bits
) & DSP32Alu_aop_mask
);
2700 int src0
= ((iw1
>> DSP32Alu_src0_bits
) & DSP32Alu_src0_mask
);
2701 int src1
= ((iw1
>> DSP32Alu_src1_bits
) & DSP32Alu_src1_mask
);
2702 int dst0
= ((iw1
>> DSP32Alu_dst0_bits
) & DSP32Alu_dst0_mask
);
2703 int dst1
= ((iw1
>> DSP32Alu_dst1_bits
) & DSP32Alu_dst1_mask
);
2704 int HL
= ((iw0
>> (DSP32Alu_HL_bits
- 16)) & DSP32Alu_HL_mask
);
2705 int aopcde
= ((iw0
>> (DSP32Alu_aopcde_bits
- 16)) & DSP32Alu_aopcde_mask
);
2707 if (aop
== 0 && aopcde
== 9 && HL
== 0 && s
== 0)
2709 OUTS (outf
, "A0.L=");
2710 OUTS (outf
, dregs_lo (src0
));
2712 else if (aop
== 2 && aopcde
== 9 && HL
== 1 && s
== 0)
2714 OUTS (outf
, "A1.H=");
2715 OUTS (outf
, dregs_hi (src0
));
2717 else if (aop
== 2 && aopcde
== 9 && HL
== 0 && s
== 0)
2719 OUTS (outf
, "A1.L=");
2720 OUTS (outf
, dregs_lo (src0
));
2722 else if (aop
== 0 && aopcde
== 9 && HL
== 1 && s
== 0)
2724 OUTS (outf
, "A0.H=");
2725 OUTS (outf
, dregs_hi (src0
));
2727 else if (x
== 1 && HL
== 1 && aop
== 3 && aopcde
== 5)
2729 OUTS (outf
, dregs_hi (dst0
));
2731 OUTS (outf
, dregs (src0
));
2733 OUTS (outf
, dregs (src1
));
2734 OUTS (outf
, "(RND20)");
2736 else if (x
== 1 && HL
== 1 && aop
== 2 && aopcde
== 5)
2738 OUTS (outf
, dregs_hi (dst0
));
2740 OUTS (outf
, dregs (src0
));
2742 OUTS (outf
, dregs (src1
));
2743 OUTS (outf
, "(RND20)");
2745 else if (x
== 0 && HL
== 0 && aop
== 1 && aopcde
== 5)
2747 OUTS (outf
, dregs_lo (dst0
));
2749 OUTS (outf
, dregs (src0
));
2751 OUTS (outf
, dregs (src1
));
2752 OUTS (outf
, "(RND12)");
2754 else if (x
== 0 && HL
== 0 && aop
== 0 && aopcde
== 5)
2756 OUTS (outf
, dregs_lo (dst0
));
2758 OUTS (outf
, dregs (src0
));
2760 OUTS (outf
, dregs (src1
));
2761 OUTS (outf
, "(RND12)");
2763 else if (x
== 1 && HL
== 0 && aop
== 3 && aopcde
== 5)
2765 OUTS (outf
, dregs_lo (dst0
));
2767 OUTS (outf
, dregs (src0
));
2769 OUTS (outf
, dregs (src1
));
2770 OUTS (outf
, "(RND20)");
2772 else if (x
== 0 && HL
== 1 && aop
== 0 && aopcde
== 5)
2774 OUTS (outf
, dregs_hi (dst0
));
2776 OUTS (outf
, dregs (src0
));
2778 OUTS (outf
, dregs (src1
));
2779 OUTS (outf
, "(RND12)");
2781 else if (x
== 1 && HL
== 0 && aop
== 2 && aopcde
== 5)
2783 OUTS (outf
, dregs_lo (dst0
));
2785 OUTS (outf
, dregs (src0
));
2787 OUTS (outf
, dregs (src1
));
2788 OUTS (outf
, "(RND20)");
2790 else if (x
== 0 && HL
== 1 && aop
== 1 && aopcde
== 5)
2792 OUTS (outf
, dregs_hi (dst0
));
2794 OUTS (outf
, dregs (src0
));
2796 OUTS (outf
, dregs (src1
));
2797 OUTS (outf
, "(RND12)");
2799 else if (HL
== 1 && aop
== 0 && aopcde
== 2)
2801 OUTS (outf
, dregs_hi (dst0
));
2803 OUTS (outf
, dregs_lo (src0
));
2805 OUTS (outf
, dregs_lo (src1
));
2809 else if (HL
== 1 && aop
== 1 && aopcde
== 2)
2811 OUTS (outf
, dregs_hi (dst0
));
2813 OUTS (outf
, dregs_lo (src0
));
2815 OUTS (outf
, dregs_hi (src1
));
2819 else if (HL
== 1 && aop
== 2 && aopcde
== 2)
2821 OUTS (outf
, dregs_hi (dst0
));
2823 OUTS (outf
, dregs_hi (src0
));
2825 OUTS (outf
, dregs_lo (src1
));
2829 else if (HL
== 1 && aop
== 3 && aopcde
== 2)
2831 OUTS (outf
, dregs_hi (dst0
));
2833 OUTS (outf
, dregs_hi (src0
));
2835 OUTS (outf
, dregs_hi (src1
));
2839 else if (HL
== 0 && aop
== 0 && aopcde
== 3)
2841 OUTS (outf
, dregs_lo (dst0
));
2843 OUTS (outf
, dregs_lo (src0
));
2845 OUTS (outf
, dregs_lo (src1
));
2849 else if (HL
== 0 && aop
== 1 && aopcde
== 3)
2851 OUTS (outf
, dregs_lo (dst0
));
2853 OUTS (outf
, dregs_lo (src0
));
2855 OUTS (outf
, dregs_hi (src1
));
2859 else if (HL
== 0 && aop
== 3 && aopcde
== 2)
2861 OUTS (outf
, dregs_lo (dst0
));
2863 OUTS (outf
, dregs_hi (src0
));
2865 OUTS (outf
, dregs_hi (src1
));
2869 else if (HL
== 1 && aop
== 0 && aopcde
== 3)
2871 OUTS (outf
, dregs_hi (dst0
));
2873 OUTS (outf
, dregs_lo (src0
));
2875 OUTS (outf
, dregs_lo (src1
));
2879 else if (HL
== 1 && aop
== 1 && aopcde
== 3)
2881 OUTS (outf
, dregs_hi (dst0
));
2883 OUTS (outf
, dregs_lo (src0
));
2885 OUTS (outf
, dregs_hi (src1
));
2889 else if (HL
== 1 && aop
== 2 && aopcde
== 3)
2891 OUTS (outf
, dregs_hi (dst0
));
2893 OUTS (outf
, dregs_hi (src0
));
2895 OUTS (outf
, dregs_lo (src1
));
2899 else if (HL
== 1 && aop
== 3 && aopcde
== 3)
2901 OUTS (outf
, dregs_hi (dst0
));
2903 OUTS (outf
, dregs_hi (src0
));
2905 OUTS (outf
, dregs_hi (src1
));
2909 else if (HL
== 0 && aop
== 2 && aopcde
== 2)
2911 OUTS (outf
, dregs_lo (dst0
));
2913 OUTS (outf
, dregs_hi (src0
));
2915 OUTS (outf
, dregs_lo (src1
));
2919 else if (HL
== 0 && aop
== 1 && aopcde
== 2)
2921 OUTS (outf
, dregs_lo (dst0
));
2923 OUTS (outf
, dregs_lo (src0
));
2925 OUTS (outf
, dregs_hi (src1
));
2929 else if (HL
== 0 && aop
== 2 && aopcde
== 3)
2931 OUTS (outf
, dregs_lo (dst0
));
2933 OUTS (outf
, dregs_hi (src0
));
2935 OUTS (outf
, dregs_lo (src1
));
2939 else if (HL
== 0 && aop
== 3 && aopcde
== 3)
2941 OUTS (outf
, dregs_lo (dst0
));
2943 OUTS (outf
, dregs_hi (src0
));
2945 OUTS (outf
, dregs_hi (src1
));
2949 else if (HL
== 0 && aop
== 0 && aopcde
== 2)
2951 OUTS (outf
, dregs_lo (dst0
));
2953 OUTS (outf
, dregs_lo (src0
));
2955 OUTS (outf
, dregs_lo (src1
));
2959 else if (aop
== 0 && aopcde
== 9 && s
== 1)
2962 OUTS (outf
, dregs (src0
));
2964 else if (aop
== 3 && aopcde
== 11 && s
== 0)
2965 OUTS (outf
, "A0-=A1");
2967 else if (aop
== 3 && aopcde
== 11 && s
== 1)
2968 OUTS (outf
, "A0-=A1(W32)");
2970 else if (aop
== 3 && aopcde
== 22 && HL
== 1)
2972 OUTS (outf
, dregs (dst0
));
2973 OUTS (outf
, "=BYTEOP2M(");
2974 OUTS (outf
, dregs (src0
+ 1));
2976 OUTS (outf
, imm5 (src0
));
2978 OUTS (outf
, dregs (src1
+ 1));
2980 OUTS (outf
, imm5 (src1
));
2981 OUTS (outf
, ")(TH");
2983 OUTS (outf
, ", R)");
2987 else if (aop
== 3 && aopcde
== 22 && HL
== 0)
2989 OUTS (outf
, dregs (dst0
));
2990 OUTS (outf
, "=BYTEOP2M(");
2991 OUTS (outf
, dregs (src0
+ 1));
2993 OUTS (outf
, imm5 (src0
));
2995 OUTS (outf
, dregs (src1
+ 1));
2997 OUTS (outf
, imm5 (src1
));
2998 OUTS (outf
, ")(TL");
3000 OUTS (outf
, ", R)");
3004 else if (aop
== 2 && aopcde
== 22 && HL
== 1)
3006 OUTS (outf
, dregs (dst0
));
3007 OUTS (outf
, "=BYTEOP2M(");
3008 OUTS (outf
, dregs (src0
+ 1));
3010 OUTS (outf
, imm5 (src0
));
3012 OUTS (outf
, dregs (src1
+ 1));
3014 OUTS (outf
, imm5 (src1
));
3015 OUTS (outf
, ")(RNDH");
3017 OUTS (outf
, ", R)");
3021 else if (aop
== 2 && aopcde
== 22 && HL
== 0)
3023 OUTS (outf
, dregs (dst0
));
3024 OUTS (outf
, "=BYTEOP2M(");
3025 OUTS (outf
, dregs (src0
+ 1));
3027 OUTS (outf
, imm5 (src0
));
3029 OUTS (outf
, dregs (src1
+ 1));
3031 OUTS (outf
, imm5 (src1
));
3032 OUTS (outf
, ")(RNDL");
3034 OUTS (outf
, ", R)");
3038 else if (aop
== 1 && aopcde
== 22 && HL
== 1)
3040 OUTS (outf
, dregs (dst0
));
3041 OUTS (outf
, "=BYTEOP2P(");
3042 OUTS (outf
, dregs (src0
+ 1));
3044 OUTS (outf
, imm5 (src0
));
3046 OUTS (outf
, dregs (src1
+ 1));
3048 OUTS (outf
, imm5 (src1
));
3049 OUTS (outf
, ")(TH");
3051 OUTS (outf
, ", R)");
3055 else if (aop
== 1 && aopcde
== 22 && HL
== 0)
3057 OUTS (outf
, dregs (dst0
));
3058 OUTS (outf
, "=BYTEOP2P(");
3059 OUTS (outf
, dregs (src0
+ 1));
3061 OUTS (outf
, imm5 (src0
));
3063 OUTS (outf
, dregs (src1
+ 1));
3065 OUTS (outf
, imm5 (src1
));
3066 OUTS (outf
, ")(TL");
3068 OUTS (outf
, ", R)");
3072 else if (aop
== 0 && aopcde
== 22 && HL
== 1)
3074 OUTS (outf
, dregs (dst0
));
3075 OUTS (outf
, "=BYTEOP2P(");
3076 OUTS (outf
, dregs (src0
+ 1));
3078 OUTS (outf
, imm5 (src0
));
3080 OUTS (outf
, dregs (src1
+ 1));
3082 OUTS (outf
, imm5 (src1
));
3083 OUTS (outf
, ")(RNDH");
3085 OUTS (outf
, ", R)");
3089 else if (aop
== 0 && aopcde
== 22 && HL
== 0)
3091 OUTS (outf
, dregs (dst0
));
3092 OUTS (outf
, "=BYTEOP2P(");
3093 OUTS (outf
, dregs (src0
+ 1));
3095 OUTS (outf
, imm5 (src0
));
3097 OUTS (outf
, dregs (src1
+ 1));
3099 OUTS (outf
, imm5 (src1
));
3100 OUTS (outf
, ")(RNDL");
3102 OUTS (outf
, ", R)");
3106 else if (aop
== 0 && s
== 0 && aopcde
== 8)
3107 OUTS (outf
, "A0=0");
3109 else if (aop
== 0 && s
== 1 && aopcde
== 8)
3110 OUTS (outf
, "A0=A0(S)");
3112 else if (aop
== 1 && s
== 0 && aopcde
== 8)
3113 OUTS (outf
, "A1=0");
3115 else if (aop
== 1 && s
== 1 && aopcde
== 8)
3116 OUTS (outf
, "A1=A1(S)");
3118 else if (aop
== 2 && s
== 0 && aopcde
== 8)
3119 OUTS (outf
, "A1=A0=0");
3121 else if (aop
== 2 && s
== 1 && aopcde
== 8)
3122 OUTS (outf
, "A1=A1(S),A0=A0(S)");
3124 else if (aop
== 3 && s
== 0 && aopcde
== 8)
3125 OUTS (outf
, "A0=A1");
3127 else if (aop
== 3 && s
== 1 && aopcde
== 8)
3128 OUTS (outf
, "A1=A0");
3130 else if (aop
== 1 && aopcde
== 9 && s
== 0)
3132 OUTS (outf
, "A0.x=");
3133 OUTS (outf
, dregs_lo (src0
));
3135 else if (aop
== 1 && HL
== 0 && aopcde
== 11)
3137 OUTS (outf
, dregs_lo (dst0
));
3138 OUTS (outf
, "=(A0+=A1)");
3140 else if (aop
== 3 && HL
== 0 && aopcde
== 16)
3141 OUTS (outf
, "A1= ABS A0,A0= ABS A0");
3143 else if (aop
== 0 && aopcde
== 23 && HL
== 1)
3145 OUTS (outf
, dregs (dst0
));
3146 OUTS (outf
, "=BYTEOP3P(");
3147 OUTS (outf
, dregs (src0
+ 1));
3149 OUTS (outf
, imm5 (src0
));
3151 OUTS (outf
, dregs (src1
+ 1));
3153 OUTS (outf
, imm5 (src1
));
3154 OUTS (outf
, ")(HI");
3156 OUTS (outf
, ", R)");
3160 else if (aop
== 3 && aopcde
== 9 && s
== 0)
3162 OUTS (outf
, "A1.x=");
3163 OUTS (outf
, dregs_lo (src0
));
3165 else if (aop
== 1 && HL
== 1 && aopcde
== 16)
3166 OUTS (outf
, "A1= ABS A1");
3168 else if (aop
== 0 && HL
== 1 && aopcde
== 16)
3169 OUTS (outf
, "A1= ABS A0");
3171 else if (aop
== 2 && aopcde
== 9 && s
== 1)
3174 OUTS (outf
, dregs (src0
));
3176 else if (HL
== 0 && aop
== 3 && aopcde
== 12)
3178 OUTS (outf
, dregs_lo (dst0
));
3180 OUTS (outf
, dregs (src0
));
3181 OUTS (outf
, "(RND)");
3183 else if (aop
== 1 && HL
== 0 && aopcde
== 16)
3184 OUTS (outf
, "A0= ABS A1");
3186 else if (aop
== 0 && HL
== 0 && aopcde
== 16)
3187 OUTS (outf
, "A0= ABS A0");
3189 else if (aop
== 3 && HL
== 0 && aopcde
== 15)
3191 OUTS (outf
, dregs (dst0
));
3193 OUTS (outf
, dregs (src0
));
3196 else if (aop
== 3 && s
== 1 && HL
== 0 && aopcde
== 7)
3198 OUTS (outf
, dregs (dst0
));
3200 OUTS (outf
, dregs (src0
));
3203 else if (aop
== 3 && s
== 0 && HL
== 0 && aopcde
== 7)
3205 OUTS (outf
, dregs (dst0
));
3207 OUTS (outf
, dregs (src0
));
3208 OUTS (outf
, "(NS)");
3210 else if (aop
== 1 && HL
== 1 && aopcde
== 11)
3212 OUTS (outf
, dregs_hi (dst0
));
3213 OUTS (outf
, "=(A0+=A1)");
3215 else if (aop
== 2 && aopcde
== 11 && s
== 0)
3216 OUTS (outf
, "A0+=A1");
3218 else if (aop
== 2 && aopcde
== 11 && s
== 1)
3219 OUTS (outf
, "A0+=A1(W32)");
3221 else if (aop
== 3 && HL
== 0 && aopcde
== 14)
3222 OUTS (outf
, "A1=-A1,A0=-A0");
3224 else if (HL
== 1 && aop
== 3 && aopcde
== 12)
3226 OUTS (outf
, dregs_hi (dst0
));
3228 OUTS (outf
, dregs (src0
));
3229 OUTS (outf
, "(RND)");
3231 else if (aop
== 0 && aopcde
== 23 && HL
== 0)
3233 OUTS (outf
, dregs (dst0
));
3234 OUTS (outf
, "=BYTEOP3P(");
3235 OUTS (outf
, dregs (src0
+ 1));
3237 OUTS (outf
, imm5 (src0
));
3239 OUTS (outf
, dregs (src1
+ 1));
3241 OUTS (outf
, imm5 (src1
));
3242 OUTS (outf
, ")(LO");
3244 OUTS (outf
, ", R)");
3248 else if (aop
== 0 && HL
== 0 && aopcde
== 14)
3249 OUTS (outf
, "A0=-A0");
3251 else if (aop
== 1 && HL
== 0 && aopcde
== 14)
3252 OUTS (outf
, "A0=-A1");
3254 else if (aop
== 0 && HL
== 1 && aopcde
== 14)
3255 OUTS (outf
, "A1=-A0");
3257 else if (aop
== 1 && HL
== 1 && aopcde
== 14)
3258 OUTS (outf
, "A1=-A1");
3260 else if (aop
== 0 && aopcde
== 12)
3262 OUTS (outf
, dregs_hi (dst0
));
3264 OUTS (outf
, dregs_lo (dst0
));
3265 OUTS (outf
, "=SIGN(");
3266 OUTS (outf
, dregs_hi (src0
));
3268 OUTS (outf
, dregs_hi (src1
));
3269 OUTS (outf
, "+SIGN(");
3270 OUTS (outf
, dregs_lo (src0
));
3272 OUTS (outf
, dregs_lo (src1
));
3275 else if (aop
== 2 && aopcde
== 0)
3277 OUTS (outf
, dregs (dst0
));
3279 OUTS (outf
, dregs (src0
));
3281 OUTS (outf
, dregs (src1
));
3285 else if (aop
== 1 && aopcde
== 12)
3287 OUTS (outf
, dregs (dst1
));
3288 OUTS (outf
, "=A1.L+A1.H,");
3289 OUTS (outf
, dregs (dst0
));
3290 OUTS (outf
, "=A0.L+A0.H");
3292 else if (aop
== 2 && aopcde
== 4)
3294 OUTS (outf
, dregs (dst1
));
3296 OUTS (outf
, dregs (src0
));
3298 OUTS (outf
, dregs (src1
));
3300 OUTS (outf
, dregs (dst0
));
3302 OUTS (outf
, dregs (src0
));
3304 OUTS (outf
, dregs (src1
));
3308 else if (HL
== 0 && aopcde
== 1)
3310 OUTS (outf
, dregs (dst1
));
3312 OUTS (outf
, dregs (src0
));
3314 OUTS (outf
, dregs (src1
));
3316 OUTS (outf
, dregs (dst0
));
3318 OUTS (outf
, dregs (src0
));
3320 OUTS (outf
, dregs (src1
));
3321 amod0amod2 (s
, x
, aop
, outf
);
3323 else if (aop
== 0 && aopcde
== 11)
3325 OUTS (outf
, dregs (dst0
));
3326 OUTS (outf
, "=(A0+=A1)");
3328 else if (aop
== 0 && aopcde
== 10)
3330 OUTS (outf
, dregs_lo (dst0
));
3331 OUTS (outf
, "=A0.x");
3333 else if (aop
== 1 && aopcde
== 10)
3335 OUTS (outf
, dregs_lo (dst0
));
3336 OUTS (outf
, "=A1.x");
3338 else if (aop
== 1 && aopcde
== 0)
3340 OUTS (outf
, dregs (dst0
));
3342 OUTS (outf
, dregs (src0
));
3344 OUTS (outf
, dregs (src1
));
3348 else if (aop
== 3 && aopcde
== 0)
3350 OUTS (outf
, dregs (dst0
));
3352 OUTS (outf
, dregs (src0
));
3354 OUTS (outf
, dregs (src1
));
3358 else if (aop
== 1 && aopcde
== 4)
3360 OUTS (outf
, dregs (dst0
));
3362 OUTS (outf
, dregs (src0
));
3364 OUTS (outf
, dregs (src1
));
3368 else if (aop
== 0 && aopcde
== 17)
3370 OUTS (outf
, dregs (dst1
));
3371 OUTS (outf
, "=A1+A0,");
3372 OUTS (outf
, dregs (dst0
));
3373 OUTS (outf
, "=A1-A0 ");
3376 else if (aop
== 1 && aopcde
== 17)
3378 OUTS (outf
, dregs (dst1
));
3379 OUTS (outf
, "=A0+A1,");
3380 OUTS (outf
, dregs (dst0
));
3381 OUTS (outf
, "=A0-A1 ");
3384 else if (aop
== 0 && aopcde
== 18)
3386 OUTS (outf
, "SAA(");
3387 OUTS (outf
, dregs (src0
+ 1));
3389 OUTS (outf
, imm5 (src0
));
3391 OUTS (outf
, dregs (src1
+ 1));
3393 OUTS (outf
, imm5 (src1
));
3397 else if (aop
== 3 && aopcde
== 18)
3398 OUTS (outf
, "DISALGNEXCPT");
3400 else if (aop
== 0 && aopcde
== 20)
3402 OUTS (outf
, dregs (dst0
));
3403 OUTS (outf
, "=BYTEOP1P(");
3404 OUTS (outf
, dregs (src0
+ 1));
3406 OUTS (outf
, imm5 (src0
));
3408 OUTS (outf
, dregs (src1
+ 1));
3410 OUTS (outf
, imm5 (src1
));
3414 else if (aop
== 1 && aopcde
== 20)
3416 OUTS (outf
, dregs (dst0
));
3417 OUTS (outf
, "=BYTEOP1P(");
3418 OUTS (outf
, dregs (src0
+ 1));
3420 OUTS (outf
, imm5 (src0
));
3422 OUTS (outf
, dregs (src1
+ 1));
3424 OUTS (outf
, imm5 (src1
));
3427 OUTS (outf
, ", R)");
3431 else if (aop
== 0 && aopcde
== 21)
3434 OUTS (outf
, dregs (dst1
));
3436 OUTS (outf
, dregs (dst0
));
3437 OUTS (outf
, ")=BYTEOP16P(");
3438 OUTS (outf
, dregs (src0
+ 1));
3440 OUTS (outf
, imm5 (src0
));
3442 OUTS (outf
, dregs (src1
+ 1));
3444 OUTS (outf
, imm5 (src1
));
3448 else if (aop
== 1 && aopcde
== 21)
3451 OUTS (outf
, dregs (dst1
));
3453 OUTS (outf
, dregs (dst0
));
3454 OUTS (outf
, ")=BYTEOP16M(");
3455 OUTS (outf
, dregs (src0
+ 1));
3457 OUTS (outf
, imm5 (src0
));
3459 OUTS (outf
, dregs (src1
+ 1));
3461 OUTS (outf
, imm5 (src1
));
3465 else if (aop
== 2 && aopcde
== 7)
3467 OUTS (outf
, dregs (dst0
));
3468 OUTS (outf
, "= ABS ");
3469 OUTS (outf
, dregs (src0
));
3471 else if (aop
== 1 && aopcde
== 7)
3473 OUTS (outf
, dregs (dst0
));
3474 OUTS (outf
, "=MIN(");
3475 OUTS (outf
, dregs (src0
));
3477 OUTS (outf
, dregs (src1
));
3480 else if (aop
== 0 && aopcde
== 7)
3482 OUTS (outf
, dregs (dst0
));
3483 OUTS (outf
, "=MAX(");
3484 OUTS (outf
, dregs (src0
));
3486 OUTS (outf
, dregs (src1
));
3489 else if (aop
== 2 && aopcde
== 6)
3491 OUTS (outf
, dregs (dst0
));
3492 OUTS (outf
, "= ABS ");
3493 OUTS (outf
, dregs (src0
));
3496 else if (aop
== 1 && aopcde
== 6)
3498 OUTS (outf
, dregs (dst0
));
3499 OUTS (outf
, "=MIN(");
3500 OUTS (outf
, dregs (src0
));
3502 OUTS (outf
, dregs (src1
));
3503 OUTS (outf
, ")(V)");
3505 else if (aop
== 0 && aopcde
== 6)
3507 OUTS (outf
, dregs (dst0
));
3508 OUTS (outf
, "=MAX(");
3509 OUTS (outf
, dregs (src0
));
3511 OUTS (outf
, dregs (src1
));
3512 OUTS (outf
, ")(V)");
3514 else if (HL
== 1 && aopcde
== 1)
3516 OUTS (outf
, dregs (dst1
));
3518 OUTS (outf
, dregs (src0
));
3520 OUTS (outf
, dregs (src1
));
3522 OUTS (outf
, dregs (dst0
));
3524 OUTS (outf
, dregs (src0
));
3526 OUTS (outf
, dregs (src1
));
3527 amod0amod2 (s
, x
, aop
, outf
);
3529 else if (aop
== 0 && aopcde
== 4)
3531 OUTS (outf
, dregs (dst0
));
3533 OUTS (outf
, dregs (src0
));
3535 OUTS (outf
, dregs (src1
));
3539 else if (aop
== 0 && aopcde
== 0)
3541 OUTS (outf
, dregs (dst0
));
3543 OUTS (outf
, dregs (src0
));
3545 OUTS (outf
, dregs (src1
));
3549 else if (aop
== 0 && aopcde
== 24)
3551 OUTS (outf
, dregs (dst0
));
3552 OUTS (outf
, "=BYTEPACK(");
3553 OUTS (outf
, dregs (src0
));
3555 OUTS (outf
, dregs (src1
));
3558 else if (aop
== 1 && aopcde
== 24)
3561 OUTS (outf
, dregs (dst1
));
3563 OUTS (outf
, dregs (dst0
));
3564 OUTS (outf
, ") = BYTEUNPACK ");
3565 OUTS (outf
, dregs (src0
+ 1));
3567 OUTS (outf
, imm5 (src0
));
3571 else if (aopcde
== 13)
3574 OUTS (outf
, dregs (dst1
));
3576 OUTS (outf
, dregs (dst0
));
3577 OUTS (outf
, ") = SEARCH ");
3578 OUTS (outf
, dregs (src0
));
3580 searchmod (aop
, outf
);
3590 decode_dsp32shift_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
3593 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
3594 | 1 | 1 | 0 | 0 |.M.| 1 | 1 | 0 | 0 | - | - |.sopcde............|
3595 |.sop...|.HLs...|.dst0......| - | - | - |.src0......|.src1......|
3596 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
3597 int HLs
= ((iw1
>> DSP32Shift_HLs_bits
) & DSP32Shift_HLs_mask
);
3598 int sop
= ((iw1
>> DSP32Shift_sop_bits
) & DSP32Shift_sop_mask
);
3599 int src0
= ((iw1
>> DSP32Shift_src0_bits
) & DSP32Shift_src0_mask
);
3600 int src1
= ((iw1
>> DSP32Shift_src1_bits
) & DSP32Shift_src1_mask
);
3601 int dst0
= ((iw1
>> DSP32Shift_dst0_bits
) & DSP32Shift_dst0_mask
);
3602 int sopcde
= ((iw0
>> (DSP32Shift_sopcde_bits
- 16)) & DSP32Shift_sopcde_mask
);
3603 const char *acc01
= (HLs
& 1) == 0 ? "A0" : "A1";
3605 if (HLs
== 0 && sop
== 0 && sopcde
== 0)
3607 OUTS (outf
, dregs_lo (dst0
));
3608 OUTS (outf
, "= ASHIFT ");
3609 OUTS (outf
, dregs_lo (src1
));
3610 OUTS (outf
, " BY ");
3611 OUTS (outf
, dregs_lo (src0
));
3613 else if (HLs
== 1 && sop
== 0 && sopcde
== 0)
3615 OUTS (outf
, dregs_lo (dst0
));
3616 OUTS (outf
, "= ASHIFT ");
3617 OUTS (outf
, dregs_hi (src1
));
3618 OUTS (outf
, " BY ");
3619 OUTS (outf
, dregs_lo (src0
));
3621 else if (HLs
== 2 && sop
== 0 && sopcde
== 0)
3623 OUTS (outf
, dregs_hi (dst0
));
3624 OUTS (outf
, "= ASHIFT ");
3625 OUTS (outf
, dregs_lo (src1
));
3626 OUTS (outf
, " BY ");
3627 OUTS (outf
, dregs_lo (src0
));
3629 else if (HLs
== 3 && sop
== 0 && sopcde
== 0)
3631 OUTS (outf
, dregs_hi (dst0
));
3632 OUTS (outf
, "= ASHIFT ");
3633 OUTS (outf
, dregs_hi (src1
));
3634 OUTS (outf
, " BY ");
3635 OUTS (outf
, dregs_lo (src0
));
3637 else if (HLs
== 0 && sop
== 1 && sopcde
== 0)
3639 OUTS (outf
, dregs_lo (dst0
));
3640 OUTS (outf
, "= ASHIFT ");
3641 OUTS (outf
, dregs_lo (src1
));
3642 OUTS (outf
, " BY ");
3643 OUTS (outf
, dregs_lo (src0
));
3646 else if (HLs
== 1 && sop
== 1 && sopcde
== 0)
3648 OUTS (outf
, dregs_lo (dst0
));
3649 OUTS (outf
, "= ASHIFT ");
3650 OUTS (outf
, dregs_hi (src1
));
3651 OUTS (outf
, " BY ");
3652 OUTS (outf
, dregs_lo (src0
));
3655 else if (HLs
== 2 && sop
== 1 && sopcde
== 0)
3657 OUTS (outf
, dregs_hi (dst0
));
3658 OUTS (outf
, "= ASHIFT ");
3659 OUTS (outf
, dregs_lo (src1
));
3660 OUTS (outf
, " BY ");
3661 OUTS (outf
, dregs_lo (src0
));
3664 else if (HLs
== 3 && sop
== 1 && sopcde
== 0)
3666 OUTS (outf
, dregs_hi (dst0
));
3667 OUTS (outf
, "= ASHIFT ");
3668 OUTS (outf
, dregs_hi (src1
));
3669 OUTS (outf
, " BY ");
3670 OUTS (outf
, dregs_lo (src0
));
3673 else if (sop
== 2 && sopcde
== 0)
3675 OUTS (outf
, (HLs
& 2) == 0 ? dregs_lo (dst0
) : dregs_hi (dst0
));
3676 OUTS (outf
, "= LSHIFT ");
3677 OUTS (outf
, (HLs
& 1) == 0 ? dregs_lo (src1
) : dregs_hi (src1
));
3678 OUTS (outf
, " BY ");
3679 OUTS (outf
, dregs_lo (src0
));
3681 else if (sop
== 0 && sopcde
== 3)
3684 OUTS (outf
, "= ASHIFT ");
3686 OUTS (outf
, " BY ");
3687 OUTS (outf
, dregs_lo (src0
));
3689 else if (sop
== 1 && sopcde
== 3)
3692 OUTS (outf
, "= LSHIFT ");
3694 OUTS (outf
, " BY ");
3695 OUTS (outf
, dregs_lo (src0
));
3697 else if (sop
== 2 && sopcde
== 3)
3700 OUTS (outf
, "= ROT ");
3702 OUTS (outf
, " BY ");
3703 OUTS (outf
, dregs_lo (src0
));
3705 else if (sop
== 3 && sopcde
== 3)
3707 OUTS (outf
, dregs (dst0
));
3708 OUTS (outf
, "= ROT ");
3709 OUTS (outf
, dregs (src1
));
3710 OUTS (outf
, " BY ");
3711 OUTS (outf
, dregs_lo (src0
));
3713 else if (sop
== 1 && sopcde
== 1)
3715 OUTS (outf
, dregs (dst0
));
3716 OUTS (outf
, "= ASHIFT ");
3717 OUTS (outf
, dregs (src1
));
3718 OUTS (outf
, " BY ");
3719 OUTS (outf
, dregs_lo (src0
));
3720 OUTS (outf
, "(V,S)");
3722 else if (sop
== 0 && sopcde
== 1)
3724 OUTS (outf
, dregs (dst0
));
3725 OUTS (outf
, "= ASHIFT ");
3726 OUTS (outf
, dregs (src1
));
3727 OUTS (outf
, " BY ");
3728 OUTS (outf
, dregs_lo (src0
));
3731 else if (sop
== 0 && sopcde
== 2)
3733 OUTS (outf
, dregs (dst0
));
3734 OUTS (outf
, "= ASHIFT ");
3735 OUTS (outf
, dregs (src1
));
3736 OUTS (outf
, " BY ");
3737 OUTS (outf
, dregs_lo (src0
));
3739 else if (sop
== 1 && sopcde
== 2)
3741 OUTS (outf
, dregs (dst0
));
3742 OUTS (outf
, "= ASHIFT ");
3743 OUTS (outf
, dregs (src1
));
3744 OUTS (outf
, " BY ");
3745 OUTS (outf
, dregs_lo (src0
));
3748 else if (sop
== 2 && sopcde
== 2)
3750 OUTS (outf
, dregs (dst0
));
3751 OUTS (outf
, "=SHIFT ");
3752 OUTS (outf
, dregs (src1
));
3753 OUTS (outf
, " BY ");
3754 OUTS (outf
, dregs_lo (src0
));
3756 else if (sop
== 3 && sopcde
== 2)
3758 OUTS (outf
, dregs (dst0
));
3759 OUTS (outf
, "= ROT ");
3760 OUTS (outf
, dregs (src1
));
3761 OUTS (outf
, " BY ");
3762 OUTS (outf
, dregs_lo (src0
));
3764 else if (sop
== 2 && sopcde
== 1)
3766 OUTS (outf
, dregs (dst0
));
3767 OUTS (outf
, "=SHIFT ");
3768 OUTS (outf
, dregs (src1
));
3769 OUTS (outf
, " BY ");
3770 OUTS (outf
, dregs_lo (src0
));
3773 else if (sop
== 0 && sopcde
== 4)
3775 OUTS (outf
, dregs (dst0
));
3776 OUTS (outf
, "=PACK");
3778 OUTS (outf
, dregs_lo (src1
));
3780 OUTS (outf
, dregs_lo (src0
));
3783 else if (sop
== 1 && sopcde
== 4)
3785 OUTS (outf
, dregs (dst0
));
3786 OUTS (outf
, "=PACK(");
3787 OUTS (outf
, dregs_lo (src1
));
3789 OUTS (outf
, dregs_hi (src0
));
3792 else if (sop
== 2 && sopcde
== 4)
3794 OUTS (outf
, dregs (dst0
));
3795 OUTS (outf
, "=PACK(");
3796 OUTS (outf
, dregs_hi (src1
));
3798 OUTS (outf
, dregs_lo (src0
));
3801 else if (sop
== 3 && sopcde
== 4)
3803 OUTS (outf
, dregs (dst0
));
3804 OUTS (outf
, "=PACK(");
3805 OUTS (outf
, dregs_hi (src1
));
3807 OUTS (outf
, dregs_hi (src0
));
3810 else if (sop
== 0 && sopcde
== 5)
3812 OUTS (outf
, dregs_lo (dst0
));
3813 OUTS (outf
, "=SIGNBITS ");
3814 OUTS (outf
, dregs (src1
));
3816 else if (sop
== 1 && sopcde
== 5)
3818 OUTS (outf
, dregs_lo (dst0
));
3819 OUTS (outf
, "=SIGNBITS ");
3820 OUTS (outf
, dregs_lo (src1
));
3822 else if (sop
== 2 && sopcde
== 5)
3824 OUTS (outf
, dregs_lo (dst0
));
3825 OUTS (outf
, "=SIGNBITS ");
3826 OUTS (outf
, dregs_hi (src1
));
3828 else if (sop
== 0 && sopcde
== 6)
3830 OUTS (outf
, dregs_lo (dst0
));
3831 OUTS (outf
, "=SIGNBITS A0");
3833 else if (sop
== 1 && sopcde
== 6)
3835 OUTS (outf
, dregs_lo (dst0
));
3836 OUTS (outf
, "=SIGNBITS A1");
3838 else if (sop
== 3 && sopcde
== 6)
3840 OUTS (outf
, dregs_lo (dst0
));
3841 OUTS (outf
, "=ONES ");
3842 OUTS (outf
, dregs (src1
));
3844 else if (sop
== 0 && sopcde
== 7)
3846 OUTS (outf
, dregs_lo (dst0
));
3847 OUTS (outf
, "=EXPADJ (");
3848 OUTS (outf
, dregs (src1
));
3850 OUTS (outf
, dregs_lo (src0
));
3853 else if (sop
== 1 && sopcde
== 7)
3855 OUTS (outf
, dregs_lo (dst0
));
3856 OUTS (outf
, "=EXPADJ (");
3857 OUTS (outf
, dregs (src1
));
3859 OUTS (outf
, dregs_lo (src0
));
3860 OUTS (outf
, ") (V)");
3862 else if (sop
== 2 && sopcde
== 7)
3864 OUTS (outf
, dregs_lo (dst0
));
3865 OUTS (outf
, "=EXPADJ (");
3866 OUTS (outf
, dregs_lo (src1
));
3868 OUTS (outf
, dregs_lo (src0
));
3871 else if (sop
== 3 && sopcde
== 7)
3873 OUTS (outf
, dregs_lo (dst0
));
3874 OUTS (outf
, "=EXPADJ (");
3875 OUTS (outf
, dregs_hi (src1
));
3877 OUTS (outf
, dregs_lo (src0
));
3880 else if (sop
== 0 && sopcde
== 8)
3882 OUTS (outf
, "BITMUX (");
3883 OUTS (outf
, dregs (src0
));
3885 OUTS (outf
, dregs (src1
));
3886 OUTS (outf
, ",A0 )(ASR)");
3888 else if (sop
== 1 && sopcde
== 8)
3890 OUTS (outf
, "BITMUX (");
3891 OUTS (outf
, dregs (src0
));
3893 OUTS (outf
, dregs (src1
));
3894 OUTS (outf
, ",A0 )(ASL)");
3896 else if (sop
== 0 && sopcde
== 9)
3898 OUTS (outf
, dregs_lo (dst0
));
3899 OUTS (outf
, "=VIT_MAX (");
3900 OUTS (outf
, dregs (src1
));
3901 OUTS (outf
, ") (ASL)");
3903 else if (sop
== 1 && sopcde
== 9)
3905 OUTS (outf
, dregs_lo (dst0
));
3906 OUTS (outf
, "=VIT_MAX (");
3907 OUTS (outf
, dregs (src1
));
3908 OUTS (outf
, ") (ASR)");
3910 else if (sop
== 2 && sopcde
== 9)
3912 OUTS (outf
, dregs (dst0
));
3913 OUTS (outf
, "=VIT_MAX(");
3914 OUTS (outf
, dregs (src1
));
3916 OUTS (outf
, dregs (src0
));
3917 OUTS (outf
, ")(ASL)");
3919 else if (sop
== 3 && sopcde
== 9)
3921 OUTS (outf
, dregs (dst0
));
3922 OUTS (outf
, "=VIT_MAX(");
3923 OUTS (outf
, dregs (src1
));
3925 OUTS (outf
, dregs (src0
));
3926 OUTS (outf
, ")(ASR)");
3928 else if (sop
== 0 && sopcde
== 10)
3930 OUTS (outf
, dregs (dst0
));
3931 OUTS (outf
, "=EXTRACT(");
3932 OUTS (outf
, dregs (src1
));
3934 OUTS (outf
, dregs_lo (src0
));
3935 OUTS (outf
, ") (Z)");
3937 else if (sop
== 1 && sopcde
== 10)
3939 OUTS (outf
, dregs (dst0
));
3940 OUTS (outf
, "=EXTRACT(");
3941 OUTS (outf
, dregs (src1
));
3943 OUTS (outf
, dregs_lo (src0
));
3944 OUTS (outf
, ")(X)");
3946 else if (sop
== 2 && sopcde
== 10)
3948 OUTS (outf
, dregs (dst0
));
3949 OUTS (outf
, "=DEPOSIT(");
3950 OUTS (outf
, dregs (src1
));
3952 OUTS (outf
, dregs (src0
));
3955 else if (sop
== 3 && sopcde
== 10)
3957 OUTS (outf
, dregs (dst0
));
3958 OUTS (outf
, "=DEPOSIT(");
3959 OUTS (outf
, dregs (src1
));
3961 OUTS (outf
, dregs (src0
));
3962 OUTS (outf
, ")(X)");
3964 else if (sop
== 0 && sopcde
== 11)
3966 OUTS (outf
, dregs_lo (dst0
));
3967 OUTS (outf
, "=CC=BXORSHIFT(A0,");
3968 OUTS (outf
, dregs (src0
));
3971 else if (sop
== 1 && sopcde
== 11)
3973 OUTS (outf
, dregs_lo (dst0
));
3974 OUTS (outf
, "=CC=BXOR(A0,");
3975 OUTS (outf
, dregs (src0
));
3978 else if (sop
== 0 && sopcde
== 12)
3979 OUTS (outf
, "A0=BXORSHIFT(A0,A1 ,CC)");
3981 else if (sop
== 1 && sopcde
== 12)
3983 OUTS (outf
, dregs_lo (dst0
));
3984 OUTS (outf
, "=CC=BXOR( A0,A1 ,CC )");
3986 else if (sop
== 0 && sopcde
== 13)
3988 OUTS (outf
, dregs (dst0
));
3989 OUTS (outf
, "=ALIGN8(");
3990 OUTS (outf
, dregs (src1
));
3992 OUTS (outf
, dregs (src0
));
3995 else if (sop
== 1 && sopcde
== 13)
3997 OUTS (outf
, dregs (dst0
));
3998 OUTS (outf
, "=ALIGN16(");
3999 OUTS (outf
, dregs (src1
));
4001 OUTS (outf
, dregs (src0
));
4004 else if (sop
== 2 && sopcde
== 13)
4006 OUTS (outf
, dregs (dst0
));
4007 OUTS (outf
, "=ALIGN24(");
4008 OUTS (outf
, dregs (src1
));
4010 OUTS (outf
, dregs (src0
));
4020 decode_dsp32shiftimm_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
4023 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
4024 | 1 | 1 | 0 | 0 |.M.| 1 | 1 | 0 | 1 | - | - |.sopcde............|
4025 |.sop...|.HLs...|.dst0......|.immag.................|.src1......|
4026 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
4027 int src1
= ((iw1
>> DSP32ShiftImm_src1_bits
) & DSP32ShiftImm_src1_mask
);
4028 int sop
= ((iw1
>> DSP32ShiftImm_sop_bits
) & DSP32ShiftImm_sop_mask
);
4029 int bit8
= ((iw1
>> 8) & 0x1);
4030 int immag
= ((iw1
>> DSP32ShiftImm_immag_bits
) & DSP32ShiftImm_immag_mask
);
4031 int newimmag
= (-(iw1
>> DSP32ShiftImm_immag_bits
) & DSP32ShiftImm_immag_mask
);
4032 int dst0
= ((iw1
>> DSP32ShiftImm_dst0_bits
) & DSP32ShiftImm_dst0_mask
);
4033 int sopcde
= ((iw0
>> (DSP32ShiftImm_sopcde_bits
- 16)) & DSP32ShiftImm_sopcde_mask
);
4034 int HLs
= ((iw1
>> DSP32ShiftImm_HLs_bits
) & DSP32ShiftImm_HLs_mask
);
4037 if (sop
== 0 && sopcde
== 0)
4039 OUTS (outf
, (HLs
& 2) ? dregs_hi (dst0
) : dregs_lo (dst0
));
4041 OUTS (outf
, (HLs
& 1) ? dregs_hi (src1
) : dregs_lo (src1
));
4042 OUTS (outf
, " >>> ");
4043 OUTS (outf
, uimm4 (newimmag
));
4045 else if (sop
== 1 && sopcde
== 0 && bit8
== 0)
4047 OUTS (outf
, (HLs
& 2) ? dregs_hi (dst0
) : dregs_lo (dst0
));
4049 OUTS (outf
, (HLs
& 1) ? dregs_hi (src1
) : dregs_lo (src1
));
4050 OUTS (outf
, " << ");
4051 OUTS (outf
, uimm4 (immag
));
4052 OUTS (outf
, " (S)");
4054 else if (sop
== 1 && sopcde
== 0 && bit8
== 1)
4056 OUTS (outf
, (HLs
& 2) ? dregs_hi (dst0
) : dregs_lo (dst0
));
4058 OUTS (outf
, (HLs
& 1) ? dregs_hi (src1
) : dregs_lo (src1
));
4059 OUTS (outf
, " >>> ");
4060 OUTS (outf
, uimm4 (newimmag
));
4061 OUTS (outf
, " (S)");
4063 else if (sop
== 2 && sopcde
== 0 && bit8
== 0)
4065 OUTS (outf
, (HLs
& 2) ? dregs_hi (dst0
) : dregs_lo (dst0
));
4067 OUTS (outf
, (HLs
& 1) ? dregs_hi (src1
) : dregs_lo (src1
));
4068 OUTS (outf
, " << ");
4069 OUTS (outf
, uimm4 (immag
));
4071 else if (sop
== 2 && sopcde
== 0 && bit8
== 1)
4073 OUTS (outf
, (HLs
& 2) ? dregs_hi (dst0
) : dregs_lo (dst0
));
4075 OUTS (outf
, (HLs
& 1) ? dregs_hi (src1
) : dregs_lo (src1
));
4076 OUTS (outf
, " >> ");
4077 OUTS (outf
, uimm4 (newimmag
));
4079 else if (sop
== 2 && sopcde
== 3 && HLs
== 1)
4081 OUTS (outf
, "A1= ROT A1 BY ");
4082 OUTS (outf
, imm6 (immag
));
4084 else if (sop
== 0 && sopcde
== 3 && HLs
== 0 && bit8
== 0)
4086 OUTS (outf
, "A0=A0<<");
4087 OUTS (outf
, uimm5 (immag
));
4089 else if (sop
== 0 && sopcde
== 3 && HLs
== 0 && bit8
== 1)
4091 OUTS (outf
, "A0=A0>>>");
4092 OUTS (outf
, uimm5 (newimmag
));
4094 else if (sop
== 0 && sopcde
== 3 && HLs
== 1 && bit8
== 0)
4096 OUTS (outf
, "A1=A1<<");
4097 OUTS (outf
, uimm5 (immag
));
4099 else if (sop
== 0 && sopcde
== 3 && HLs
== 1 && bit8
== 1)
4101 OUTS (outf
, "A1=A1>>>");
4102 OUTS (outf
, uimm5 (newimmag
));
4104 else if (sop
== 1 && sopcde
== 3 && HLs
== 0)
4106 OUTS (outf
, "A0=A0>>");
4107 OUTS (outf
, uimm5 (newimmag
));
4109 else if (sop
== 1 && sopcde
== 3 && HLs
== 1)
4111 OUTS (outf
, "A1=A1>>");
4112 OUTS (outf
, uimm5 (newimmag
));
4114 else if (sop
== 2 && sopcde
== 3 && HLs
== 0)
4116 OUTS (outf
, "A0= ROT A0 BY ");
4117 OUTS (outf
, imm6 (immag
));
4119 else if (sop
== 1 && sopcde
== 1 && bit8
== 0)
4121 OUTS (outf
, dregs (dst0
));
4123 OUTS (outf
, dregs (src1
));
4125 OUTS (outf
, uimm5 (immag
));
4126 OUTS (outf
, " (V, S)");
4128 else if (sop
== 1 && sopcde
== 1 && bit8
== 1)
4130 OUTS (outf
, dregs (dst0
));
4132 OUTS (outf
, dregs (src1
));
4134 OUTS (outf
, imm5 (-immag
));
4135 OUTS (outf
, " (V)");
4137 else if (sop
== 2 && sopcde
== 1 && bit8
== 1)
4139 OUTS (outf
, dregs (dst0
));
4141 OUTS (outf
, dregs (src1
));
4142 OUTS (outf
, " >> ");
4143 OUTS (outf
, uimm5 (newimmag
));
4144 OUTS (outf
, " (V)");
4146 else if (sop
== 2 && sopcde
== 1 && bit8
== 0)
4148 OUTS (outf
, dregs (dst0
));
4150 OUTS (outf
, dregs (src1
));
4152 OUTS (outf
, imm5 (immag
));
4153 OUTS (outf
, " (V)");
4155 else if (sop
== 0 && sopcde
== 1)
4157 OUTS (outf
, dregs (dst0
));
4159 OUTS (outf
, dregs (src1
));
4161 OUTS (outf
, uimm5 (newimmag
));
4162 OUTS (outf
, " (V)");
4164 else if (sop
== 1 && sopcde
== 2)
4166 OUTS (outf
, dregs (dst0
));
4168 OUTS (outf
, dregs (src1
));
4170 OUTS (outf
, uimm5 (immag
));
4173 else if (sop
== 2 && sopcde
== 2 && bit8
== 1)
4175 OUTS (outf
, dregs (dst0
));
4177 OUTS (outf
, dregs (src1
));
4179 OUTS (outf
, uimm5 (newimmag
));
4181 else if (sop
== 2 && sopcde
== 2 && bit8
== 0)
4183 OUTS (outf
, dregs (dst0
));
4185 OUTS (outf
, dregs (src1
));
4187 OUTS (outf
, uimm5 (immag
));
4189 else if (sop
== 3 && sopcde
== 2)
4191 OUTS (outf
, dregs (dst0
));
4192 OUTS (outf
, "= ROT ");
4193 OUTS (outf
, dregs (src1
));
4194 OUTS (outf
, " BY ");
4195 OUTS (outf
, imm6 (immag
));
4197 else if (sop
== 0 && sopcde
== 2)
4199 OUTS (outf
, dregs (dst0
));
4201 OUTS (outf
, dregs (src1
));
4203 OUTS (outf
, uimm5 (newimmag
));
4212 decode_pseudoDEBUG_0 (TIword iw0
, disassemble_info
*outf
)
4215 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
4216 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |.fn....|.grp.......|.reg.......|
4217 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
4218 int fn
= ((iw0
>> PseudoDbg_fn_bits
) & PseudoDbg_fn_mask
);
4219 int grp
= ((iw0
>> PseudoDbg_grp_bits
) & PseudoDbg_grp_mask
);
4220 int reg
= ((iw0
>> PseudoDbg_reg_bits
) & PseudoDbg_reg_mask
);
4222 if (reg
== 0 && fn
== 3)
4223 OUTS (outf
, "DBG A0");
4225 else if (reg
== 1 && fn
== 3)
4226 OUTS (outf
, "DBG A1");
4228 else if (reg
== 3 && fn
== 3)
4229 OUTS (outf
, "ABORT");
4231 else if (reg
== 4 && fn
== 3)
4234 else if (reg
== 5 && fn
== 3)
4235 OUTS (outf
, "DBGHALT");
4237 else if (reg
== 6 && fn
== 3)
4239 OUTS (outf
, "DBGCMPLX(");
4240 OUTS (outf
, dregs (grp
));
4243 else if (reg
== 7 && fn
== 3)
4246 else if (grp
== 0 && fn
== 2)
4248 OUTS (outf
, "OUTC");
4249 OUTS (outf
, dregs (reg
));
4254 OUTS (outf
, allregs (reg
, grp
));
4258 OUTS (outf
, "PRNT");
4259 OUTS (outf
, allregs (reg
, grp
));
4268 decode_pseudodbg_assert_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
4271 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
4272 | 1 | 1 | 1 | 1 | 0 | - | - | - | - | - |.dbgop.....|.regtest...|
4273 |.expected......................................................|
4274 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
4275 int expected
= ((iw1
>> PseudoDbg_Assert_expected_bits
) & PseudoDbg_Assert_expected_mask
);
4276 int dbgop
= ((iw0
>> (PseudoDbg_Assert_dbgop_bits
- 16)) & PseudoDbg_Assert_dbgop_mask
);
4277 int regtest
= ((iw0
>> (PseudoDbg_Assert_regtest_bits
- 16)) & PseudoDbg_Assert_regtest_mask
);
4281 OUTS (outf
, "DBGA(");
4282 OUTS (outf
, dregs_lo (regtest
));
4284 OUTS (outf
, uimm16 (expected
));
4287 else if (dbgop
== 1)
4289 OUTS (outf
, "DBGA(");
4290 OUTS (outf
, dregs_hi (regtest
));
4292 OUTS (outf
, uimm16 (expected
));
4295 else if (dbgop
== 2)
4297 OUTS (outf
, "DBGAL(");
4298 OUTS (outf
, dregs (regtest
));
4300 OUTS (outf
, uimm16 (expected
));
4303 else if (dbgop
== 3)
4305 OUTS (outf
, "DBGAH(");
4306 OUTS (outf
, dregs (regtest
));
4308 OUTS (outf
, uimm16 (expected
));
4317 _print_insn_bfin (bfd_vma pc
, disassemble_info
*outf
)
4325 status
= (*outf
->read_memory_func
) (pc
& ~0x1, buf
, 2, outf
);
4326 status
= (*outf
->read_memory_func
) ((pc
+ 2) & ~0x1, buf
+ 2, 2, outf
);
4328 iw0
= bfd_getl16 (buf
);
4329 iw1
= bfd_getl16 (buf
+ 2);
4331 if ((iw0
& 0xf7ff) == 0xc003 && iw1
== 0x1800)
4333 OUTS (outf
, "mnop");
4336 else if ((iw0
& 0xff00) == 0x0000)
4337 rv
= decode_ProgCtrl_0 (iw0
, outf
);
4338 else if ((iw0
& 0xffc0) == 0x0240)
4339 rv
= decode_CaCTRL_0 (iw0
, outf
);
4340 else if ((iw0
& 0xff80) == 0x0100)
4341 rv
= decode_PushPopReg_0 (iw0
, outf
);
4342 else if ((iw0
& 0xfe00) == 0x0400)
4343 rv
= decode_PushPopMultiple_0 (iw0
, outf
);
4344 else if ((iw0
& 0xfe00) == 0x0600)
4345 rv
= decode_ccMV_0 (iw0
, outf
);
4346 else if ((iw0
& 0xf800) == 0x0800)
4347 rv
= decode_CCflag_0 (iw0
, outf
);
4348 else if ((iw0
& 0xffe0) == 0x0200)
4349 rv
= decode_CC2dreg_0 (iw0
, outf
);
4350 else if ((iw0
& 0xff00) == 0x0300)
4351 rv
= decode_CC2stat_0 (iw0
, outf
);
4352 else if ((iw0
& 0xf000) == 0x1000)
4353 rv
= decode_BRCC_0 (iw0
, pc
, outf
);
4354 else if ((iw0
& 0xf000) == 0x2000)
4355 rv
= decode_UJUMP_0 (iw0
, pc
, outf
);
4356 else if ((iw0
& 0xf000) == 0x3000)
4357 rv
= decode_REGMV_0 (iw0
, outf
);
4358 else if ((iw0
& 0xfc00) == 0x4000)
4359 rv
= decode_ALU2op_0 (iw0
, outf
);
4360 else if ((iw0
& 0xfe00) == 0x4400)
4361 rv
= decode_PTR2op_0 (iw0
, outf
);
4362 else if ((iw0
& 0xf800) == 0x4800)
4363 rv
= decode_LOGI2op_0 (iw0
, outf
);
4364 else if ((iw0
& 0xf000) == 0x5000)
4365 rv
= decode_COMP3op_0 (iw0
, outf
);
4366 else if ((iw0
& 0xf800) == 0x6000)
4367 rv
= decode_COMPI2opD_0 (iw0
, outf
);
4368 else if ((iw0
& 0xf800) == 0x6800)
4369 rv
= decode_COMPI2opP_0 (iw0
, outf
);
4370 else if ((iw0
& 0xf000) == 0x8000)
4371 rv
= decode_LDSTpmod_0 (iw0
, outf
);
4372 else if ((iw0
& 0xff60) == 0x9e60)
4373 rv
= decode_dagMODim_0 (iw0
, outf
);
4374 else if ((iw0
& 0xfff0) == 0x9f60)
4375 rv
= decode_dagMODik_0 (iw0
, outf
);
4376 else if ((iw0
& 0xfc00) == 0x9c00)
4377 rv
= decode_dspLDST_0 (iw0
, outf
);
4378 else if ((iw0
& 0xf000) == 0x9000)
4379 rv
= decode_LDST_0 (iw0
, outf
);
4380 else if ((iw0
& 0xfc00) == 0xb800)
4381 rv
= decode_LDSTiiFP_0 (iw0
, outf
);
4382 else if ((iw0
& 0xe000) == 0xA000)
4383 rv
= decode_LDSTii_0 (iw0
, outf
);
4384 else if ((iw0
& 0xff80) == 0xe080 && (iw1
& 0x0C00) == 0x0000)
4385 rv
= decode_LoopSetup_0 (iw0
, iw1
, pc
, outf
);
4386 else if ((iw0
& 0xff00) == 0xe100 && (iw1
& 0x0000) == 0x0000)
4387 rv
= decode_LDIMMhalf_0 (iw0
, iw1
, outf
);
4388 else if ((iw0
& 0xfe00) == 0xe200 && (iw1
& 0x0000) == 0x0000)
4389 rv
= decode_CALLa_0 (iw0
, iw1
, pc
, outf
);
4390 else if ((iw0
& 0xfc00) == 0xe400 && (iw1
& 0x0000) == 0x0000)
4391 rv
= decode_LDSTidxI_0 (iw0
, iw1
, outf
);
4392 else if ((iw0
& 0xfffe) == 0xe800 && (iw1
& 0x0000) == 0x0000)
4393 rv
= decode_linkage_0 (iw0
, iw1
, outf
);
4394 else if ((iw0
& 0xf600) == 0xc000 && (iw1
& 0x0000) == 0x0000)
4395 rv
= decode_dsp32mac_0 (iw0
, iw1
, outf
);
4396 else if ((iw0
& 0xf600) == 0xc200 && (iw1
& 0x0000) == 0x0000)
4397 rv
= decode_dsp32mult_0 (iw0
, iw1
, outf
);
4398 else if ((iw0
& 0xf7c0) == 0xc400 && (iw1
& 0x0000) == 0x0000)
4399 rv
= decode_dsp32alu_0 (iw0
, iw1
, outf
);
4400 else if ((iw0
& 0xf780) == 0xc600 && (iw1
& 0x01c0) == 0x0000)
4401 rv
= decode_dsp32shift_0 (iw0
, iw1
, outf
);
4402 else if ((iw0
& 0xf780) == 0xc680 && (iw1
& 0x0000) == 0x0000)
4403 rv
= decode_dsp32shiftimm_0 (iw0
, iw1
, outf
);
4404 else if ((iw0
& 0xff00) == 0xf800)
4405 rv
= decode_pseudoDEBUG_0 (iw0
, outf
);
4407 else if ((iw0
& 0xFF00) == 0xF900)
4408 rv
= decode_pseudoOChar_0 (iw0
, iw1
, pc
, outf
);
4410 else if ((iw0
& 0xFFC0) == 0xf000 && (iw1
& 0x0000) == 0x0000)
4411 rv
= decode_pseudodbg_assert_0 (iw0
, iw1
, outf
);
4418 print_insn_bfin (bfd_vma pc
, disassemble_info
*outf
)
4425 status
= (*outf
->read_memory_func
) (pc
& ~0x01, buf
, 2, outf
);
4426 iw0
= bfd_getl16 (buf
);
4428 count
+= _print_insn_bfin (pc
, outf
);
4430 /* Proper display of multiple issue instructions. */
4432 if ((iw0
& 0xc000) == 0xc000 && (iw0
& BIT_MULTI_INS
)
4433 && ((iw0
& 0xe800) != 0xe800 /* Not Linkage. */ ))
4435 outf
->fprintf_func (outf
->stream
, " || ");
4436 count
+= _print_insn_bfin (pc
+ 4, outf
);
4437 outf
->fprintf_func (outf
->stream
, " || ");
4438 count
+= _print_insn_bfin (pc
+ 6, outf
);
4442 outf
->fprintf_func (outf
->stream
, "ILLEGAL");
4445 outf
->fprintf_func (outf
->stream
, ";");