1 /* Disassemble ADI Blackfin Instructions.
2 Copyright 2005, 2007 Free Software Foundation, Inc.
4 This file is part of libopcodes.
6 This library is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 It is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
25 #include "opcode/bfin.h"
47 #define HOST_LONG_WORD_SIZE (sizeof (long) * 8)
48 #define XFIELD(w,p,s) (((w) & ((1 << (s)) - 1) << (p)) >> (p))
49 #define SIGNEXTEND(v, n) ((v << (HOST_LONG_WORD_SIZE - (n))) >> (HOST_LONG_WORD_SIZE - (n)))
50 #define MASKBITS(val, bits) (val & ((1 << bits) - 1))
56 c_0
, c_1
, c_4
, c_2
, c_uimm2
, c_uimm3
, c_imm3
, c_pcrel4
,
57 c_imm4
, c_uimm4s4
, c_uimm4
, c_uimm4s2
, c_negimm5s4
, c_imm5
, c_uimm5
, c_imm6
,
58 c_imm7
, c_imm8
, c_uimm8
, c_pcrel8
, c_uimm8s4
, c_pcrel8s4
, c_lppcrel10
, c_pcrel10
,
59 c_pcrel12
, c_imm16s4
, c_luimm16
, c_imm16
, c_huimm16
, c_rimm16
, c_imm16s2
, c_uimm16s4
,
74 } constant_formats
[] =
76 { "0", 0, 0, 1, 0, 0, 0, 0, 0},
77 { "1", 0, 0, 1, 0, 0, 0, 0, 0},
78 { "4", 0, 0, 1, 0, 0, 0, 0, 0},
79 { "2", 0, 0, 1, 0, 0, 0, 0, 0},
80 { "uimm2", 2, 0, 0, 0, 0, 0, 0, 0},
81 { "uimm3", 3, 0, 0, 0, 0, 0, 0, 0},
82 { "imm3", 3, 0, 1, 0, 0, 0, 0, 0},
83 { "pcrel4", 4, 1, 0, 1, 1, 0, 0, 0},
84 { "imm4", 4, 0, 1, 0, 0, 0, 0, 0},
85 { "uimm4s4", 4, 0, 0, 0, 2, 0, 0, 1},
86 { "uimm4", 4, 0, 0, 0, 0, 0, 0, 0},
87 { "uimm4s2", 4, 0, 0, 0, 1, 0, 0, 1},
88 { "negimm5s4", 5, 0, 1, 0, 2, 0, 1, 0},
89 { "imm5", 5, 0, 1, 0, 0, 0, 0, 0},
90 { "uimm5", 5, 0, 0, 0, 0, 0, 0, 0},
91 { "imm6", 6, 0, 1, 0, 0, 0, 0, 0},
92 { "imm7", 7, 0, 1, 0, 0, 0, 0, 0},
93 { "imm8", 8, 0, 1, 0, 0, 0, 0, 0},
94 { "uimm8", 8, 0, 0, 0, 0, 0, 0, 0},
95 { "pcrel8", 8, 1, 0, 1, 1, 0, 0, 0},
96 { "uimm8s4", 8, 0, 0, 0, 2, 0, 0, 0},
97 { "pcrel8s4", 8, 1, 1, 1, 2, 0, 0, 0},
98 { "lppcrel10", 10, 1, 0, 1, 1, 0, 0, 0},
99 { "pcrel10", 10, 1, 1, 1, 1, 0, 0, 0},
100 { "pcrel12", 12, 1, 1, 1, 1, 0, 0, 0},
101 { "imm16s4", 16, 0, 1, 0, 2, 0, 0, 0},
102 { "luimm16", 16, 1, 0, 0, 0, 0, 0, 0},
103 { "imm16", 16, 0, 1, 0, 0, 0, 0, 0},
104 { "huimm16", 16, 1, 0, 0, 0, 0, 0, 0},
105 { "rimm16", 16, 1, 1, 0, 0, 0, 0, 0},
106 { "imm16s2", 16, 0, 1, 0, 1, 0, 0, 0},
107 { "uimm16s4", 16, 0, 0, 0, 2, 0, 0, 0},
108 { "uimm16", 16, 0, 0, 0, 0, 0, 0, 0},
109 { "pcrel24", 24, 1, 1, 1, 1, 0, 0, 0}
112 int _print_insn_bfin (bfd_vma pc
, disassemble_info
* outf
);
113 int print_insn_bfin (bfd_vma pc
, disassemble_info
* outf
);
116 fmtconst (const_forms_t cf
, TIword x
, bfd_vma pc
, disassemble_info
* outf
)
120 if (constant_formats
[cf
].reloc
)
122 bfd_vma ea
= (((constant_formats
[cf
].pcrel
? SIGNEXTEND (x
, constant_formats
[cf
].nbits
)
123 : x
) + constant_formats
[cf
].offset
) << constant_formats
[cf
].scale
);
124 if (constant_formats
[cf
].pcrel
)
127 outf
->print_address_func (ea
, outf
);
131 /* Negative constants have an implied sign bit. */
132 if (constant_formats
[cf
].negative
)
134 int nb
= constant_formats
[cf
].nbits
+ 1;
136 x
= x
| (1 << constant_formats
[cf
].nbits
);
137 x
= SIGNEXTEND (x
, nb
);
140 x
= constant_formats
[cf
].issigned
? SIGNEXTEND (x
, constant_formats
[cf
].nbits
) : x
;
142 if (constant_formats
[cf
].offset
)
143 x
+= constant_formats
[cf
].offset
;
145 if (constant_formats
[cf
].scale
)
146 x
<<= constant_formats
[cf
].scale
;
148 if (constant_formats
[cf
].issigned
&& x
< 0)
149 sprintf (buf
, "%ld", x
);
151 sprintf (buf
, "0x%lx", x
);
156 enum machine_registers
158 REG_RL0
, REG_RL1
, REG_RL2
, REG_RL3
, REG_RL4
, REG_RL5
, REG_RL6
, REG_RL7
,
159 REG_RH0
, REG_RH1
, REG_RH2
, REG_RH3
, REG_RH4
, REG_RH5
, REG_RH6
, REG_RH7
,
160 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
161 REG_R1_0
, REG_R3_2
, REG_R5_4
, REG_R7_6
, REG_P0
, REG_P1
, REG_P2
, REG_P3
,
162 REG_P4
, REG_P5
, REG_SP
, REG_FP
, REG_A0x
, REG_A1x
, REG_A0w
, REG_A1w
,
163 REG_A0
, REG_A1
, REG_I0
, REG_I1
, REG_I2
, REG_I3
, REG_M0
, REG_M1
,
164 REG_M2
, REG_M3
, REG_B0
, REG_B1
, REG_B2
, REG_B3
, REG_L0
, REG_L1
,
166 REG_AZ
, REG_AN
, REG_AC0
, REG_AC1
, REG_AV0
, REG_AV1
, REG_AV0S
, REG_AV1S
,
167 REG_AQ
, REG_V
, REG_VS
,
168 REG_sftreset
, REG_omode
, REG_excause
, REG_emucause
, REG_idle_req
, REG_hwerrcause
, REG_CC
, REG_LC0
,
169 REG_LC1
, REG_GP
, REG_ASTAT
, REG_RETS
, REG_LT0
, REG_LB0
, REG_LT1
, REG_LB1
,
170 REG_CYCLES
, REG_CYCLES2
, REG_USP
, REG_SEQSTAT
, REG_SYSCFG
, REG_RETI
, REG_RETX
, REG_RETN
,
171 REG_RETE
, REG_EMUDAT
, REG_BR0
, REG_BR1
, REG_BR2
, REG_BR3
, REG_BR4
, REG_BR5
, REG_BR6
,
172 REG_BR7
, REG_PL0
, REG_PL1
, REG_PL2
, REG_PL3
, REG_PL4
, REG_PL5
, REG_SLP
, REG_FLP
,
173 REG_PH0
, REG_PH1
, REG_PH2
, REG_PH3
, REG_PH4
, REG_PH5
, REG_SHP
, REG_FHP
,
174 REG_IL0
, REG_IL1
, REG_IL2
, REG_IL3
, REG_ML0
, REG_ML1
, REG_ML2
, REG_ML3
,
175 REG_BL0
, REG_BL1
, REG_BL2
, REG_BL3
, REG_LL0
, REG_LL1
, REG_LL2
, REG_LL3
,
176 REG_IH0
, REG_IH1
, REG_IH2
, REG_IH3
, REG_MH0
, REG_MH1
, REG_MH2
, REG_MH3
,
177 REG_BH0
, REG_BH1
, REG_BH2
, REG_BH3
, REG_LH0
, REG_LH1
, REG_LH2
, REG_LH3
,
183 rc_dregs_lo
, rc_dregs_hi
, rc_dregs
, rc_dregs_pair
, rc_pregs
, rc_spfp
, rc_dregs_hilo
, rc_accum_ext
,
184 rc_accum_word
, rc_accum
, rc_iregs
, rc_mregs
, rc_bregs
, rc_lregs
, rc_dpregs
, rc_gregs
,
185 rc_regs
, rc_statbits
, rc_ignore_bits
, rc_ccstat
, rc_counters
, rc_dregs2_sysregs1
, rc_open
, rc_sysregs2
,
186 rc_sysregs3
, rc_allregs
,
190 static char *reg_names
[] =
192 "R0.L", "R1.L", "R2.L", "R3.L", "R4.L", "R5.L", "R6.L", "R7.L",
193 "R0.H", "R1.H", "R2.H", "R3.H", "R4.H", "R5.H", "R6.H", "R7.H",
194 "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7",
195 "R1:0", "R3:2", "R5:4", "R7:6", "P0", "P1", "P2", "P3",
196 "P4", "P5", "SP", "FP", "A0.x", "A1.x", "A0.w", "A1.w",
197 "A0", "A1", "I0", "I1", "I2", "I3", "M0", "M1",
198 "M2", "M3", "B0", "B1", "B2", "B3", "L0", "L1",
200 "AZ", "AN", "AC0", "AC1", "AV0", "AV1", "AV0S", "AV1S",
202 "sftreset", "omode", "excause", "emucause", "idle_req", "hwerrcause", "CC", "LC0",
203 "LC1", "GP", "ASTAT", "RETS", "LT0", "LB0", "LT1", "LB1",
204 "CYCLES", "CYCLES2", "USP", "SEQSTAT", "SYSCFG", "RETI", "RETX", "RETN",
206 "R0.B", "R1.B", "R2.B", "R3.B", "R4.B", "R5.B", "R6.B", "R7.B",
207 "P0.L", "P1.L", "P2.L", "P3.L", "P4.L", "P5.L", "SP.L", "FP.L",
208 "P0.H", "P1.H", "P2.H", "P3.H", "P4.H", "P5.H", "SP.H", "FP.H",
209 "I0.L", "I1.L", "I2.L", "I3.L", "M0.L", "M1.L", "M2.L", "M3.L",
210 "B0.L", "B1.L", "B2.L", "B3.L", "L0.L", "L1.L", "L2.L", "L3.L",
211 "I0.H", "I1.H", "I2.H", "I3.H", "M0.H", "M1.H", "M2.H", "M3.H",
212 "B0.H", "B1.H", "B2.H", "B3.H", "L0.H", "L1.H", "L2.H", "L3.H",
217 #define REGNAME(x) ((x) < REG_LASTREG ? (reg_names[x]) : "...... Illegal register .......")
220 static enum machine_registers decode_dregs_lo
[] =
222 REG_RL0
, REG_RL1
, REG_RL2
, REG_RL3
, REG_RL4
, REG_RL5
, REG_RL6
, REG_RL7
,
225 #define dregs_lo(x) REGNAME (decode_dregs_lo[(x) & 7])
228 static enum machine_registers decode_dregs_hi
[] =
230 REG_RH0
, REG_RH1
, REG_RH2
, REG_RH3
, REG_RH4
, REG_RH5
, REG_RH6
, REG_RH7
,
233 #define dregs_hi(x) REGNAME (decode_dregs_hi[(x) & 7])
236 static enum machine_registers decode_dregs
[] =
238 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
241 #define dregs(x) REGNAME (decode_dregs[(x) & 7])
244 static enum machine_registers decode_dregs_byte
[] =
246 REG_BR0
, REG_BR1
, REG_BR2
, REG_BR3
, REG_BR4
, REG_BR5
, REG_BR6
, REG_BR7
,
249 #define dregs_byte(x) REGNAME (decode_dregs_byte[(x) & 7])
250 #define dregs_pair(x) REGNAME (decode_dregs_pair[(x) & 7])
253 static enum machine_registers decode_pregs
[] =
255 REG_P0
, REG_P1
, REG_P2
, REG_P3
, REG_P4
, REG_P5
, REG_SP
, REG_FP
,
258 #define pregs(x) REGNAME (decode_pregs[(x) & 7])
259 #define spfp(x) REGNAME (decode_spfp[(x) & 1])
260 #define dregs_hilo(x,i) REGNAME (decode_dregs_hilo[((i) << 3)|x])
261 #define accum_ext(x) REGNAME (decode_accum_ext[(x) & 1])
262 #define accum_word(x) REGNAME (decode_accum_word[(x) & 1])
263 #define accum(x) REGNAME (decode_accum[(x) & 1])
266 static enum machine_registers decode_iregs
[] =
268 REG_I0
, REG_I1
, REG_I2
, REG_I3
,
271 #define iregs(x) REGNAME (decode_iregs[(x) & 3])
274 static enum machine_registers decode_mregs
[] =
276 REG_M0
, REG_M1
, REG_M2
, REG_M3
,
279 #define mregs(x) REGNAME (decode_mregs[(x) & 3])
280 #define bregs(x) REGNAME (decode_bregs[(x) & 3])
281 #define lregs(x) REGNAME (decode_lregs[(x) & 3])
284 static enum machine_registers decode_dpregs
[] =
286 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
287 REG_P0
, REG_P1
, REG_P2
, REG_P3
, REG_P4
, REG_P5
, REG_SP
, REG_FP
,
290 #define dpregs(x) REGNAME (decode_dpregs[(x) & 15])
293 static enum machine_registers decode_gregs
[] =
295 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
296 REG_P0
, REG_P1
, REG_P2
, REG_P3
, REG_P4
, REG_P5
, REG_SP
, REG_FP
,
299 #define gregs(x,i) REGNAME (decode_gregs[((i) << 3)|x])
301 /* [dregs pregs (iregs mregs) (bregs lregs)]. */
302 static enum machine_registers decode_regs
[] =
304 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
305 REG_P0
, REG_P1
, REG_P2
, REG_P3
, REG_P4
, REG_P5
, REG_SP
, REG_FP
,
306 REG_I0
, REG_I1
, REG_I2
, REG_I3
, REG_M0
, REG_M1
, REG_M2
, REG_M3
,
307 REG_B0
, REG_B1
, REG_B2
, REG_B3
, REG_L0
, REG_L1
, REG_L2
, REG_L3
,
310 #define regs(x,i) REGNAME (decode_regs[((i) << 3)|x])
312 /* [dregs pregs (iregs mregs) (bregs lregs) Low Half]. */
313 static enum machine_registers decode_regs_lo
[] =
315 REG_RL0
, REG_RL1
, REG_RL2
, REG_RL3
, REG_RL4
, REG_RL5
, REG_RL6
, REG_RL7
,
316 REG_PL0
, REG_PL1
, REG_PL2
, REG_PL3
, REG_PL4
, REG_PL5
, REG_SLP
, REG_FLP
,
317 REG_IL0
, REG_IL1
, REG_IL2
, REG_IL3
, REG_ML0
, REG_ML1
, REG_ML2
, REG_ML3
,
318 REG_BL0
, REG_BL1
, REG_BL2
, REG_BL3
, REG_LL0
, REG_LL1
, REG_LL2
, REG_LL3
,
321 #define regs_lo(x,i) REGNAME (decode_regs_lo[((i) << 3)|x])
322 /* [dregs pregs (iregs mregs) (bregs lregs) High Half]. */
323 static enum machine_registers decode_regs_hi
[] =
325 REG_RH0
, REG_RH1
, REG_RH2
, REG_RH3
, REG_RH4
, REG_RH5
, REG_RH6
, REG_RH7
,
326 REG_PH0
, REG_PH1
, REG_PH2
, REG_PH3
, REG_PH4
, REG_PH5
, REG_SHP
, REG_FHP
,
327 REG_IH0
, REG_IH1
, REG_IH2
, REG_IH3
, REG_MH0
, REG_MH1
, REG_LH2
, REG_MH3
,
328 REG_BH0
, REG_BH1
, REG_BH2
, REG_BH3
, REG_LH0
, REG_LH1
, REG_LH2
, REG_LH3
,
331 #define regs_hi(x,i) REGNAME (decode_regs_hi[((i) << 3)|x])
333 static enum machine_registers decode_statbits
[] =
335 REG_AZ
, REG_AN
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_AQ
, REG_LASTREG
,
336 REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_AC0
, REG_AC1
, REG_LASTREG
, REG_LASTREG
,
337 REG_AV0
, REG_AV0S
, REG_AV1
, REG_AV1S
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
,
338 REG_V
, REG_VS
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
,
341 #define statbits(x) REGNAME (decode_statbits[(x) & 31])
342 #define ignore_bits(x) REGNAME (decode_ignore_bits[(x) & 7])
343 #define ccstat(x) REGNAME (decode_ccstat[(x) & 0])
346 static enum machine_registers decode_counters
[] =
351 #define counters(x) REGNAME (decode_counters[(x) & 1])
352 #define dregs2_sysregs1(x) REGNAME (decode_dregs2_sysregs1[(x) & 7])
354 /* [dregs pregs (iregs mregs) (bregs lregs)
355 dregs2_sysregs1 open sysregs2 sysregs3]. */
356 static enum machine_registers decode_allregs
[] =
358 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
359 REG_P0
, REG_P1
, REG_P2
, REG_P3
, REG_P4
, REG_P5
, REG_SP
, REG_FP
,
360 REG_I0
, REG_I1
, REG_I2
, REG_I3
, REG_M0
, REG_M1
, REG_M2
, REG_M3
,
361 REG_B0
, REG_B1
, REG_B2
, REG_B3
, REG_L0
, REG_L1
, REG_L2
, REG_L3
,
362 REG_A0x
, REG_A0w
, REG_A1x
, REG_A1w
, REG_GP
, REG_LASTREG
, REG_ASTAT
, REG_RETS
,
363 REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
,
364 REG_LC0
, REG_LT0
, REG_LB0
, REG_LC1
, REG_LT1
, REG_LB1
, REG_CYCLES
, REG_CYCLES2
,
365 REG_USP
, REG_SEQSTAT
, REG_SYSCFG
, REG_RETI
, REG_RETX
, REG_RETN
, REG_RETE
, REG_EMUDAT
, REG_LASTREG
,
368 #define allregs(x,i) REGNAME (decode_allregs[((i) << 3) | x])
369 #define uimm16s4(x) fmtconst (c_uimm16s4, x, 0, outf)
370 #define pcrel4(x) fmtconst (c_pcrel4, x, pc, outf)
371 #define pcrel8(x) fmtconst (c_pcrel8, x, pc, outf)
372 #define pcrel8s4(x) fmtconst (c_pcrel8s4, x, pc, outf)
373 #define pcrel10(x) fmtconst (c_pcrel10, x, pc, outf)
374 #define pcrel12(x) fmtconst (c_pcrel12, x, pc, outf)
375 #define negimm5s4(x) fmtconst (c_negimm5s4, x, 0, outf)
376 #define rimm16(x) fmtconst (c_rimm16, x, 0, outf)
377 #define huimm16(x) fmtconst (c_huimm16, x, 0, outf)
378 #define imm16(x) fmtconst (c_imm16, x, 0, outf)
379 #define uimm2(x) fmtconst (c_uimm2, x, 0, outf)
380 #define uimm3(x) fmtconst (c_uimm3, x, 0, outf)
381 #define luimm16(x) fmtconst (c_luimm16, x, 0, outf)
382 #define uimm4(x) fmtconst (c_uimm4, x, 0, outf)
383 #define uimm5(x) fmtconst (c_uimm5, x, 0, outf)
384 #define imm16s2(x) fmtconst (c_imm16s2, x, 0, outf)
385 #define uimm8(x) fmtconst (c_uimm8, x, 0, outf)
386 #define imm16s4(x) fmtconst (c_imm16s4, x, 0, outf)
387 #define uimm4s2(x) fmtconst (c_uimm4s2, x, 0, outf)
388 #define uimm4s4(x) fmtconst (c_uimm4s4, x, 0, outf)
389 #define lppcrel10(x) fmtconst (c_lppcrel10, x, pc, outf)
390 #define imm3(x) fmtconst (c_imm3, x, 0, outf)
391 #define imm4(x) fmtconst (c_imm4, x, 0, outf)
392 #define uimm8s4(x) fmtconst (c_uimm8s4, x, 0, outf)
393 #define imm5(x) fmtconst (c_imm5, x, 0, outf)
394 #define imm6(x) fmtconst (c_imm6, x, 0, outf)
395 #define imm7(x) fmtconst (c_imm7, x, 0, outf)
396 #define imm8(x) fmtconst (c_imm8, x, 0, outf)
397 #define pcrel24(x) fmtconst (c_pcrel24, x, pc, outf)
398 #define uimm16(x) fmtconst (c_uimm16, x, 0, outf)
400 /* (arch.pm)arch_disassembler_functions. */
402 #define OUTS(p, txt) ((p) ? (((txt)[0]) ? (p->fprintf_func)(p->stream, txt) :0) :0)
406 amod0 (int s0
, int x0
, disassemble_info
*outf
)
408 if (s0
== 1 && x0
== 0)
410 else if (s0
== 0 && x0
== 1)
412 else if (s0
== 1 && x0
== 1)
413 OUTS (outf
, "(SCO)");
417 amod1 (int s0
, int x0
, disassemble_info
*outf
)
419 if (s0
== 0 && x0
== 0)
421 else if (s0
== 1 && x0
== 0)
426 amod0amod2 (int s0
, int x0
, int aop0
, disassemble_info
*outf
)
428 if (s0
== 1 && x0
== 0 && aop0
== 0)
430 else if (s0
== 0 && x0
== 1 && aop0
== 0)
432 else if (s0
== 1 && x0
== 1 && aop0
== 0)
433 OUTS (outf
, "(SCO)");
434 else if (s0
== 0 && x0
== 0 && aop0
== 2)
435 OUTS (outf
, "(ASR)");
436 else if (s0
== 1 && x0
== 0 && aop0
== 2)
437 OUTS (outf
, "(S,ASR)");
438 else if (s0
== 0 && x0
== 1 && aop0
== 2)
439 OUTS (outf
, "(CO,ASR)");
440 else if (s0
== 1 && x0
== 1 && aop0
== 2)
441 OUTS (outf
, "(SCO,ASR)");
442 else if (s0
== 0 && x0
== 0 && aop0
== 3)
443 OUTS (outf
, "(ASL)");
444 else if (s0
== 1 && x0
== 0 && aop0
== 3)
445 OUTS (outf
, "(S,ASL)");
446 else if (s0
== 0 && x0
== 1 && aop0
== 3)
447 OUTS (outf
, "(CO,ASL)");
448 else if (s0
== 1 && x0
== 1 && aop0
== 3)
449 OUTS (outf
, "(SCO,ASL)");
453 searchmod (int r0
, disassemble_info
*outf
)
466 aligndir (int r0
, disassemble_info
*outf
)
473 decode_multfunc (int h0
, int h1
, int src0
, int src1
, disassemble_info
* outf
)
478 s0
= dregs_hi (src0
);
480 s0
= dregs_lo (src0
);
483 s1
= dregs_hi (src1
);
485 s1
= dregs_lo (src1
);
494 decode_macfunc (int which
, int op
, int h0
, int h1
, int src0
, int src1
, disassemble_info
* outf
)
497 char *sop
= "<unknown op>";
512 case 0: sop
= "="; break;
513 case 1: sop
= "+="; break;
514 case 2: sop
= "-="; break;
522 decode_multfunc (h0
, h1
, src0
, src1
, outf
);
528 decode_optmode (int mod
, int MM
, disassemble_info
*outf
)
530 if (mod
== 0 && MM
== 0)
545 OUTS (outf
, "S2RND");
548 else if (mod
== M_W32
)
550 else if (mod
== M_FU
)
552 else if (mod
== M_TFU
)
554 else if (mod
== M_IS
)
556 else if (mod
== M_ISS2
)
558 else if (mod
== M_IH
)
560 else if (mod
== M_IU
)
569 decode_ProgCtrl_0 (TIword iw0
, disassemble_info
*outf
)
572 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
573 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |.prgfunc.......|.poprnd........|
574 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
575 int poprnd
= ((iw0
>> ProgCtrl_poprnd_bits
) & ProgCtrl_poprnd_mask
);
576 int prgfunc
= ((iw0
>> ProgCtrl_prgfunc_bits
) & ProgCtrl_prgfunc_mask
);
578 if (prgfunc
== 0 && poprnd
== 0)
580 else if (prgfunc
== 1 && poprnd
== 0)
582 else if (prgfunc
== 1 && poprnd
== 1)
584 else if (prgfunc
== 1 && poprnd
== 2)
586 else if (prgfunc
== 1 && poprnd
== 3)
588 else if (prgfunc
== 1 && poprnd
== 4)
590 else if (prgfunc
== 2 && poprnd
== 0)
592 else if (prgfunc
== 2 && poprnd
== 3)
593 OUTS (outf
, "CSYNC");
594 else if (prgfunc
== 2 && poprnd
== 4)
595 OUTS (outf
, "SSYNC");
596 else if (prgfunc
== 2 && poprnd
== 5)
597 OUTS (outf
, "EMUEXCPT");
598 else if (prgfunc
== 3)
601 OUTS (outf
, dregs (poprnd
));
603 else if (prgfunc
== 4)
606 OUTS (outf
, dregs (poprnd
));
608 else if (prgfunc
== 5)
610 OUTS (outf
, "JUMP (");
611 OUTS (outf
, pregs (poprnd
));
614 else if (prgfunc
== 6)
616 OUTS (outf
, "CALL (");
617 OUTS (outf
, pregs (poprnd
));
620 else if (prgfunc
== 7)
622 OUTS (outf
, "CALL (PC+");
623 OUTS (outf
, pregs (poprnd
));
626 else if (prgfunc
== 8)
628 OUTS (outf
, "JUMP (PC+");
629 OUTS (outf
, pregs (poprnd
));
632 else if (prgfunc
== 9)
634 OUTS (outf
, "RAISE ");
635 OUTS (outf
, uimm4 (poprnd
));
637 else if (prgfunc
== 10)
639 OUTS (outf
, "EXCPT ");
640 OUTS (outf
, uimm4 (poprnd
));
642 else if (prgfunc
== 11)
644 OUTS (outf
, "TESTSET (");
645 OUTS (outf
, pregs (poprnd
));
654 decode_CaCTRL_0 (TIword iw0
, disassemble_info
*outf
)
657 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
658 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 |.a.|.op....|.reg.......|
659 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
660 int a
= ((iw0
>> CaCTRL_a_bits
) & CaCTRL_a_mask
);
661 int op
= ((iw0
>> CaCTRL_op_bits
) & CaCTRL_op_mask
);
662 int reg
= ((iw0
>> CaCTRL_reg_bits
) & CaCTRL_reg_mask
);
664 if (a
== 0 && op
== 0)
666 OUTS (outf
, "PREFETCH[");
667 OUTS (outf
, pregs (reg
));
670 else if (a
== 0 && op
== 1)
672 OUTS (outf
, "FLUSHINV[");
673 OUTS (outf
, pregs (reg
));
676 else if (a
== 0 && op
== 2)
678 OUTS (outf
, "FLUSH[");
679 OUTS (outf
, pregs (reg
));
682 else if (a
== 0 && op
== 3)
684 OUTS (outf
, "IFLUSH[");
685 OUTS (outf
, pregs (reg
));
688 else if (a
== 1 && op
== 0)
690 OUTS (outf
, "PREFETCH[");
691 OUTS (outf
, pregs (reg
));
694 else if (a
== 1 && op
== 1)
696 OUTS (outf
, "FLUSHINV[");
697 OUTS (outf
, pregs (reg
));
700 else if (a
== 1 && op
== 2)
702 OUTS (outf
, "FLUSH[");
703 OUTS (outf
, pregs (reg
));
706 else if (a
== 1 && op
== 3)
708 OUTS (outf
, "IFLUSH[");
709 OUTS (outf
, pregs (reg
));
718 decode_PushPopReg_0 (TIword iw0
, disassemble_info
*outf
)
721 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
722 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |.W.|.grp.......|.reg.......|
723 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
724 int W
= ((iw0
>> PushPopReg_W_bits
) & PushPopReg_W_mask
);
725 int grp
= ((iw0
>> PushPopReg_grp_bits
) & PushPopReg_grp_mask
);
726 int reg
= ((iw0
>> PushPopReg_reg_bits
) & PushPopReg_reg_mask
);
730 OUTS (outf
, allregs (reg
, grp
));
731 OUTS (outf
, " = [SP++]");
735 OUTS (outf
, "[--SP] = ");
736 OUTS (outf
, allregs (reg
, grp
));
744 decode_PushPopMultiple_0 (TIword iw0
, disassemble_info
*outf
)
747 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
748 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |.d.|.p.|.W.|.dr........|.pr........|
749 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
750 int p
= ((iw0
>> PushPopMultiple_p_bits
) & PushPopMultiple_p_mask
);
751 int d
= ((iw0
>> PushPopMultiple_d_bits
) & PushPopMultiple_d_mask
);
752 int W
= ((iw0
>> PushPopMultiple_W_bits
) & PushPopMultiple_W_mask
);
753 int dr
= ((iw0
>> PushPopMultiple_dr_bits
) & PushPopMultiple_dr_mask
);
754 int pr
= ((iw0
>> PushPopMultiple_pr_bits
) & PushPopMultiple_pr_mask
);
757 sprintf (ps
, "%d", pr
);
758 sprintf (ds
, "%d", dr
);
760 if (W
== 1 && d
== 1 && p
== 1)
762 OUTS (outf
, "[--SP] = (R7:");
764 OUTS (outf
, ", P5:");
768 else if (W
== 1 && d
== 1 && p
== 0)
770 OUTS (outf
, "[--SP] = (R7:");
774 else if (W
== 1 && d
== 0 && p
== 1)
776 OUTS (outf
, "[--SP] = (P5:");
780 else if (W
== 0 && d
== 1 && p
== 1)
784 OUTS (outf
, ", P5:");
786 OUTS (outf
, ") = [SP++]");
788 else if (W
== 0 && d
== 1 && p
== 0)
792 OUTS (outf
, ") = [SP++]");
794 else if (W
== 0 && d
== 0 && p
== 1)
798 OUTS (outf
, ") = [SP++]");
806 decode_ccMV_0 (TIword iw0
, disassemble_info
*outf
)
809 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
810 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |.T.|.d.|.s.|.dst.......|.src.......|
811 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
812 int s
= ((iw0
>> CCmv_s_bits
) & CCmv_s_mask
);
813 int d
= ((iw0
>> CCmv_d_bits
) & CCmv_d_mask
);
814 int T
= ((iw0
>> CCmv_T_bits
) & CCmv_T_mask
);
815 int src
= ((iw0
>> CCmv_src_bits
) & CCmv_src_mask
);
816 int dst
= ((iw0
>> CCmv_dst_bits
) & CCmv_dst_mask
);
820 OUTS (outf
, "IF CC ");
821 OUTS (outf
, gregs (dst
, d
));
823 OUTS (outf
, gregs (src
, s
));
827 OUTS (outf
, "IF ! CC ");
828 OUTS (outf
, gregs (dst
, d
));
830 OUTS (outf
, gregs (src
, s
));
838 decode_CCflag_0 (TIword iw0
, disassemble_info
*outf
)
841 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
842 | 0 | 0 | 0 | 0 | 1 |.I.|.opc.......|.G.|.y.........|.x.........|
843 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
844 int x
= ((iw0
>> CCflag_x_bits
) & CCflag_x_mask
);
845 int y
= ((iw0
>> CCflag_y_bits
) & CCflag_y_mask
);
846 int I
= ((iw0
>> CCflag_I_bits
) & CCflag_I_mask
);
847 int G
= ((iw0
>> CCflag_G_bits
) & CCflag_G_mask
);
848 int opc
= ((iw0
>> CCflag_opc_bits
) & CCflag_opc_mask
);
850 if (opc
== 0 && I
== 0 && G
== 0)
853 OUTS (outf
, dregs (x
));
855 OUTS (outf
, dregs (y
));
857 else if (opc
== 1 && I
== 0 && G
== 0)
860 OUTS (outf
, dregs (x
));
862 OUTS (outf
, dregs (y
));
864 else if (opc
== 2 && I
== 0 && G
== 0)
867 OUTS (outf
, dregs (x
));
869 OUTS (outf
, dregs (y
));
871 else if (opc
== 3 && I
== 0 && G
== 0)
874 OUTS (outf
, dregs (x
));
876 OUTS (outf
, dregs (y
));
879 else if (opc
== 4 && I
== 0 && G
== 0)
882 OUTS (outf
, dregs (x
));
884 OUTS (outf
, dregs (y
));
887 else if (opc
== 0 && I
== 1 && G
== 0)
890 OUTS (outf
, dregs (x
));
892 OUTS (outf
, imm3 (y
));
894 else if (opc
== 1 && I
== 1 && G
== 0)
897 OUTS (outf
, dregs (x
));
899 OUTS (outf
, imm3 (y
));
901 else if (opc
== 2 && I
== 1 && G
== 0)
904 OUTS (outf
, dregs (x
));
906 OUTS (outf
, imm3 (y
));
908 else if (opc
== 3 && I
== 1 && G
== 0)
911 OUTS (outf
, dregs (x
));
913 OUTS (outf
, uimm3 (y
));
916 else if (opc
== 4 && I
== 1 && G
== 0)
919 OUTS (outf
, dregs (x
));
921 OUTS (outf
, uimm3 (y
));
924 else if (opc
== 0 && I
== 0 && G
== 1)
927 OUTS (outf
, pregs (x
));
929 OUTS (outf
, pregs (y
));
931 else if (opc
== 1 && I
== 0 && G
== 1)
934 OUTS (outf
, pregs (x
));
936 OUTS (outf
, pregs (y
));
938 else if (opc
== 2 && I
== 0 && G
== 1)
941 OUTS (outf
, pregs (x
));
943 OUTS (outf
, pregs (y
));
945 else if (opc
== 3 && I
== 0 && G
== 1)
948 OUTS (outf
, pregs (x
));
950 OUTS (outf
, pregs (y
));
953 else if (opc
== 4 && I
== 0 && G
== 1)
956 OUTS (outf
, pregs (x
));
958 OUTS (outf
, pregs (y
));
961 else if (opc
== 0 && I
== 1 && G
== 1)
964 OUTS (outf
, pregs (x
));
966 OUTS (outf
, imm3 (y
));
968 else if (opc
== 1 && I
== 1 && G
== 1)
971 OUTS (outf
, pregs (x
));
973 OUTS (outf
, imm3 (y
));
975 else if (opc
== 2 && I
== 1 && G
== 1)
978 OUTS (outf
, pregs (x
));
980 OUTS (outf
, imm3 (y
));
982 else if (opc
== 3 && I
== 1 && G
== 1)
985 OUTS (outf
, pregs (x
));
987 OUTS (outf
, uimm3 (y
));
990 else if (opc
== 4 && I
== 1 && G
== 1)
993 OUTS (outf
, pregs (x
));
995 OUTS (outf
, uimm3 (y
));
998 else if (opc
== 5 && I
== 0 && G
== 0)
999 OUTS (outf
, "CC=A0==A1");
1001 else if (opc
== 6 && I
== 0 && G
== 0)
1002 OUTS (outf
, "CC=A0<A1");
1004 else if (opc
== 7 && I
== 0 && G
== 0)
1005 OUTS (outf
, "CC=A0<=A1");
1013 decode_CC2dreg_0 (TIword iw0
, disassemble_info
*outf
)
1016 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1017 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |.op....|.reg.......|
1018 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1019 int op
= ((iw0
>> CC2dreg_op_bits
) & CC2dreg_op_mask
);
1020 int reg
= ((iw0
>> CC2dreg_reg_bits
) & CC2dreg_reg_mask
);
1024 OUTS (outf
, dregs (reg
));
1030 OUTS (outf
, dregs (reg
));
1033 OUTS (outf
, "CC=!CC");
1041 decode_CC2stat_0 (TIword iw0
, disassemble_info
*outf
)
1044 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1045 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |.D.|.op....|.cbit..............|
1046 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1047 int D
= ((iw0
>> CC2stat_D_bits
) & CC2stat_D_mask
);
1048 int op
= ((iw0
>> CC2stat_op_bits
) & CC2stat_op_mask
);
1049 int cbit
= ((iw0
>> CC2stat_cbit_bits
) & CC2stat_cbit_mask
);
1051 if (op
== 0 && D
== 0)
1053 OUTS (outf
, "CC = ");
1054 OUTS (outf
, statbits (cbit
));
1056 else if (op
== 1 && D
== 0)
1058 OUTS (outf
, "CC|=");
1059 OUTS (outf
, statbits (cbit
));
1061 else if (op
== 2 && D
== 0)
1063 OUTS (outf
, "CC&=");
1064 OUTS (outf
, statbits (cbit
));
1066 else if (op
== 3 && D
== 0)
1068 OUTS (outf
, "CC^=");
1069 OUTS (outf
, statbits (cbit
));
1071 else if (op
== 0 && D
== 1)
1073 OUTS (outf
, statbits (cbit
));
1076 else if (op
== 1 && D
== 1)
1078 OUTS (outf
, statbits (cbit
));
1079 OUTS (outf
, "|=CC");
1081 else if (op
== 2 && D
== 1)
1083 OUTS (outf
, statbits (cbit
));
1084 OUTS (outf
, "&=CC");
1086 else if (op
== 3 && D
== 1)
1088 OUTS (outf
, statbits (cbit
));
1089 OUTS (outf
, "^=CC");
1098 decode_BRCC_0 (TIword iw0
, bfd_vma pc
, disassemble_info
*outf
)
1101 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1102 | 0 | 0 | 0 | 1 |.T.|.B.|.offset................................|
1103 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1104 int B
= ((iw0
>> BRCC_B_bits
) & BRCC_B_mask
);
1105 int T
= ((iw0
>> BRCC_T_bits
) & BRCC_T_mask
);
1106 int offset
= ((iw0
>> BRCC_offset_bits
) & BRCC_offset_mask
);
1108 if (T
== 1 && B
== 1)
1110 OUTS (outf
, "IF CC JUMP ");
1111 OUTS (outf
, pcrel10 (offset
));
1112 OUTS (outf
, "(BP)");
1114 else if (T
== 0 && B
== 1)
1116 OUTS (outf
, "IF ! CC JUMP ");
1117 OUTS (outf
, pcrel10 (offset
));
1118 OUTS (outf
, "(BP)");
1122 OUTS (outf
, "IF CC JUMP ");
1123 OUTS (outf
, pcrel10 (offset
));
1127 OUTS (outf
, "IF ! CC JUMP ");
1128 OUTS (outf
, pcrel10 (offset
));
1137 decode_UJUMP_0 (TIword iw0
, bfd_vma pc
, disassemble_info
*outf
)
1140 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1141 | 0 | 0 | 1 | 0 |.offset........................................|
1142 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1143 int offset
= ((iw0
>> UJump_offset_bits
) & UJump_offset_mask
);
1145 OUTS (outf
, "JUMP.S ");
1146 OUTS (outf
, pcrel12 (offset
));
1151 decode_REGMV_0 (TIword iw0
, disassemble_info
*outf
)
1154 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1155 | 0 | 0 | 1 | 1 |.gd........|.gs........|.dst.......|.src.......|
1156 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1157 int gs
= ((iw0
>> RegMv_gs_bits
) & RegMv_gs_mask
);
1158 int gd
= ((iw0
>> RegMv_gd_bits
) & RegMv_gd_mask
);
1159 int src
= ((iw0
>> RegMv_src_bits
) & RegMv_src_mask
);
1160 int dst
= ((iw0
>> RegMv_dst_bits
) & RegMv_dst_mask
);
1162 OUTS (outf
, allregs (dst
, gd
));
1164 OUTS (outf
, allregs (src
, gs
));
1169 decode_ALU2op_0 (TIword iw0
, disassemble_info
*outf
)
1172 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1173 | 0 | 1 | 0 | 0 | 0 | 0 |.opc...........|.src.......|.dst.......|
1174 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1175 int src
= ((iw0
>> ALU2op_src_bits
) & ALU2op_src_mask
);
1176 int opc
= ((iw0
>> ALU2op_opc_bits
) & ALU2op_opc_mask
);
1177 int dst
= ((iw0
>> ALU2op_dst_bits
) & ALU2op_dst_mask
);
1181 OUTS (outf
, dregs (dst
));
1182 OUTS (outf
, ">>>=");
1183 OUTS (outf
, dregs (src
));
1187 OUTS (outf
, dregs (dst
));
1189 OUTS (outf
, dregs (src
));
1193 OUTS (outf
, dregs (dst
));
1195 OUTS (outf
, dregs (src
));
1199 OUTS (outf
, dregs (dst
));
1201 OUTS (outf
, dregs (src
));
1205 OUTS (outf
, dregs (dst
));
1207 OUTS (outf
, dregs (dst
));
1209 OUTS (outf
, dregs (src
));
1210 OUTS (outf
, ")<<1");
1214 OUTS (outf
, dregs (dst
));
1216 OUTS (outf
, dregs (dst
));
1218 OUTS (outf
, dregs (src
));
1219 OUTS (outf
, ")<<2");
1223 OUTS (outf
, "DIVQ(");
1224 OUTS (outf
, dregs (dst
));
1226 OUTS (outf
, dregs (src
));
1231 OUTS (outf
, "DIVS(");
1232 OUTS (outf
, dregs (dst
));
1234 OUTS (outf
, dregs (src
));
1239 OUTS (outf
, dregs (dst
));
1241 OUTS (outf
, dregs_lo (src
));
1246 OUTS (outf
, dregs (dst
));
1248 OUTS (outf
, dregs_lo (src
));
1253 OUTS (outf
, dregs (dst
));
1255 OUTS (outf
, dregs_byte (src
));
1260 OUTS (outf
, dregs (dst
));
1262 OUTS (outf
, dregs_byte (src
));
1267 OUTS (outf
, dregs (dst
));
1269 OUTS (outf
, dregs (src
));
1273 OUTS (outf
, dregs (dst
));
1275 OUTS (outf
, dregs (src
));
1284 decode_PTR2op_0 (TIword iw0
, disassemble_info
*outf
)
1287 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1288 | 0 | 1 | 0 | 0 | 0 | 1 | 0 |.opc.......|.src.......|.dst.......|
1289 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1290 int src
= ((iw0
>> PTR2op_src_bits
) & PTR2op_dst_mask
);
1291 int opc
= ((iw0
>> PTR2op_opc_bits
) & PTR2op_opc_mask
);
1292 int dst
= ((iw0
>> PTR2op_dst_bits
) & PTR2op_dst_mask
);
1296 OUTS (outf
, pregs (dst
));
1298 OUTS (outf
, pregs (src
));
1302 OUTS (outf
, pregs (dst
));
1304 OUTS (outf
, pregs (src
));
1309 OUTS (outf
, pregs (dst
));
1311 OUTS (outf
, pregs (src
));
1316 OUTS (outf
, pregs (dst
));
1318 OUTS (outf
, pregs (src
));
1323 OUTS (outf
, pregs (dst
));
1325 OUTS (outf
, pregs (src
));
1326 OUTS (outf
, "(BREV)");
1330 OUTS (outf
, pregs (dst
));
1332 OUTS (outf
, pregs (dst
));
1334 OUTS (outf
, pregs (src
));
1335 OUTS (outf
, ")<<1");
1339 OUTS (outf
, pregs (dst
));
1341 OUTS (outf
, pregs (dst
));
1343 OUTS (outf
, pregs (src
));
1344 OUTS (outf
, ")<<2");
1353 decode_LOGI2op_0 (TIword iw0
, disassemble_info
*outf
)
1356 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1357 | 0 | 1 | 0 | 0 | 1 |.opc.......|.src...............|.dst.......|
1358 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1359 int src
= ((iw0
>> LOGI2op_src_bits
) & LOGI2op_src_mask
);
1360 int opc
= ((iw0
>> LOGI2op_opc_bits
) & LOGI2op_opc_mask
);
1361 int dst
= ((iw0
>> LOGI2op_dst_bits
) & LOGI2op_dst_mask
);
1365 OUTS (outf
, "CC = ! BITTST (");
1366 OUTS (outf
, dregs (dst
));
1368 OUTS (outf
, uimm5 (src
));
1373 OUTS (outf
, "CC = BITTST (");
1374 OUTS (outf
, dregs (dst
));
1376 OUTS (outf
, uimm5 (src
));
1381 OUTS (outf
, "BITSET (");
1382 OUTS (outf
, dregs (dst
));
1384 OUTS (outf
, uimm5 (src
));
1389 OUTS (outf
, "BITTGL (");
1390 OUTS (outf
, dregs (dst
));
1392 OUTS (outf
, uimm5 (src
));
1397 OUTS (outf
, "BITCLR (");
1398 OUTS (outf
, dregs (dst
));
1400 OUTS (outf
, uimm5 (src
));
1405 OUTS (outf
, dregs (dst
));
1406 OUTS (outf
, ">>>=");
1407 OUTS (outf
, uimm5 (src
));
1411 OUTS (outf
, dregs (dst
));
1413 OUTS (outf
, uimm5 (src
));
1417 OUTS (outf
, dregs (dst
));
1419 OUTS (outf
, uimm5 (src
));
1428 decode_COMP3op_0 (TIword iw0
, disassemble_info
*outf
)
1431 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1432 | 0 | 1 | 0 | 1 |.opc.......|.dst.......|.src1......|.src0......|
1433 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1434 int opc
= ((iw0
>> COMP3op_opc_bits
) & COMP3op_opc_mask
);
1435 int dst
= ((iw0
>> COMP3op_dst_bits
) & COMP3op_dst_mask
);
1436 int src0
= ((iw0
>> COMP3op_src0_bits
) & COMP3op_src0_mask
);
1437 int src1
= ((iw0
>> COMP3op_src1_bits
) & COMP3op_src1_mask
);
1439 if (opc
== 5 && src1
== src0
)
1441 OUTS (outf
, pregs (dst
));
1443 OUTS (outf
, pregs (src0
));
1448 OUTS (outf
, dregs (dst
));
1450 OUTS (outf
, dregs (src0
));
1452 OUTS (outf
, dregs (src1
));
1456 OUTS (outf
, dregs (dst
));
1458 OUTS (outf
, dregs (src0
));
1460 OUTS (outf
, dregs (src1
));
1464 OUTS (outf
, dregs (dst
));
1466 OUTS (outf
, dregs (src0
));
1468 OUTS (outf
, dregs (src1
));
1472 OUTS (outf
, dregs (dst
));
1474 OUTS (outf
, dregs (src0
));
1476 OUTS (outf
, dregs (src1
));
1480 OUTS (outf
, pregs (dst
));
1482 OUTS (outf
, pregs (src0
));
1484 OUTS (outf
, pregs (src1
));
1488 OUTS (outf
, pregs (dst
));
1490 OUTS (outf
, pregs (src0
));
1492 OUTS (outf
, pregs (src1
));
1493 OUTS (outf
, "<<1)");
1497 OUTS (outf
, pregs (dst
));
1499 OUTS (outf
, pregs (src0
));
1501 OUTS (outf
, pregs (src1
));
1502 OUTS (outf
, "<<2)");
1506 OUTS (outf
, dregs (dst
));
1508 OUTS (outf
, dregs (src0
));
1510 OUTS (outf
, dregs (src1
));
1519 decode_COMPI2opD_0 (TIword iw0
, disassemble_info
*outf
)
1522 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1523 | 0 | 1 | 1 | 0 | 0 |.op|..src......................|.dst.......|
1524 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1525 int op
= ((iw0
>> COMPI2opD_op_bits
) & COMPI2opD_op_mask
);
1526 int dst
= ((iw0
>> COMPI2opD_dst_bits
) & COMPI2opD_dst_mask
);
1527 int src
= ((iw0
>> COMPI2opD_src_bits
) & COMPI2opD_src_mask
);
1531 OUTS (outf
, dregs (dst
));
1533 OUTS (outf
, imm7 (src
));
1538 OUTS (outf
, dregs (dst
));
1540 OUTS (outf
, imm7 (src
));
1549 decode_COMPI2opP_0 (TIword iw0
, disassemble_info
*outf
)
1552 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1553 | 0 | 1 | 1 | 0 | 1 |.op|.src.......................|.dst.......|
1554 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1555 int op
= ((iw0
>> COMPI2opP_op_bits
) & COMPI2opP_op_mask
);
1556 int src
= ((iw0
>> COMPI2opP_src_bits
) & COMPI2opP_src_mask
);
1557 int dst
= ((iw0
>> COMPI2opP_dst_bits
) & COMPI2opP_dst_mask
);
1561 OUTS (outf
, pregs (dst
));
1563 OUTS (outf
, imm7 (src
));
1567 OUTS (outf
, pregs (dst
));
1569 OUTS (outf
, imm7 (src
));
1578 decode_LDSTpmod_0 (TIword iw0
, disassemble_info
*outf
)
1581 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1582 | 1 | 0 | 0 | 0 |.W.|.aop...|.reg.......|.idx.......|.ptr.......|
1583 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1584 int W
= ((iw0
>> LDSTpmod_W_bits
) & LDSTpmod_W_mask
);
1585 int aop
= ((iw0
>> LDSTpmod_aop_bits
) & LDSTpmod_aop_mask
);
1586 int idx
= ((iw0
>> LDSTpmod_idx_bits
) & LDSTpmod_idx_mask
);
1587 int ptr
= ((iw0
>> LDSTpmod_ptr_bits
) & LDSTpmod_ptr_mask
);
1588 int reg
= ((iw0
>> LDSTpmod_reg_bits
) & LDSTpmod_reg_mask
);
1590 if (aop
== 1 && W
== 0 && idx
== ptr
)
1592 OUTS (outf
, dregs_lo (reg
));
1594 OUTS (outf
, pregs (ptr
));
1597 else if (aop
== 2 && W
== 0 && idx
== ptr
)
1599 OUTS (outf
, dregs_hi (reg
));
1601 OUTS (outf
, pregs (ptr
));
1604 else if (aop
== 1 && W
== 1 && idx
== ptr
)
1607 OUTS (outf
, pregs (ptr
));
1609 OUTS (outf
, dregs_lo (reg
));
1611 else if (aop
== 2 && W
== 1 && idx
== ptr
)
1614 OUTS (outf
, pregs (ptr
));
1616 OUTS (outf
, dregs_hi (reg
));
1618 else if (aop
== 0 && W
== 0)
1620 OUTS (outf
, dregs (reg
));
1622 OUTS (outf
, pregs (ptr
));
1624 OUTS (outf
, pregs (idx
));
1627 else if (aop
== 1 && W
== 0)
1629 OUTS (outf
, dregs_lo (reg
));
1631 OUTS (outf
, pregs (ptr
));
1633 OUTS (outf
, pregs (idx
));
1636 else if (aop
== 2 && W
== 0)
1638 OUTS (outf
, dregs_hi (reg
));
1640 OUTS (outf
, pregs (ptr
));
1642 OUTS (outf
, pregs (idx
));
1645 else if (aop
== 3 && W
== 0)
1647 OUTS (outf
, dregs (reg
));
1649 OUTS (outf
, pregs (ptr
));
1651 OUTS (outf
, pregs (idx
));
1652 OUTS (outf
, "] (Z)");
1654 else if (aop
== 3 && W
== 1)
1656 OUTS (outf
, dregs (reg
));
1658 OUTS (outf
, pregs (ptr
));
1660 OUTS (outf
, pregs (idx
));
1661 OUTS (outf
, "](X)");
1663 else if (aop
== 0 && W
== 1)
1666 OUTS (outf
, pregs (ptr
));
1668 OUTS (outf
, pregs (idx
));
1670 OUTS (outf
, dregs (reg
));
1672 else if (aop
== 1 && W
== 1)
1675 OUTS (outf
, pregs (ptr
));
1677 OUTS (outf
, pregs (idx
));
1679 OUTS (outf
, dregs_lo (reg
));
1681 else if (aop
== 2 && W
== 1)
1684 OUTS (outf
, pregs (ptr
));
1686 OUTS (outf
, pregs (idx
));
1688 OUTS (outf
, dregs_hi (reg
));
1697 decode_dagMODim_0 (TIword iw0
, disassemble_info
*outf
)
1700 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1701 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 |.br| 1 | 1 |.op|.m.....|.i.....|
1702 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1703 int i
= ((iw0
>> DagMODim_i_bits
) & DagMODim_i_mask
);
1704 int m
= ((iw0
>> DagMODim_m_bits
) & DagMODim_m_mask
);
1705 int br
= ((iw0
>> DagMODim_br_bits
) & DagMODim_br_mask
);
1706 int op
= ((iw0
>> DagMODim_op_bits
) & DagMODim_op_mask
);
1708 if (op
== 0 && br
== 1)
1710 OUTS (outf
, iregs (i
));
1712 OUTS (outf
, mregs (m
));
1713 OUTS (outf
, "(BREV)");
1717 OUTS (outf
, iregs (i
));
1719 OUTS (outf
, mregs (m
));
1723 OUTS (outf
, iregs (i
));
1725 OUTS (outf
, mregs (m
));
1734 decode_dagMODik_0 (TIword iw0
, disassemble_info
*outf
)
1737 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1738 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 0 |.op....|.i.....|
1739 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1740 int i
= ((iw0
>> DagMODik_i_bits
) & DagMODik_i_mask
);
1741 int op
= ((iw0
>> DagMODik_op_bits
) & DagMODik_op_mask
);
1745 OUTS (outf
, iregs (i
));
1750 OUTS (outf
, iregs (i
));
1755 OUTS (outf
, iregs (i
));
1760 OUTS (outf
, iregs (i
));
1770 decode_dspLDST_0 (TIword iw0
, disassemble_info
*outf
)
1773 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1774 | 1 | 0 | 0 | 1 | 1 | 1 |.W.|.aop...|.m.....|.i.....|.reg.......|
1775 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1776 int i
= ((iw0
>> DspLDST_i_bits
) & DspLDST_i_mask
);
1777 int m
= ((iw0
>> DspLDST_m_bits
) & DspLDST_m_mask
);
1778 int W
= ((iw0
>> DspLDST_W_bits
) & DspLDST_W_mask
);
1779 int aop
= ((iw0
>> DspLDST_aop_bits
) & DspLDST_aop_mask
);
1780 int reg
= ((iw0
>> DspLDST_reg_bits
) & DspLDST_reg_mask
);
1782 if (aop
== 0 && W
== 0 && m
== 0)
1784 OUTS (outf
, dregs (reg
));
1786 OUTS (outf
, iregs (i
));
1789 else if (aop
== 0 && W
== 0 && m
== 1)
1791 OUTS (outf
, dregs_lo (reg
));
1793 OUTS (outf
, iregs (i
));
1796 else if (aop
== 0 && W
== 0 && m
== 2)
1798 OUTS (outf
, dregs_hi (reg
));
1800 OUTS (outf
, iregs (i
));
1803 else if (aop
== 1 && W
== 0 && m
== 0)
1805 OUTS (outf
, dregs (reg
));
1807 OUTS (outf
, iregs (i
));
1810 else if (aop
== 1 && W
== 0 && m
== 1)
1812 OUTS (outf
, dregs_lo (reg
));
1814 OUTS (outf
, iregs (i
));
1817 else if (aop
== 1 && W
== 0 && m
== 2)
1819 OUTS (outf
, dregs_hi (reg
));
1821 OUTS (outf
, iregs (i
));
1824 else if (aop
== 2 && W
== 0 && m
== 0)
1826 OUTS (outf
, dregs (reg
));
1828 OUTS (outf
, iregs (i
));
1831 else if (aop
== 2 && W
== 0 && m
== 1)
1833 OUTS (outf
, dregs_lo (reg
));
1835 OUTS (outf
, iregs (i
));
1838 else if (aop
== 2 && W
== 0 && m
== 2)
1840 OUTS (outf
, dregs_hi (reg
));
1842 OUTS (outf
, iregs (i
));
1845 else if (aop
== 0 && W
== 1 && m
== 0)
1848 OUTS (outf
, iregs (i
));
1849 OUTS (outf
, "++]=");
1850 OUTS (outf
, dregs (reg
));
1852 else if (aop
== 0 && W
== 1 && m
== 1)
1855 OUTS (outf
, iregs (i
));
1856 OUTS (outf
, "++]=");
1857 OUTS (outf
, dregs_lo (reg
));
1859 else if (aop
== 0 && W
== 1 && m
== 2)
1862 OUTS (outf
, iregs (i
));
1863 OUTS (outf
, "++]=");
1864 OUTS (outf
, dregs_hi (reg
));
1866 else if (aop
== 1 && W
== 1 && m
== 0)
1869 OUTS (outf
, iregs (i
));
1870 OUTS (outf
, "--]=");
1871 OUTS (outf
, dregs (reg
));
1873 else if (aop
== 1 && W
== 1 && m
== 1)
1876 OUTS (outf
, iregs (i
));
1877 OUTS (outf
, "--]=");
1878 OUTS (outf
, dregs_lo (reg
));
1880 else if (aop
== 1 && W
== 1 && m
== 2)
1883 OUTS (outf
, iregs (i
));
1884 OUTS (outf
, "--]=");
1885 OUTS (outf
, dregs_hi (reg
));
1887 else if (aop
== 2 && W
== 1 && m
== 0)
1890 OUTS (outf
, iregs (i
));
1892 OUTS (outf
, dregs (reg
));
1894 else if (aop
== 2 && W
== 1 && m
== 1)
1897 OUTS (outf
, iregs (i
));
1899 OUTS (outf
, dregs_lo (reg
));
1901 else if (aop
== 2 && W
== 1 && m
== 2)
1904 OUTS (outf
, iregs (i
));
1906 OUTS (outf
, dregs_hi (reg
));
1908 else if (aop
== 3 && W
== 0)
1910 OUTS (outf
, dregs (reg
));
1912 OUTS (outf
, iregs (i
));
1914 OUTS (outf
, mregs (m
));
1917 else if (aop
== 3 && W
== 1)
1920 OUTS (outf
, iregs (i
));
1922 OUTS (outf
, mregs (m
));
1924 OUTS (outf
, dregs (reg
));
1933 decode_LDST_0 (TIword iw0
, disassemble_info
*outf
)
1936 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1937 | 1 | 0 | 0 | 1 |.sz....|.W.|.aop...|.Z.|.ptr.......|.reg.......|
1938 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1939 int Z
= ((iw0
>> LDST_Z_bits
) & LDST_Z_mask
);
1940 int W
= ((iw0
>> LDST_W_bits
) & LDST_W_mask
);
1941 int sz
= ((iw0
>> LDST_sz_bits
) & LDST_sz_mask
);
1942 int aop
= ((iw0
>> LDST_aop_bits
) & LDST_aop_mask
);
1943 int reg
= ((iw0
>> LDST_reg_bits
) & LDST_reg_mask
);
1944 int ptr
= ((iw0
>> LDST_ptr_bits
) & LDST_ptr_mask
);
1946 if (aop
== 0 && sz
== 0 && Z
== 0 && W
== 0)
1948 OUTS (outf
, dregs (reg
));
1950 OUTS (outf
, pregs (ptr
));
1953 else if (aop
== 0 && sz
== 0 && Z
== 1 && W
== 0)
1955 OUTS (outf
, pregs (reg
));
1957 OUTS (outf
, pregs (ptr
));
1960 else if (aop
== 0 && sz
== 1 && Z
== 0 && W
== 0)
1962 OUTS (outf
, dregs (reg
));
1964 OUTS (outf
, pregs (ptr
));
1965 OUTS (outf
, "++] (Z)");
1967 else if (aop
== 0 && sz
== 1 && Z
== 1 && W
== 0)
1969 OUTS (outf
, dregs (reg
));
1971 OUTS (outf
, pregs (ptr
));
1972 OUTS (outf
, "++](X)");
1974 else if (aop
== 0 && sz
== 2 && Z
== 0 && W
== 0)
1976 OUTS (outf
, dregs (reg
));
1978 OUTS (outf
, pregs (ptr
));
1979 OUTS (outf
, "++] (Z)");
1981 else if (aop
== 0 && sz
== 2 && Z
== 1 && W
== 0)
1983 OUTS (outf
, dregs (reg
));
1985 OUTS (outf
, pregs (ptr
));
1986 OUTS (outf
, "++](X)");
1988 else if (aop
== 1 && sz
== 0 && Z
== 0 && W
== 0)
1990 OUTS (outf
, dregs (reg
));
1992 OUTS (outf
, pregs (ptr
));
1995 else if (aop
== 1 && sz
== 0 && Z
== 1 && W
== 0)
1997 OUTS (outf
, pregs (reg
));
1999 OUTS (outf
, pregs (ptr
));
2002 else if (aop
== 1 && sz
== 1 && Z
== 0 && W
== 0)
2004 OUTS (outf
, dregs (reg
));
2006 OUTS (outf
, pregs (ptr
));
2007 OUTS (outf
, "--] (Z)");
2009 else if (aop
== 1 && sz
== 1 && Z
== 1 && W
== 0)
2011 OUTS (outf
, dregs (reg
));
2013 OUTS (outf
, pregs (ptr
));
2014 OUTS (outf
, "--](X)");
2016 else if (aop
== 1 && sz
== 2 && Z
== 0 && W
== 0)
2018 OUTS (outf
, dregs (reg
));
2020 OUTS (outf
, pregs (ptr
));
2021 OUTS (outf
, "--] (Z)");
2023 else if (aop
== 1 && sz
== 2 && Z
== 1 && W
== 0)
2025 OUTS (outf
, dregs (reg
));
2027 OUTS (outf
, pregs (ptr
));
2028 OUTS (outf
, "--](X)");
2030 else if (aop
== 2 && sz
== 0 && Z
== 0 && W
== 0)
2032 OUTS (outf
, dregs (reg
));
2034 OUTS (outf
, pregs (ptr
));
2037 else if (aop
== 2 && sz
== 0 && Z
== 1 && W
== 0)
2039 OUTS (outf
, pregs (reg
));
2041 OUTS (outf
, pregs (ptr
));
2044 else if (aop
== 2 && sz
== 1 && Z
== 0 && W
== 0)
2046 OUTS (outf
, dregs (reg
));
2048 OUTS (outf
, pregs (ptr
));
2049 OUTS (outf
, "] (Z)");
2051 else if (aop
== 2 && sz
== 1 && Z
== 1 && W
== 0)
2053 OUTS (outf
, dregs (reg
));
2055 OUTS (outf
, pregs (ptr
));
2056 OUTS (outf
, "](X)");
2058 else if (aop
== 2 && sz
== 2 && Z
== 0 && W
== 0)
2060 OUTS (outf
, dregs (reg
));
2062 OUTS (outf
, pregs (ptr
));
2063 OUTS (outf
, "] (Z)");
2065 else if (aop
== 2 && sz
== 2 && Z
== 1 && W
== 0)
2067 OUTS (outf
, dregs (reg
));
2069 OUTS (outf
, pregs (ptr
));
2070 OUTS (outf
, "](X)");
2072 else if (aop
== 0 && sz
== 0 && Z
== 0 && W
== 1)
2075 OUTS (outf
, pregs (ptr
));
2076 OUTS (outf
, "++]=");
2077 OUTS (outf
, dregs (reg
));
2079 else if (aop
== 0 && sz
== 0 && Z
== 1 && W
== 1)
2082 OUTS (outf
, pregs (ptr
));
2083 OUTS (outf
, "++]=");
2084 OUTS (outf
, pregs (reg
));
2086 else if (aop
== 0 && sz
== 1 && Z
== 0 && W
== 1)
2089 OUTS (outf
, pregs (ptr
));
2090 OUTS (outf
, "++]=");
2091 OUTS (outf
, dregs (reg
));
2093 else if (aop
== 0 && sz
== 2 && Z
== 0 && W
== 1)
2096 OUTS (outf
, pregs (ptr
));
2097 OUTS (outf
, "++]=");
2098 OUTS (outf
, dregs (reg
));
2100 else if (aop
== 1 && sz
== 0 && Z
== 0 && W
== 1)
2103 OUTS (outf
, pregs (ptr
));
2104 OUTS (outf
, "--]=");
2105 OUTS (outf
, dregs (reg
));
2107 else if (aop
== 1 && sz
== 0 && Z
== 1 && W
== 1)
2110 OUTS (outf
, pregs (ptr
));
2111 OUTS (outf
, "--]=");
2112 OUTS (outf
, pregs (reg
));
2114 else if (aop
== 1 && sz
== 1 && Z
== 0 && W
== 1)
2117 OUTS (outf
, pregs (ptr
));
2118 OUTS (outf
, "--]=");
2119 OUTS (outf
, dregs (reg
));
2121 else if (aop
== 1 && sz
== 2 && Z
== 0 && W
== 1)
2124 OUTS (outf
, pregs (ptr
));
2125 OUTS (outf
, "--]=");
2126 OUTS (outf
, dregs (reg
));
2128 else if (aop
== 2 && sz
== 0 && Z
== 0 && W
== 1)
2131 OUTS (outf
, pregs (ptr
));
2133 OUTS (outf
, dregs (reg
));
2135 else if (aop
== 2 && sz
== 0 && Z
== 1 && W
== 1)
2138 OUTS (outf
, pregs (ptr
));
2140 OUTS (outf
, pregs (reg
));
2142 else if (aop
== 2 && sz
== 1 && Z
== 0 && W
== 1)
2145 OUTS (outf
, pregs (ptr
));
2147 OUTS (outf
, dregs (reg
));
2149 else if (aop
== 2 && sz
== 2 && Z
== 0 && W
== 1)
2152 OUTS (outf
, pregs (ptr
));
2154 OUTS (outf
, dregs (reg
));
2163 decode_LDSTiiFP_0 (TIword iw0
, disassemble_info
*outf
)
2166 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2167 | 1 | 0 | 1 | 1 | 1 | 0 |.W.|.offset............|.reg...........|
2168 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2169 int reg
= ((iw0
>> LDSTiiFP_reg_bits
) & LDSTiiFP_reg_mask
);
2170 int offset
= ((iw0
>> LDSTiiFP_offset_bits
) & LDSTiiFP_offset_mask
);
2171 int W
= ((iw0
>> LDSTiiFP_W_bits
) & LDSTiiFP_W_mask
);
2175 OUTS (outf
, dpregs (reg
));
2176 OUTS (outf
, "=[FP");
2177 OUTS (outf
, negimm5s4 (offset
));
2183 OUTS (outf
, negimm5s4 (offset
));
2185 OUTS (outf
, dpregs (reg
));
2194 decode_LDSTii_0 (TIword iw0
, disassemble_info
*outf
)
2197 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2198 | 1 | 0 | 1 |.W.|.op....|.offset........|.ptr.......|.reg.......|
2199 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2200 int reg
= ((iw0
>> LDSTii_reg_bit
) & LDSTii_reg_mask
);
2201 int ptr
= ((iw0
>> LDSTii_ptr_bit
) & LDSTii_ptr_mask
);
2202 int offset
= ((iw0
>> LDSTii_offset_bit
) & LDSTii_offset_mask
);
2203 int op
= ((iw0
>> LDSTii_op_bit
) & LDSTii_op_mask
);
2204 int W
= ((iw0
>> LDSTii_W_bit
) & LDSTii_W_mask
);
2206 if (W
== 0 && op
== 0)
2208 OUTS (outf
, dregs (reg
));
2210 OUTS (outf
, pregs (ptr
));
2212 OUTS (outf
, uimm4s4 (offset
));
2215 else if (W
== 0 && op
== 1)
2217 OUTS (outf
, dregs (reg
));
2219 OUTS (outf
, pregs (ptr
));
2221 OUTS (outf
, uimm4s2 (offset
));
2222 OUTS (outf
, "] (Z)");
2224 else if (W
== 0 && op
== 2)
2226 OUTS (outf
, dregs (reg
));
2228 OUTS (outf
, pregs (ptr
));
2230 OUTS (outf
, uimm4s2 (offset
));
2231 OUTS (outf
, "](X)");
2233 else if (W
== 0 && op
== 3)
2235 OUTS (outf
, pregs (reg
));
2237 OUTS (outf
, pregs (ptr
));
2239 OUTS (outf
, uimm4s4 (offset
));
2242 else if (W
== 1 && op
== 0)
2245 OUTS (outf
, pregs (ptr
));
2247 OUTS (outf
, uimm4s4 (offset
));
2249 OUTS (outf
, dregs (reg
));
2251 else if (W
== 1 && op
== 1)
2255 OUTS (outf
, pregs (ptr
));
2257 OUTS (outf
, uimm4s2 (offset
));
2260 OUTS (outf
, dregs (reg
));
2262 else if (W
== 1 && op
== 3)
2265 OUTS (outf
, pregs (ptr
));
2267 OUTS (outf
, uimm4s4 (offset
));
2269 OUTS (outf
, pregs (reg
));
2278 decode_LoopSetup_0 (TIword iw0
, TIword iw1
, bfd_vma pc
, disassemble_info
*outf
)
2281 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2282 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 |.rop...|.c.|.soffset.......|
2283 |.reg...........| - | - |.eoffset...............................|
2284 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2285 int c
= ((iw0
>> (LoopSetup_c_bits
- 16)) & LoopSetup_c_mask
);
2286 int reg
= ((iw1
>> LoopSetup_reg_bits
) & LoopSetup_reg_mask
);
2287 int rop
= ((iw0
>> (LoopSetup_rop_bits
- 16)) & LoopSetup_rop_mask
);
2288 int soffset
= ((iw0
>> (LoopSetup_soffset_bits
- 16)) & LoopSetup_soffset_mask
);
2289 int eoffset
= ((iw1
>> LoopSetup_eoffset_bits
) & LoopSetup_eoffset_mask
);
2293 OUTS (outf
, "LSETUP");
2295 OUTS (outf
, pcrel4 (soffset
));
2297 OUTS (outf
, lppcrel10 (eoffset
));
2299 OUTS (outf
, counters (c
));
2303 OUTS (outf
, "LSETUP");
2305 OUTS (outf
, pcrel4 (soffset
));
2307 OUTS (outf
, lppcrel10 (eoffset
));
2309 OUTS (outf
, counters (c
));
2311 OUTS (outf
, pregs (reg
));
2315 OUTS (outf
, "LSETUP");
2317 OUTS (outf
, pcrel4 (soffset
));
2319 OUTS (outf
, lppcrel10 (eoffset
));
2321 OUTS (outf
, counters (c
));
2323 OUTS (outf
, pregs (reg
));
2333 decode_LDIMMhalf_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2336 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2337 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 |.Z.|.H.|.S.|.grp...|.reg.......|
2338 |.hword.........................................................|
2339 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2340 int H
= ((iw0
>> (LDIMMhalf_H_bits
- 16)) & LDIMMhalf_H_mask
);
2341 int Z
= ((iw0
>> (LDIMMhalf_Z_bits
- 16)) & LDIMMhalf_Z_mask
);
2342 int S
= ((iw0
>> (LDIMMhalf_S_bits
- 16)) & LDIMMhalf_S_mask
);
2343 int reg
= ((iw0
>> (LDIMMhalf_reg_bits
- 16)) & LDIMMhalf_reg_mask
);
2344 int grp
= ((iw0
>> (LDIMMhalf_grp_bits
- 16)) & LDIMMhalf_grp_mask
);
2345 int hword
= ((iw1
>> LDIMMhalf_hword_bits
) & LDIMMhalf_hword_mask
);
2347 if (grp
== 0 && H
== 0 && S
== 0 && Z
== 0)
2349 OUTS (outf
, dregs_lo (reg
));
2351 OUTS (outf
, imm16 (hword
));
2353 else if (grp
== 0 && H
== 1 && S
== 0 && Z
== 0)
2355 OUTS (outf
, dregs_hi (reg
));
2357 OUTS (outf
, imm16 (hword
));
2359 else if (grp
== 0 && H
== 0 && S
== 1 && Z
== 0)
2361 OUTS (outf
, dregs (reg
));
2363 OUTS (outf
, imm16 (hword
));
2364 OUTS (outf
, " (X)");
2366 else if (H
== 0 && S
== 1 && Z
== 0)
2368 OUTS (outf
, regs (reg
, grp
));
2370 OUTS (outf
, imm16 (hword
));
2371 OUTS (outf
, " (X)");
2373 else if (H
== 0 && S
== 0 && Z
== 1)
2375 OUTS (outf
, regs (reg
, grp
));
2377 OUTS (outf
, luimm16 (hword
));
2380 else if (H
== 0 && S
== 0 && Z
== 0)
2382 OUTS (outf
, regs_lo (reg
, grp
));
2384 OUTS (outf
, luimm16 (hword
));
2386 else if (H
== 1 && S
== 0 && Z
== 0)
2388 OUTS (outf
, regs_hi (reg
, grp
));
2390 OUTS (outf
, huimm16 (hword
));
2399 decode_CALLa_0 (TIword iw0
, TIword iw1
, bfd_vma pc
, disassemble_info
*outf
)
2402 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2403 | 1 | 1 | 1 | 0 | 0 | 0 | 1 |.S.|.msw...........................|
2404 |.lsw...........................................................|
2405 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2406 int S
= ((iw0
>> (CALLa_S_bits
- 16)) & CALLa_S_mask
);
2407 int lsw
= ((iw1
>> 0) & 0xffff);
2408 int msw
= ((iw0
>> 0) & 0xff);
2411 OUTS (outf
, "CALL ");
2413 OUTS (outf
, "JUMP.L ");
2417 OUTS (outf
, pcrel24 (((msw
) << 16) | (lsw
)));
2422 decode_LDSTidxI_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2425 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2426 | 1 | 1 | 1 | 0 | 0 | 1 |.W.|.Z.|.sz....|.ptr.......|.reg.......|
2427 |.offset........................................................|
2428 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2429 int Z
= ((iw0
>> (LDSTidxI_Z_bits
- 16)) & LDSTidxI_Z_mask
);
2430 int W
= ((iw0
>> (LDSTidxI_W_bits
- 16)) & LDSTidxI_W_mask
);
2431 int sz
= ((iw0
>> (LDSTidxI_sz_bits
- 16)) & LDSTidxI_sz_mask
);
2432 int reg
= ((iw0
>> (LDSTidxI_reg_bits
- 16)) & LDSTidxI_reg_mask
);
2433 int ptr
= ((iw0
>> (LDSTidxI_ptr_bits
- 16)) & LDSTidxI_ptr_mask
);
2434 int offset
= ((iw1
>> LDSTidxI_offset_bits
) & LDSTidxI_offset_mask
);
2436 if (W
== 0 && sz
== 0 && Z
== 0)
2438 OUTS (outf
, dregs (reg
));
2440 OUTS (outf
, pregs (ptr
));
2442 OUTS (outf
, imm16s4 (offset
));
2445 else if (W
== 0 && sz
== 0 && Z
== 1)
2447 OUTS (outf
, pregs (reg
));
2449 OUTS (outf
, pregs (ptr
));
2451 OUTS (outf
, imm16s4 (offset
));
2454 else if (W
== 0 && sz
== 1 && Z
== 0)
2456 OUTS (outf
, dregs (reg
));
2458 OUTS (outf
, pregs (ptr
));
2460 OUTS (outf
, imm16s2 (offset
));
2461 OUTS (outf
, "] (Z)");
2463 else if (W
== 0 && sz
== 1 && Z
== 1)
2465 OUTS (outf
, dregs (reg
));
2467 OUTS (outf
, pregs (ptr
));
2469 OUTS (outf
, imm16s2 (offset
));
2470 OUTS (outf
, "](X)");
2472 else if (W
== 0 && sz
== 2 && Z
== 0)
2474 OUTS (outf
, dregs (reg
));
2476 OUTS (outf
, pregs (ptr
));
2478 OUTS (outf
, imm16 (offset
));
2479 OUTS (outf
, "] (Z)");
2481 else if (W
== 0 && sz
== 2 && Z
== 1)
2483 OUTS (outf
, dregs (reg
));
2485 OUTS (outf
, pregs (ptr
));
2487 OUTS (outf
, imm16 (offset
));
2488 OUTS (outf
, "](X)");
2490 else if (W
== 1 && sz
== 0 && Z
== 0)
2493 OUTS (outf
, pregs (ptr
));
2495 OUTS (outf
, imm16s4 (offset
));
2497 OUTS (outf
, dregs (reg
));
2499 else if (W
== 1 && sz
== 0 && Z
== 1)
2502 OUTS (outf
, pregs (ptr
));
2504 OUTS (outf
, imm16s4 (offset
));
2506 OUTS (outf
, pregs (reg
));
2508 else if (W
== 1 && sz
== 1 && Z
== 0)
2511 OUTS (outf
, pregs (ptr
));
2513 OUTS (outf
, imm16s2 (offset
));
2515 OUTS (outf
, dregs (reg
));
2517 else if (W
== 1 && sz
== 2 && Z
== 0)
2520 OUTS (outf
, pregs (ptr
));
2522 OUTS (outf
, imm16 (offset
));
2524 OUTS (outf
, dregs (reg
));
2533 decode_linkage_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2536 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2537 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |.R.|
2538 |.framesize.....................................................|
2539 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2540 int R
= ((iw0
>> (Linkage_R_bits
- 16)) & Linkage_R_mask
);
2541 int framesize
= ((iw1
>> Linkage_framesize_bits
) & Linkage_framesize_mask
);
2545 OUTS (outf
, "LINK ");
2546 OUTS (outf
, uimm16s4 (framesize
));
2549 OUTS (outf
, "UNLINK");
2557 decode_dsp32mac_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2560 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2561 | 1 | 1 | 0 | 0 |.M.| 0 | 0 |.mmod..........|.MM|.P.|.w1|.op1...|
2562 |.h01|.h11|.w0|.op0...|.h00|.h10|.dst.......|.src0......|.src1..|
2563 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2564 int op1
= ((iw0
>> (DSP32Mac_op1_bits
- 16)) & DSP32Mac_op1_mask
);
2565 int w1
= ((iw0
>> (DSP32Mac_w1_bits
- 16)) & DSP32Mac_w1_mask
);
2566 int P
= ((iw0
>> (DSP32Mac_p_bits
- 16)) & DSP32Mac_p_mask
);
2567 int MM
= ((iw0
>> (DSP32Mac_MM_bits
- 16)) & DSP32Mac_MM_mask
);
2568 int mmod
= ((iw0
>> (DSP32Mac_mmod_bits
- 16)) & DSP32Mac_mmod_mask
);
2569 int w0
= ((iw1
>> DSP32Mac_w0_bits
) & DSP32Mac_w0_mask
);
2570 int src0
= ((iw1
>> DSP32Mac_src0_bits
) & DSP32Mac_src0_mask
);
2571 int src1
= ((iw1
>> DSP32Mac_src1_bits
) & DSP32Mac_src1_mask
);
2572 int dst
= ((iw1
>> DSP32Mac_dst_bits
) & DSP32Mac_dst_mask
);
2573 int h10
= ((iw1
>> DSP32Mac_h10_bits
) & DSP32Mac_h10_mask
);
2574 int h00
= ((iw1
>> DSP32Mac_h00_bits
) & DSP32Mac_h00_mask
);
2575 int op0
= ((iw1
>> DSP32Mac_op0_bits
) & DSP32Mac_op0_mask
);
2576 int h11
= ((iw1
>> DSP32Mac_h11_bits
) & DSP32Mac_h11_mask
);
2577 int h01
= ((iw1
>> DSP32Mac_h01_bits
) & DSP32Mac_h01_mask
);
2579 if (w0
== 0 && w1
== 0 && op1
== 3 && op0
== 3)
2585 if ((w1
|| w0
) && mmod
== M_W32
)
2588 if (((1 << mmod
) & (P
? 0x31b : 0x1b5f)) == 0)
2591 if (w1
== 1 || op1
!= 3)
2594 OUTS (outf
, P
? dregs (dst
+ 1) : dregs_hi (dst
));
2597 OUTS (outf
, " = A1");
2601 OUTS (outf
, " = (");
2602 decode_macfunc (1, op1
, h01
, h11
, src0
, src1
, outf
);
2607 if (w0
== 1 || op0
!= 3)
2610 OUTS (outf
, " (M)");
2616 if (w0
== 1 || op0
!= 3)
2619 OUTS (outf
, P
? dregs (dst
) : dregs_lo (dst
));
2622 OUTS (outf
, " = A0");
2626 OUTS (outf
, " = (");
2627 decode_macfunc (0, op0
, h00
, h10
, src0
, src1
, outf
);
2633 decode_optmode (mmod
, MM
, outf
);
2639 decode_dsp32mult_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2642 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2643 | 1 | 1 | 0 | 0 |.M.| 0 | 1 |.mmod..........|.MM|.P.|.w1|.op1...|
2644 |.h01|.h11|.w0|.op0...|.h00|.h10|.dst.......|.src0......|.src1..|
2645 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2646 int w1
= ((iw0
>> (DSP32Mac_w1_bits
- 16)) & DSP32Mac_w1_mask
);
2647 int P
= ((iw0
>> (DSP32Mac_p_bits
- 16)) & DSP32Mac_p_mask
);
2648 int MM
= ((iw0
>> (DSP32Mac_MM_bits
- 16)) & DSP32Mac_MM_mask
);
2649 int mmod
= ((iw0
>> (DSP32Mac_mmod_bits
- 16)) & DSP32Mac_mmod_mask
);
2650 int w0
= ((iw1
>> DSP32Mac_w0_bits
) & DSP32Mac_w0_mask
);
2651 int src0
= ((iw1
>> DSP32Mac_src0_bits
) & DSP32Mac_src0_mask
);
2652 int src1
= ((iw1
>> DSP32Mac_src1_bits
) & DSP32Mac_src1_mask
);
2653 int dst
= ((iw1
>> DSP32Mac_dst_bits
) & DSP32Mac_dst_mask
);
2654 int h10
= ((iw1
>> DSP32Mac_h10_bits
) & DSP32Mac_h10_mask
);
2655 int h00
= ((iw1
>> DSP32Mac_h00_bits
) & DSP32Mac_h00_mask
);
2656 int h11
= ((iw1
>> DSP32Mac_h11_bits
) & DSP32Mac_h11_mask
);
2657 int h01
= ((iw1
>> DSP32Mac_h01_bits
) & DSP32Mac_h01_mask
);
2659 if (w1
== 0 && w0
== 0)
2662 if (((1 << mmod
) & (P
? 0x313 : 0x1b57)) == 0)
2667 OUTS (outf
, P
? dregs (dst
| 1) : dregs_hi (dst
));
2669 decode_multfunc (h01
, h11
, src0
, src1
, outf
);
2674 OUTS (outf
, " (M)");
2682 OUTS (outf
, dregs (dst
));
2684 decode_multfunc (h00
, h10
, src0
, src1
, outf
);
2687 decode_optmode (mmod
, MM
, outf
);
2692 decode_dsp32alu_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2695 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2696 | 1 | 1 | 0 | 0 |.M.| 1 | 0 | - | - | - |.HL|.aopcde............|
2697 |.aop...|.s.|.x.|.dst0......|.dst1......|.src0......|.src1......|
2698 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2699 int s
= ((iw1
>> DSP32Alu_s_bits
) & DSP32Alu_s_mask
);
2700 int x
= ((iw1
>> DSP32Alu_x_bits
) & DSP32Alu_x_mask
);
2701 int aop
= ((iw1
>> DSP32Alu_aop_bits
) & DSP32Alu_aop_mask
);
2702 int src0
= ((iw1
>> DSP32Alu_src0_bits
) & DSP32Alu_src0_mask
);
2703 int src1
= ((iw1
>> DSP32Alu_src1_bits
) & DSP32Alu_src1_mask
);
2704 int dst0
= ((iw1
>> DSP32Alu_dst0_bits
) & DSP32Alu_dst0_mask
);
2705 int dst1
= ((iw1
>> DSP32Alu_dst1_bits
) & DSP32Alu_dst1_mask
);
2706 int HL
= ((iw0
>> (DSP32Alu_HL_bits
- 16)) & DSP32Alu_HL_mask
);
2707 int aopcde
= ((iw0
>> (DSP32Alu_aopcde_bits
- 16)) & DSP32Alu_aopcde_mask
);
2709 if (aop
== 0 && aopcde
== 9 && HL
== 0 && s
== 0)
2711 OUTS (outf
, "A0.L=");
2712 OUTS (outf
, dregs_lo (src0
));
2714 else if (aop
== 2 && aopcde
== 9 && HL
== 1 && s
== 0)
2716 OUTS (outf
, "A1.H=");
2717 OUTS (outf
, dregs_hi (src0
));
2719 else if (aop
== 2 && aopcde
== 9 && HL
== 0 && s
== 0)
2721 OUTS (outf
, "A1.L=");
2722 OUTS (outf
, dregs_lo (src0
));
2724 else if (aop
== 0 && aopcde
== 9 && HL
== 1 && s
== 0)
2726 OUTS (outf
, "A0.H=");
2727 OUTS (outf
, dregs_hi (src0
));
2729 else if (x
== 1 && HL
== 1 && aop
== 3 && aopcde
== 5)
2731 OUTS (outf
, dregs_hi (dst0
));
2733 OUTS (outf
, dregs (src0
));
2735 OUTS (outf
, dregs (src1
));
2736 OUTS (outf
, "(RND20)");
2738 else if (x
== 1 && HL
== 1 && aop
== 2 && aopcde
== 5)
2740 OUTS (outf
, dregs_hi (dst0
));
2742 OUTS (outf
, dregs (src0
));
2744 OUTS (outf
, dregs (src1
));
2745 OUTS (outf
, "(RND20)");
2747 else if (x
== 0 && HL
== 0 && aop
== 1 && aopcde
== 5)
2749 OUTS (outf
, dregs_lo (dst0
));
2751 OUTS (outf
, dregs (src0
));
2753 OUTS (outf
, dregs (src1
));
2754 OUTS (outf
, "(RND12)");
2756 else if (x
== 0 && HL
== 0 && aop
== 0 && aopcde
== 5)
2758 OUTS (outf
, dregs_lo (dst0
));
2760 OUTS (outf
, dregs (src0
));
2762 OUTS (outf
, dregs (src1
));
2763 OUTS (outf
, "(RND12)");
2765 else if (x
== 1 && HL
== 0 && aop
== 3 && aopcde
== 5)
2767 OUTS (outf
, dregs_lo (dst0
));
2769 OUTS (outf
, dregs (src0
));
2771 OUTS (outf
, dregs (src1
));
2772 OUTS (outf
, "(RND20)");
2774 else if (x
== 0 && HL
== 1 && aop
== 0 && aopcde
== 5)
2776 OUTS (outf
, dregs_hi (dst0
));
2778 OUTS (outf
, dregs (src0
));
2780 OUTS (outf
, dregs (src1
));
2781 OUTS (outf
, "(RND12)");
2783 else if (x
== 1 && HL
== 0 && aop
== 2 && aopcde
== 5)
2785 OUTS (outf
, dregs_lo (dst0
));
2787 OUTS (outf
, dregs (src0
));
2789 OUTS (outf
, dregs (src1
));
2790 OUTS (outf
, "(RND20)");
2792 else if (x
== 0 && HL
== 1 && aop
== 1 && aopcde
== 5)
2794 OUTS (outf
, dregs_hi (dst0
));
2796 OUTS (outf
, dregs (src0
));
2798 OUTS (outf
, dregs (src1
));
2799 OUTS (outf
, "(RND12)");
2801 else if (HL
== 1 && aop
== 0 && aopcde
== 2)
2803 OUTS (outf
, dregs_hi (dst0
));
2805 OUTS (outf
, dregs_lo (src0
));
2807 OUTS (outf
, dregs_lo (src1
));
2811 else if (HL
== 1 && aop
== 1 && aopcde
== 2)
2813 OUTS (outf
, dregs_hi (dst0
));
2815 OUTS (outf
, dregs_lo (src0
));
2817 OUTS (outf
, dregs_hi (src1
));
2821 else if (HL
== 1 && aop
== 2 && aopcde
== 2)
2823 OUTS (outf
, dregs_hi (dst0
));
2825 OUTS (outf
, dregs_hi (src0
));
2827 OUTS (outf
, dregs_lo (src1
));
2831 else if (HL
== 1 && aop
== 3 && aopcde
== 2)
2833 OUTS (outf
, dregs_hi (dst0
));
2835 OUTS (outf
, dregs_hi (src0
));
2837 OUTS (outf
, dregs_hi (src1
));
2841 else if (HL
== 0 && aop
== 0 && aopcde
== 3)
2843 OUTS (outf
, dregs_lo (dst0
));
2845 OUTS (outf
, dregs_lo (src0
));
2847 OUTS (outf
, dregs_lo (src1
));
2851 else if (HL
== 0 && aop
== 1 && aopcde
== 3)
2853 OUTS (outf
, dregs_lo (dst0
));
2855 OUTS (outf
, dregs_lo (src0
));
2857 OUTS (outf
, dregs_hi (src1
));
2861 else if (HL
== 0 && aop
== 3 && aopcde
== 2)
2863 OUTS (outf
, dregs_lo (dst0
));
2865 OUTS (outf
, dregs_hi (src0
));
2867 OUTS (outf
, dregs_hi (src1
));
2871 else if (HL
== 1 && aop
== 0 && aopcde
== 3)
2873 OUTS (outf
, dregs_hi (dst0
));
2875 OUTS (outf
, dregs_lo (src0
));
2877 OUTS (outf
, dregs_lo (src1
));
2881 else if (HL
== 1 && aop
== 1 && aopcde
== 3)
2883 OUTS (outf
, dregs_hi (dst0
));
2885 OUTS (outf
, dregs_lo (src0
));
2887 OUTS (outf
, dregs_hi (src1
));
2891 else if (HL
== 1 && aop
== 2 && aopcde
== 3)
2893 OUTS (outf
, dregs_hi (dst0
));
2895 OUTS (outf
, dregs_hi (src0
));
2897 OUTS (outf
, dregs_lo (src1
));
2901 else if (HL
== 1 && aop
== 3 && aopcde
== 3)
2903 OUTS (outf
, dregs_hi (dst0
));
2905 OUTS (outf
, dregs_hi (src0
));
2907 OUTS (outf
, dregs_hi (src1
));
2911 else if (HL
== 0 && aop
== 2 && aopcde
== 2)
2913 OUTS (outf
, dregs_lo (dst0
));
2915 OUTS (outf
, dregs_hi (src0
));
2917 OUTS (outf
, dregs_lo (src1
));
2921 else if (HL
== 0 && aop
== 1 && aopcde
== 2)
2923 OUTS (outf
, dregs_lo (dst0
));
2925 OUTS (outf
, dregs_lo (src0
));
2927 OUTS (outf
, dregs_hi (src1
));
2931 else if (HL
== 0 && aop
== 2 && aopcde
== 3)
2933 OUTS (outf
, dregs_lo (dst0
));
2935 OUTS (outf
, dregs_hi (src0
));
2937 OUTS (outf
, dregs_lo (src1
));
2941 else if (HL
== 0 && aop
== 3 && aopcde
== 3)
2943 OUTS (outf
, dregs_lo (dst0
));
2945 OUTS (outf
, dregs_hi (src0
));
2947 OUTS (outf
, dregs_hi (src1
));
2951 else if (HL
== 0 && aop
== 0 && aopcde
== 2)
2953 OUTS (outf
, dregs_lo (dst0
));
2955 OUTS (outf
, dregs_lo (src0
));
2957 OUTS (outf
, dregs_lo (src1
));
2961 else if (aop
== 0 && aopcde
== 9 && s
== 1)
2964 OUTS (outf
, dregs (src0
));
2966 else if (aop
== 3 && aopcde
== 11 && s
== 0)
2967 OUTS (outf
, "A0-=A1");
2969 else if (aop
== 3 && aopcde
== 11 && s
== 1)
2970 OUTS (outf
, "A0-=A1(W32)");
2972 else if (aop
== 3 && aopcde
== 22 && HL
== 1)
2974 OUTS (outf
, dregs (dst0
));
2975 OUTS (outf
, "=BYTEOP2M(");
2976 OUTS (outf
, dregs (src0
+ 1));
2978 OUTS (outf
, imm5 (src0
));
2980 OUTS (outf
, dregs (src1
+ 1));
2982 OUTS (outf
, imm5 (src1
));
2983 OUTS (outf
, ")(TH");
2985 OUTS (outf
, ", R)");
2989 else if (aop
== 3 && aopcde
== 22 && HL
== 0)
2991 OUTS (outf
, dregs (dst0
));
2992 OUTS (outf
, "=BYTEOP2M(");
2993 OUTS (outf
, dregs (src0
+ 1));
2995 OUTS (outf
, imm5 (src0
));
2997 OUTS (outf
, dregs (src1
+ 1));
2999 OUTS (outf
, imm5 (src1
));
3000 OUTS (outf
, ")(TL");
3002 OUTS (outf
, ", R)");
3006 else if (aop
== 2 && aopcde
== 22 && HL
== 1)
3008 OUTS (outf
, dregs (dst0
));
3009 OUTS (outf
, "=BYTEOP2M(");
3010 OUTS (outf
, dregs (src0
+ 1));
3012 OUTS (outf
, imm5 (src0
));
3014 OUTS (outf
, dregs (src1
+ 1));
3016 OUTS (outf
, imm5 (src1
));
3017 OUTS (outf
, ")(RNDH");
3019 OUTS (outf
, ", R)");
3023 else if (aop
== 2 && aopcde
== 22 && HL
== 0)
3025 OUTS (outf
, dregs (dst0
));
3026 OUTS (outf
, "=BYTEOP2M(");
3027 OUTS (outf
, dregs (src0
+ 1));
3029 OUTS (outf
, imm5 (src0
));
3031 OUTS (outf
, dregs (src1
+ 1));
3033 OUTS (outf
, imm5 (src1
));
3034 OUTS (outf
, ")(RNDL");
3036 OUTS (outf
, ", R)");
3040 else if (aop
== 1 && aopcde
== 22 && HL
== 1)
3042 OUTS (outf
, dregs (dst0
));
3043 OUTS (outf
, "=BYTEOP2P(");
3044 OUTS (outf
, dregs (src0
+ 1));
3046 OUTS (outf
, imm5 (src0
));
3048 OUTS (outf
, dregs (src1
+ 1));
3050 OUTS (outf
, imm5 (src1
));
3051 OUTS (outf
, ")(TH");
3053 OUTS (outf
, ", R)");
3057 else if (aop
== 1 && aopcde
== 22 && HL
== 0)
3059 OUTS (outf
, dregs (dst0
));
3060 OUTS (outf
, "=BYTEOP2P(");
3061 OUTS (outf
, dregs (src0
+ 1));
3063 OUTS (outf
, imm5 (src0
));
3065 OUTS (outf
, dregs (src1
+ 1));
3067 OUTS (outf
, imm5 (src1
));
3068 OUTS (outf
, ")(TL");
3070 OUTS (outf
, ", R)");
3074 else if (aop
== 0 && aopcde
== 22 && HL
== 1)
3076 OUTS (outf
, dregs (dst0
));
3077 OUTS (outf
, "=BYTEOP2P(");
3078 OUTS (outf
, dregs (src0
+ 1));
3080 OUTS (outf
, imm5 (src0
));
3082 OUTS (outf
, dregs (src1
+ 1));
3084 OUTS (outf
, imm5 (src1
));
3085 OUTS (outf
, ")(RNDH");
3087 OUTS (outf
, ", R)");
3091 else if (aop
== 0 && aopcde
== 22 && HL
== 0)
3093 OUTS (outf
, dregs (dst0
));
3094 OUTS (outf
, "=BYTEOP2P(");
3095 OUTS (outf
, dregs (src0
+ 1));
3097 OUTS (outf
, imm5 (src0
));
3099 OUTS (outf
, dregs (src1
+ 1));
3101 OUTS (outf
, imm5 (src1
));
3102 OUTS (outf
, ")(RNDL");
3104 OUTS (outf
, ", R)");
3108 else if (aop
== 0 && s
== 0 && aopcde
== 8)
3109 OUTS (outf
, "A0=0");
3111 else if (aop
== 0 && s
== 1 && aopcde
== 8)
3112 OUTS (outf
, "A0=A0(S)");
3114 else if (aop
== 1 && s
== 0 && aopcde
== 8)
3115 OUTS (outf
, "A1=0");
3117 else if (aop
== 1 && s
== 1 && aopcde
== 8)
3118 OUTS (outf
, "A1=A1(S)");
3120 else if (aop
== 2 && s
== 0 && aopcde
== 8)
3121 OUTS (outf
, "A1=A0=0");
3123 else if (aop
== 2 && s
== 1 && aopcde
== 8)
3124 OUTS (outf
, "A1=A1(S),A0=A0(S)");
3126 else if (aop
== 3 && s
== 0 && aopcde
== 8)
3127 OUTS (outf
, "A0=A1");
3129 else if (aop
== 3 && s
== 1 && aopcde
== 8)
3130 OUTS (outf
, "A1=A0");
3132 else if (aop
== 1 && aopcde
== 9 && s
== 0)
3134 OUTS (outf
, "A0.x=");
3135 OUTS (outf
, dregs_lo (src0
));
3137 else if (aop
== 1 && HL
== 0 && aopcde
== 11)
3139 OUTS (outf
, dregs_lo (dst0
));
3140 OUTS (outf
, "=(A0+=A1)");
3142 else if (aop
== 3 && HL
== 0 && aopcde
== 16)
3143 OUTS (outf
, "A1= ABS A0,A0= ABS A0");
3145 else if (aop
== 0 && aopcde
== 23 && HL
== 1)
3147 OUTS (outf
, dregs (dst0
));
3148 OUTS (outf
, "=BYTEOP3P(");
3149 OUTS (outf
, dregs (src0
+ 1));
3151 OUTS (outf
, imm5 (src0
));
3153 OUTS (outf
, dregs (src1
+ 1));
3155 OUTS (outf
, imm5 (src1
));
3156 OUTS (outf
, ")(HI");
3158 OUTS (outf
, ", R)");
3162 else if (aop
== 3 && aopcde
== 9 && s
== 0)
3164 OUTS (outf
, "A1.x=");
3165 OUTS (outf
, dregs_lo (src0
));
3167 else if (aop
== 1 && HL
== 1 && aopcde
== 16)
3168 OUTS (outf
, "A1= ABS A1");
3170 else if (aop
== 0 && HL
== 1 && aopcde
== 16)
3171 OUTS (outf
, "A1= ABS A0");
3173 else if (aop
== 2 && aopcde
== 9 && s
== 1)
3176 OUTS (outf
, dregs (src0
));
3178 else if (HL
== 0 && aop
== 3 && aopcde
== 12)
3180 OUTS (outf
, dregs_lo (dst0
));
3182 OUTS (outf
, dregs (src0
));
3183 OUTS (outf
, "(RND)");
3185 else if (aop
== 1 && HL
== 0 && aopcde
== 16)
3186 OUTS (outf
, "A0= ABS A1");
3188 else if (aop
== 0 && HL
== 0 && aopcde
== 16)
3189 OUTS (outf
, "A0= ABS A0");
3191 else if (aop
== 3 && HL
== 0 && aopcde
== 15)
3193 OUTS (outf
, dregs (dst0
));
3195 OUTS (outf
, dregs (src0
));
3198 else if (aop
== 3 && s
== 1 && HL
== 0 && aopcde
== 7)
3200 OUTS (outf
, dregs (dst0
));
3202 OUTS (outf
, dregs (src0
));
3205 else if (aop
== 3 && s
== 0 && HL
== 0 && aopcde
== 7)
3207 OUTS (outf
, dregs (dst0
));
3209 OUTS (outf
, dregs (src0
));
3210 OUTS (outf
, "(NS)");
3212 else if (aop
== 1 && HL
== 1 && aopcde
== 11)
3214 OUTS (outf
, dregs_hi (dst0
));
3215 OUTS (outf
, "=(A0+=A1)");
3217 else if (aop
== 2 && aopcde
== 11 && s
== 0)
3218 OUTS (outf
, "A0+=A1");
3220 else if (aop
== 2 && aopcde
== 11 && s
== 1)
3221 OUTS (outf
, "A0+=A1(W32)");
3223 else if (aop
== 3 && HL
== 0 && aopcde
== 14)
3224 OUTS (outf
, "A1=-A1,A0=-A0");
3226 else if (HL
== 1 && aop
== 3 && aopcde
== 12)
3228 OUTS (outf
, dregs_hi (dst0
));
3230 OUTS (outf
, dregs (src0
));
3231 OUTS (outf
, "(RND)");
3233 else if (aop
== 0 && aopcde
== 23 && HL
== 0)
3235 OUTS (outf
, dregs (dst0
));
3236 OUTS (outf
, "=BYTEOP3P(");
3237 OUTS (outf
, dregs (src0
+ 1));
3239 OUTS (outf
, imm5 (src0
));
3241 OUTS (outf
, dregs (src1
+ 1));
3243 OUTS (outf
, imm5 (src1
));
3244 OUTS (outf
, ")(LO");
3246 OUTS (outf
, ", R)");
3250 else if (aop
== 0 && HL
== 0 && aopcde
== 14)
3251 OUTS (outf
, "A0=-A0");
3253 else if (aop
== 1 && HL
== 0 && aopcde
== 14)
3254 OUTS (outf
, "A0=-A1");
3256 else if (aop
== 0 && HL
== 1 && aopcde
== 14)
3257 OUTS (outf
, "A1=-A0");
3259 else if (aop
== 1 && HL
== 1 && aopcde
== 14)
3260 OUTS (outf
, "A1=-A1");
3262 else if (aop
== 0 && aopcde
== 12)
3264 OUTS (outf
, dregs_hi (dst0
));
3266 OUTS (outf
, dregs_lo (dst0
));
3267 OUTS (outf
, "=SIGN(");
3268 OUTS (outf
, dregs_hi (src0
));
3270 OUTS (outf
, dregs_hi (src1
));
3271 OUTS (outf
, "+SIGN(");
3272 OUTS (outf
, dregs_lo (src0
));
3274 OUTS (outf
, dregs_lo (src1
));
3277 else if (aop
== 2 && aopcde
== 0)
3279 OUTS (outf
, dregs (dst0
));
3281 OUTS (outf
, dregs (src0
));
3283 OUTS (outf
, dregs (src1
));
3287 else if (aop
== 1 && aopcde
== 12)
3289 OUTS (outf
, dregs (dst1
));
3290 OUTS (outf
, "=A1.L+A1.H,");
3291 OUTS (outf
, dregs (dst0
));
3292 OUTS (outf
, "=A0.L+A0.H");
3294 else if (aop
== 2 && aopcde
== 4)
3296 OUTS (outf
, dregs (dst1
));
3298 OUTS (outf
, dregs (src0
));
3300 OUTS (outf
, dregs (src1
));
3302 OUTS (outf
, dregs (dst0
));
3304 OUTS (outf
, dregs (src0
));
3306 OUTS (outf
, dregs (src1
));
3310 else if (HL
== 0 && aopcde
== 1)
3312 OUTS (outf
, dregs (dst1
));
3314 OUTS (outf
, dregs (src0
));
3316 OUTS (outf
, dregs (src1
));
3318 OUTS (outf
, dregs (dst0
));
3320 OUTS (outf
, dregs (src0
));
3322 OUTS (outf
, dregs (src1
));
3323 amod0amod2 (s
, x
, aop
, outf
);
3325 else if (aop
== 0 && aopcde
== 11)
3327 OUTS (outf
, dregs (dst0
));
3328 OUTS (outf
, "=(A0+=A1)");
3330 else if (aop
== 0 && aopcde
== 10)
3332 OUTS (outf
, dregs_lo (dst0
));
3333 OUTS (outf
, "=A0.x");
3335 else if (aop
== 1 && aopcde
== 10)
3337 OUTS (outf
, dregs_lo (dst0
));
3338 OUTS (outf
, "=A1.x");
3340 else if (aop
== 1 && aopcde
== 0)
3342 OUTS (outf
, dregs (dst0
));
3344 OUTS (outf
, dregs (src0
));
3346 OUTS (outf
, dregs (src1
));
3350 else if (aop
== 3 && aopcde
== 0)
3352 OUTS (outf
, dregs (dst0
));
3354 OUTS (outf
, dregs (src0
));
3356 OUTS (outf
, dregs (src1
));
3360 else if (aop
== 1 && aopcde
== 4)
3362 OUTS (outf
, dregs (dst0
));
3364 OUTS (outf
, dregs (src0
));
3366 OUTS (outf
, dregs (src1
));
3370 else if (aop
== 0 && aopcde
== 17)
3372 OUTS (outf
, dregs (dst1
));
3373 OUTS (outf
, "=A1+A0,");
3374 OUTS (outf
, dregs (dst0
));
3375 OUTS (outf
, "=A1-A0 ");
3378 else if (aop
== 1 && aopcde
== 17)
3380 OUTS (outf
, dregs (dst1
));
3381 OUTS (outf
, "=A0+A1,");
3382 OUTS (outf
, dregs (dst0
));
3383 OUTS (outf
, "=A0-A1 ");
3386 else if (aop
== 0 && aopcde
== 18)
3388 OUTS (outf
, "SAA(");
3389 OUTS (outf
, dregs (src0
+ 1));
3391 OUTS (outf
, imm5 (src0
));
3393 OUTS (outf
, dregs (src1
+ 1));
3395 OUTS (outf
, imm5 (src1
));
3399 else if (aop
== 3 && aopcde
== 18)
3400 OUTS (outf
, "DISALGNEXCPT");
3402 else if (aop
== 0 && aopcde
== 20)
3404 OUTS (outf
, dregs (dst0
));
3405 OUTS (outf
, "=BYTEOP1P(");
3406 OUTS (outf
, dregs (src0
+ 1));
3408 OUTS (outf
, imm5 (src0
));
3410 OUTS (outf
, dregs (src1
+ 1));
3412 OUTS (outf
, imm5 (src1
));
3416 else if (aop
== 1 && aopcde
== 20)
3418 OUTS (outf
, dregs (dst0
));
3419 OUTS (outf
, "=BYTEOP1P(");
3420 OUTS (outf
, dregs (src0
+ 1));
3422 OUTS (outf
, imm5 (src0
));
3424 OUTS (outf
, dregs (src1
+ 1));
3426 OUTS (outf
, imm5 (src1
));
3429 OUTS (outf
, ", R)");
3433 else if (aop
== 0 && aopcde
== 21)
3436 OUTS (outf
, dregs (dst1
));
3438 OUTS (outf
, dregs (dst0
));
3439 OUTS (outf
, ")=BYTEOP16P(");
3440 OUTS (outf
, dregs (src0
+ 1));
3442 OUTS (outf
, imm5 (src0
));
3444 OUTS (outf
, dregs (src1
+ 1));
3446 OUTS (outf
, imm5 (src1
));
3450 else if (aop
== 1 && aopcde
== 21)
3453 OUTS (outf
, dregs (dst1
));
3455 OUTS (outf
, dregs (dst0
));
3456 OUTS (outf
, ")=BYTEOP16M(");
3457 OUTS (outf
, dregs (src0
+ 1));
3459 OUTS (outf
, imm5 (src0
));
3461 OUTS (outf
, dregs (src1
+ 1));
3463 OUTS (outf
, imm5 (src1
));
3467 else if (aop
== 2 && aopcde
== 7)
3469 OUTS (outf
, dregs (dst0
));
3470 OUTS (outf
, "= ABS ");
3471 OUTS (outf
, dregs (src0
));
3473 else if (aop
== 1 && aopcde
== 7)
3475 OUTS (outf
, dregs (dst0
));
3476 OUTS (outf
, "=MIN(");
3477 OUTS (outf
, dregs (src0
));
3479 OUTS (outf
, dregs (src1
));
3482 else if (aop
== 0 && aopcde
== 7)
3484 OUTS (outf
, dregs (dst0
));
3485 OUTS (outf
, "=MAX(");
3486 OUTS (outf
, dregs (src0
));
3488 OUTS (outf
, dregs (src1
));
3491 else if (aop
== 2 && aopcde
== 6)
3493 OUTS (outf
, dregs (dst0
));
3494 OUTS (outf
, "= ABS ");
3495 OUTS (outf
, dregs (src0
));
3498 else if (aop
== 1 && aopcde
== 6)
3500 OUTS (outf
, dregs (dst0
));
3501 OUTS (outf
, "=MIN(");
3502 OUTS (outf
, dregs (src0
));
3504 OUTS (outf
, dregs (src1
));
3505 OUTS (outf
, ")(V)");
3507 else if (aop
== 0 && aopcde
== 6)
3509 OUTS (outf
, dregs (dst0
));
3510 OUTS (outf
, "=MAX(");
3511 OUTS (outf
, dregs (src0
));
3513 OUTS (outf
, dregs (src1
));
3514 OUTS (outf
, ")(V)");
3516 else if (HL
== 1 && aopcde
== 1)
3518 OUTS (outf
, dregs (dst1
));
3520 OUTS (outf
, dregs (src0
));
3522 OUTS (outf
, dregs (src1
));
3524 OUTS (outf
, dregs (dst0
));
3526 OUTS (outf
, dregs (src0
));
3528 OUTS (outf
, dregs (src1
));
3529 amod0amod2 (s
, x
, aop
, outf
);
3531 else if (aop
== 0 && aopcde
== 4)
3533 OUTS (outf
, dregs (dst0
));
3535 OUTS (outf
, dregs (src0
));
3537 OUTS (outf
, dregs (src1
));
3541 else if (aop
== 0 && aopcde
== 0)
3543 OUTS (outf
, dregs (dst0
));
3545 OUTS (outf
, dregs (src0
));
3547 OUTS (outf
, dregs (src1
));
3551 else if (aop
== 0 && aopcde
== 24)
3553 OUTS (outf
, dregs (dst0
));
3554 OUTS (outf
, "=BYTEPACK(");
3555 OUTS (outf
, dregs (src0
));
3557 OUTS (outf
, dregs (src1
));
3560 else if (aop
== 1 && aopcde
== 24)
3563 OUTS (outf
, dregs (dst1
));
3565 OUTS (outf
, dregs (dst0
));
3566 OUTS (outf
, ") = BYTEUNPACK ");
3567 OUTS (outf
, dregs (src0
+ 1));
3569 OUTS (outf
, imm5 (src0
));
3573 else if (aopcde
== 13)
3576 OUTS (outf
, dregs (dst1
));
3578 OUTS (outf
, dregs (dst0
));
3579 OUTS (outf
, ") = SEARCH ");
3580 OUTS (outf
, dregs (src0
));
3582 searchmod (aop
, outf
);
3592 decode_dsp32shift_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
3595 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
3596 | 1 | 1 | 0 | 0 |.M.| 1 | 1 | 0 | 0 | - | - |.sopcde............|
3597 |.sop...|.HLs...|.dst0......| - | - | - |.src0......|.src1......|
3598 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
3599 int HLs
= ((iw1
>> DSP32Shift_HLs_bits
) & DSP32Shift_HLs_mask
);
3600 int sop
= ((iw1
>> DSP32Shift_sop_bits
) & DSP32Shift_sop_mask
);
3601 int src0
= ((iw1
>> DSP32Shift_src0_bits
) & DSP32Shift_src0_mask
);
3602 int src1
= ((iw1
>> DSP32Shift_src1_bits
) & DSP32Shift_src1_mask
);
3603 int dst0
= ((iw1
>> DSP32Shift_dst0_bits
) & DSP32Shift_dst0_mask
);
3604 int sopcde
= ((iw0
>> (DSP32Shift_sopcde_bits
- 16)) & DSP32Shift_sopcde_mask
);
3605 const char *acc01
= (HLs
& 1) == 0 ? "A0" : "A1";
3607 if (HLs
== 0 && sop
== 0 && sopcde
== 0)
3609 OUTS (outf
, dregs_lo (dst0
));
3610 OUTS (outf
, "= ASHIFT ");
3611 OUTS (outf
, dregs_lo (src1
));
3612 OUTS (outf
, " BY ");
3613 OUTS (outf
, dregs_lo (src0
));
3615 else if (HLs
== 1 && sop
== 0 && sopcde
== 0)
3617 OUTS (outf
, dregs_lo (dst0
));
3618 OUTS (outf
, "= ASHIFT ");
3619 OUTS (outf
, dregs_hi (src1
));
3620 OUTS (outf
, " BY ");
3621 OUTS (outf
, dregs_lo (src0
));
3623 else if (HLs
== 2 && sop
== 0 && sopcde
== 0)
3625 OUTS (outf
, dregs_hi (dst0
));
3626 OUTS (outf
, "= ASHIFT ");
3627 OUTS (outf
, dregs_lo (src1
));
3628 OUTS (outf
, " BY ");
3629 OUTS (outf
, dregs_lo (src0
));
3631 else if (HLs
== 3 && sop
== 0 && sopcde
== 0)
3633 OUTS (outf
, dregs_hi (dst0
));
3634 OUTS (outf
, "= ASHIFT ");
3635 OUTS (outf
, dregs_hi (src1
));
3636 OUTS (outf
, " BY ");
3637 OUTS (outf
, dregs_lo (src0
));
3639 else if (HLs
== 0 && sop
== 1 && sopcde
== 0)
3641 OUTS (outf
, dregs_lo (dst0
));
3642 OUTS (outf
, "= ASHIFT ");
3643 OUTS (outf
, dregs_lo (src1
));
3644 OUTS (outf
, " BY ");
3645 OUTS (outf
, dregs_lo (src0
));
3648 else if (HLs
== 1 && sop
== 1 && sopcde
== 0)
3650 OUTS (outf
, dregs_lo (dst0
));
3651 OUTS (outf
, "= ASHIFT ");
3652 OUTS (outf
, dregs_hi (src1
));
3653 OUTS (outf
, " BY ");
3654 OUTS (outf
, dregs_lo (src0
));
3657 else if (HLs
== 2 && sop
== 1 && sopcde
== 0)
3659 OUTS (outf
, dregs_hi (dst0
));
3660 OUTS (outf
, "= ASHIFT ");
3661 OUTS (outf
, dregs_lo (src1
));
3662 OUTS (outf
, " BY ");
3663 OUTS (outf
, dregs_lo (src0
));
3666 else if (HLs
== 3 && sop
== 1 && sopcde
== 0)
3668 OUTS (outf
, dregs_hi (dst0
));
3669 OUTS (outf
, "= ASHIFT ");
3670 OUTS (outf
, dregs_hi (src1
));
3671 OUTS (outf
, " BY ");
3672 OUTS (outf
, dregs_lo (src0
));
3675 else if (sop
== 2 && sopcde
== 0)
3677 OUTS (outf
, (HLs
& 2) == 0 ? dregs_lo (dst0
) : dregs_hi (dst0
));
3678 OUTS (outf
, "= LSHIFT ");
3679 OUTS (outf
, (HLs
& 1) == 0 ? dregs_lo (src1
) : dregs_hi (src1
));
3680 OUTS (outf
, " BY ");
3681 OUTS (outf
, dregs_lo (src0
));
3683 else if (sop
== 0 && sopcde
== 3)
3686 OUTS (outf
, "= ASHIFT ");
3688 OUTS (outf
, " BY ");
3689 OUTS (outf
, dregs_lo (src0
));
3691 else if (sop
== 1 && sopcde
== 3)
3694 OUTS (outf
, "= LSHIFT ");
3696 OUTS (outf
, " BY ");
3697 OUTS (outf
, dregs_lo (src0
));
3699 else if (sop
== 2 && sopcde
== 3)
3702 OUTS (outf
, "= ROT ");
3704 OUTS (outf
, " BY ");
3705 OUTS (outf
, dregs_lo (src0
));
3707 else if (sop
== 3 && sopcde
== 3)
3709 OUTS (outf
, dregs (dst0
));
3710 OUTS (outf
, "= ROT ");
3711 OUTS (outf
, dregs (src1
));
3712 OUTS (outf
, " BY ");
3713 OUTS (outf
, dregs_lo (src0
));
3715 else if (sop
== 1 && sopcde
== 1)
3717 OUTS (outf
, dregs (dst0
));
3718 OUTS (outf
, "= ASHIFT ");
3719 OUTS (outf
, dregs (src1
));
3720 OUTS (outf
, " BY ");
3721 OUTS (outf
, dregs_lo (src0
));
3722 OUTS (outf
, "(V,S)");
3724 else if (sop
== 0 && sopcde
== 1)
3726 OUTS (outf
, dregs (dst0
));
3727 OUTS (outf
, "= ASHIFT ");
3728 OUTS (outf
, dregs (src1
));
3729 OUTS (outf
, " BY ");
3730 OUTS (outf
, dregs_lo (src0
));
3733 else if (sop
== 0 && sopcde
== 2)
3735 OUTS (outf
, dregs (dst0
));
3736 OUTS (outf
, "= ASHIFT ");
3737 OUTS (outf
, dregs (src1
));
3738 OUTS (outf
, " BY ");
3739 OUTS (outf
, dregs_lo (src0
));
3741 else if (sop
== 1 && sopcde
== 2)
3743 OUTS (outf
, dregs (dst0
));
3744 OUTS (outf
, "= ASHIFT ");
3745 OUTS (outf
, dregs (src1
));
3746 OUTS (outf
, " BY ");
3747 OUTS (outf
, dregs_lo (src0
));
3750 else if (sop
== 2 && sopcde
== 2)
3752 OUTS (outf
, dregs (dst0
));
3753 OUTS (outf
, "=SHIFT ");
3754 OUTS (outf
, dregs (src1
));
3755 OUTS (outf
, " BY ");
3756 OUTS (outf
, dregs_lo (src0
));
3758 else if (sop
== 3 && sopcde
== 2)
3760 OUTS (outf
, dregs (dst0
));
3761 OUTS (outf
, "= ROT ");
3762 OUTS (outf
, dregs (src1
));
3763 OUTS (outf
, " BY ");
3764 OUTS (outf
, dregs_lo (src0
));
3766 else if (sop
== 2 && sopcde
== 1)
3768 OUTS (outf
, dregs (dst0
));
3769 OUTS (outf
, "=SHIFT ");
3770 OUTS (outf
, dregs (src1
));
3771 OUTS (outf
, " BY ");
3772 OUTS (outf
, dregs_lo (src0
));
3775 else if (sop
== 0 && sopcde
== 4)
3777 OUTS (outf
, dregs (dst0
));
3778 OUTS (outf
, "=PACK");
3780 OUTS (outf
, dregs_lo (src1
));
3782 OUTS (outf
, dregs_lo (src0
));
3785 else if (sop
== 1 && sopcde
== 4)
3787 OUTS (outf
, dregs (dst0
));
3788 OUTS (outf
, "=PACK(");
3789 OUTS (outf
, dregs_lo (src1
));
3791 OUTS (outf
, dregs_hi (src0
));
3794 else if (sop
== 2 && sopcde
== 4)
3796 OUTS (outf
, dregs (dst0
));
3797 OUTS (outf
, "=PACK(");
3798 OUTS (outf
, dregs_hi (src1
));
3800 OUTS (outf
, dregs_lo (src0
));
3803 else if (sop
== 3 && sopcde
== 4)
3805 OUTS (outf
, dregs (dst0
));
3806 OUTS (outf
, "=PACK(");
3807 OUTS (outf
, dregs_hi (src1
));
3809 OUTS (outf
, dregs_hi (src0
));
3812 else if (sop
== 0 && sopcde
== 5)
3814 OUTS (outf
, dregs_lo (dst0
));
3815 OUTS (outf
, "=SIGNBITS ");
3816 OUTS (outf
, dregs (src1
));
3818 else if (sop
== 1 && sopcde
== 5)
3820 OUTS (outf
, dregs_lo (dst0
));
3821 OUTS (outf
, "=SIGNBITS ");
3822 OUTS (outf
, dregs_lo (src1
));
3824 else if (sop
== 2 && sopcde
== 5)
3826 OUTS (outf
, dregs_lo (dst0
));
3827 OUTS (outf
, "=SIGNBITS ");
3828 OUTS (outf
, dregs_hi (src1
));
3830 else if (sop
== 0 && sopcde
== 6)
3832 OUTS (outf
, dregs_lo (dst0
));
3833 OUTS (outf
, "=SIGNBITS A0");
3835 else if (sop
== 1 && sopcde
== 6)
3837 OUTS (outf
, dregs_lo (dst0
));
3838 OUTS (outf
, "=SIGNBITS A1");
3840 else if (sop
== 3 && sopcde
== 6)
3842 OUTS (outf
, dregs_lo (dst0
));
3843 OUTS (outf
, "=ONES ");
3844 OUTS (outf
, dregs (src1
));
3846 else if (sop
== 0 && sopcde
== 7)
3848 OUTS (outf
, dregs_lo (dst0
));
3849 OUTS (outf
, "=EXPADJ (");
3850 OUTS (outf
, dregs (src1
));
3852 OUTS (outf
, dregs_lo (src0
));
3855 else if (sop
== 1 && sopcde
== 7)
3857 OUTS (outf
, dregs_lo (dst0
));
3858 OUTS (outf
, "=EXPADJ (");
3859 OUTS (outf
, dregs (src1
));
3861 OUTS (outf
, dregs_lo (src0
));
3862 OUTS (outf
, ") (V)");
3864 else if (sop
== 2 && sopcde
== 7)
3866 OUTS (outf
, dregs_lo (dst0
));
3867 OUTS (outf
, "=EXPADJ (");
3868 OUTS (outf
, dregs_lo (src1
));
3870 OUTS (outf
, dregs_lo (src0
));
3873 else if (sop
== 3 && sopcde
== 7)
3875 OUTS (outf
, dregs_lo (dst0
));
3876 OUTS (outf
, "=EXPADJ (");
3877 OUTS (outf
, dregs_hi (src1
));
3879 OUTS (outf
, dregs_lo (src0
));
3882 else if (sop
== 0 && sopcde
== 8)
3884 OUTS (outf
, "BITMUX (");
3885 OUTS (outf
, dregs (src0
));
3887 OUTS (outf
, dregs (src1
));
3888 OUTS (outf
, ",A0 )(ASR)");
3890 else if (sop
== 1 && sopcde
== 8)
3892 OUTS (outf
, "BITMUX (");
3893 OUTS (outf
, dregs (src0
));
3895 OUTS (outf
, dregs (src1
));
3896 OUTS (outf
, ",A0 )(ASL)");
3898 else if (sop
== 0 && sopcde
== 9)
3900 OUTS (outf
, dregs_lo (dst0
));
3901 OUTS (outf
, "=VIT_MAX (");
3902 OUTS (outf
, dregs (src1
));
3903 OUTS (outf
, ") (ASL)");
3905 else if (sop
== 1 && sopcde
== 9)
3907 OUTS (outf
, dregs_lo (dst0
));
3908 OUTS (outf
, "=VIT_MAX (");
3909 OUTS (outf
, dregs (src1
));
3910 OUTS (outf
, ") (ASR)");
3912 else if (sop
== 2 && sopcde
== 9)
3914 OUTS (outf
, dregs (dst0
));
3915 OUTS (outf
, "=VIT_MAX(");
3916 OUTS (outf
, dregs (src1
));
3918 OUTS (outf
, dregs (src0
));
3919 OUTS (outf
, ")(ASL)");
3921 else if (sop
== 3 && sopcde
== 9)
3923 OUTS (outf
, dregs (dst0
));
3924 OUTS (outf
, "=VIT_MAX(");
3925 OUTS (outf
, dregs (src1
));
3927 OUTS (outf
, dregs (src0
));
3928 OUTS (outf
, ")(ASR)");
3930 else if (sop
== 0 && sopcde
== 10)
3932 OUTS (outf
, dregs (dst0
));
3933 OUTS (outf
, "=EXTRACT(");
3934 OUTS (outf
, dregs (src1
));
3936 OUTS (outf
, dregs_lo (src0
));
3937 OUTS (outf
, ") (Z)");
3939 else if (sop
== 1 && sopcde
== 10)
3941 OUTS (outf
, dregs (dst0
));
3942 OUTS (outf
, "=EXTRACT(");
3943 OUTS (outf
, dregs (src1
));
3945 OUTS (outf
, dregs_lo (src0
));
3946 OUTS (outf
, ")(X)");
3948 else if (sop
== 2 && sopcde
== 10)
3950 OUTS (outf
, dregs (dst0
));
3951 OUTS (outf
, "=DEPOSIT(");
3952 OUTS (outf
, dregs (src1
));
3954 OUTS (outf
, dregs (src0
));
3957 else if (sop
== 3 && sopcde
== 10)
3959 OUTS (outf
, dregs (dst0
));
3960 OUTS (outf
, "=DEPOSIT(");
3961 OUTS (outf
, dregs (src1
));
3963 OUTS (outf
, dregs (src0
));
3964 OUTS (outf
, ")(X)");
3966 else if (sop
== 0 && sopcde
== 11)
3968 OUTS (outf
, dregs_lo (dst0
));
3969 OUTS (outf
, "=CC=BXORSHIFT(A0,");
3970 OUTS (outf
, dregs (src0
));
3973 else if (sop
== 1 && sopcde
== 11)
3975 OUTS (outf
, dregs_lo (dst0
));
3976 OUTS (outf
, "=CC=BXOR(A0,");
3977 OUTS (outf
, dregs (src0
));
3980 else if (sop
== 0 && sopcde
== 12)
3981 OUTS (outf
, "A0=BXORSHIFT(A0,A1 ,CC)");
3983 else if (sop
== 1 && sopcde
== 12)
3985 OUTS (outf
, dregs_lo (dst0
));
3986 OUTS (outf
, "=CC=BXOR( A0,A1 ,CC )");
3988 else if (sop
== 0 && sopcde
== 13)
3990 OUTS (outf
, dregs (dst0
));
3991 OUTS (outf
, "=ALIGN8(");
3992 OUTS (outf
, dregs (src1
));
3994 OUTS (outf
, dregs (src0
));
3997 else if (sop
== 1 && sopcde
== 13)
3999 OUTS (outf
, dregs (dst0
));
4000 OUTS (outf
, "=ALIGN16(");
4001 OUTS (outf
, dregs (src1
));
4003 OUTS (outf
, dregs (src0
));
4006 else if (sop
== 2 && sopcde
== 13)
4008 OUTS (outf
, dregs (dst0
));
4009 OUTS (outf
, "=ALIGN24(");
4010 OUTS (outf
, dregs (src1
));
4012 OUTS (outf
, dregs (src0
));
4022 decode_dsp32shiftimm_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
4025 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
4026 | 1 | 1 | 0 | 0 |.M.| 1 | 1 | 0 | 1 | - | - |.sopcde............|
4027 |.sop...|.HLs...|.dst0......|.immag.................|.src1......|
4028 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
4029 int src1
= ((iw1
>> DSP32ShiftImm_src1_bits
) & DSP32ShiftImm_src1_mask
);
4030 int sop
= ((iw1
>> DSP32ShiftImm_sop_bits
) & DSP32ShiftImm_sop_mask
);
4031 int bit8
= ((iw1
>> 8) & 0x1);
4032 int immag
= ((iw1
>> DSP32ShiftImm_immag_bits
) & DSP32ShiftImm_immag_mask
);
4033 int newimmag
= (-(iw1
>> DSP32ShiftImm_immag_bits
) & DSP32ShiftImm_immag_mask
);
4034 int dst0
= ((iw1
>> DSP32ShiftImm_dst0_bits
) & DSP32ShiftImm_dst0_mask
);
4035 int sopcde
= ((iw0
>> (DSP32ShiftImm_sopcde_bits
- 16)) & DSP32ShiftImm_sopcde_mask
);
4036 int HLs
= ((iw1
>> DSP32ShiftImm_HLs_bits
) & DSP32ShiftImm_HLs_mask
);
4039 if (sop
== 0 && sopcde
== 0)
4041 OUTS (outf
, (HLs
& 2) ? dregs_hi (dst0
) : dregs_lo (dst0
));
4043 OUTS (outf
, (HLs
& 1) ? dregs_hi (src1
) : dregs_lo (src1
));
4044 OUTS (outf
, " >>> ");
4045 OUTS (outf
, uimm4 (newimmag
));
4047 else if (sop
== 1 && sopcde
== 0 && bit8
== 0)
4049 OUTS (outf
, (HLs
& 2) ? dregs_hi (dst0
) : dregs_lo (dst0
));
4051 OUTS (outf
, (HLs
& 1) ? dregs_hi (src1
) : dregs_lo (src1
));
4052 OUTS (outf
, " << ");
4053 OUTS (outf
, uimm4 (immag
));
4054 OUTS (outf
, " (S)");
4056 else if (sop
== 1 && sopcde
== 0 && bit8
== 1)
4058 OUTS (outf
, (HLs
& 2) ? dregs_hi (dst0
) : dregs_lo (dst0
));
4060 OUTS (outf
, (HLs
& 1) ? dregs_hi (src1
) : dregs_lo (src1
));
4061 OUTS (outf
, " >>> ");
4062 OUTS (outf
, uimm4 (newimmag
));
4063 OUTS (outf
, " (S)");
4065 else if (sop
== 2 && sopcde
== 0 && bit8
== 0)
4067 OUTS (outf
, (HLs
& 2) ? dregs_hi (dst0
) : dregs_lo (dst0
));
4069 OUTS (outf
, (HLs
& 1) ? dregs_hi (src1
) : dregs_lo (src1
));
4070 OUTS (outf
, " << ");
4071 OUTS (outf
, uimm4 (immag
));
4073 else if (sop
== 2 && sopcde
== 0 && bit8
== 1)
4075 OUTS (outf
, (HLs
& 2) ? dregs_hi (dst0
) : dregs_lo (dst0
));
4077 OUTS (outf
, (HLs
& 1) ? dregs_hi (src1
) : dregs_lo (src1
));
4078 OUTS (outf
, " >> ");
4079 OUTS (outf
, uimm4 (newimmag
));
4081 else if (sop
== 2 && sopcde
== 3 && HLs
== 1)
4083 OUTS (outf
, "A1= ROT A1 BY ");
4084 OUTS (outf
, imm6 (immag
));
4086 else if (sop
== 0 && sopcde
== 3 && HLs
== 0 && bit8
== 0)
4088 OUTS (outf
, "A0=A0<<");
4089 OUTS (outf
, uimm5 (immag
));
4091 else if (sop
== 0 && sopcde
== 3 && HLs
== 0 && bit8
== 1)
4093 OUTS (outf
, "A0=A0>>>");
4094 OUTS (outf
, uimm5 (newimmag
));
4096 else if (sop
== 0 && sopcde
== 3 && HLs
== 1 && bit8
== 0)
4098 OUTS (outf
, "A1=A1<<");
4099 OUTS (outf
, uimm5 (immag
));
4101 else if (sop
== 0 && sopcde
== 3 && HLs
== 1 && bit8
== 1)
4103 OUTS (outf
, "A1=A1>>>");
4104 OUTS (outf
, uimm5 (newimmag
));
4106 else if (sop
== 1 && sopcde
== 3 && HLs
== 0)
4108 OUTS (outf
, "A0=A0>>");
4109 OUTS (outf
, uimm5 (newimmag
));
4111 else if (sop
== 1 && sopcde
== 3 && HLs
== 1)
4113 OUTS (outf
, "A1=A1>>");
4114 OUTS (outf
, uimm5 (newimmag
));
4116 else if (sop
== 2 && sopcde
== 3 && HLs
== 0)
4118 OUTS (outf
, "A0= ROT A0 BY ");
4119 OUTS (outf
, imm6 (immag
));
4121 else if (sop
== 1 && sopcde
== 1 && bit8
== 0)
4123 OUTS (outf
, dregs (dst0
));
4125 OUTS (outf
, dregs (src1
));
4127 OUTS (outf
, uimm5 (immag
));
4128 OUTS (outf
, " (V, S)");
4130 else if (sop
== 1 && sopcde
== 1 && bit8
== 1)
4132 OUTS (outf
, dregs (dst0
));
4134 OUTS (outf
, dregs (src1
));
4136 OUTS (outf
, imm5 (-immag
));
4137 OUTS (outf
, " (V)");
4139 else if (sop
== 2 && sopcde
== 1 && bit8
== 1)
4141 OUTS (outf
, dregs (dst0
));
4143 OUTS (outf
, dregs (src1
));
4144 OUTS (outf
, " >> ");
4145 OUTS (outf
, uimm5 (newimmag
));
4146 OUTS (outf
, " (V)");
4148 else if (sop
== 2 && sopcde
== 1 && bit8
== 0)
4150 OUTS (outf
, dregs (dst0
));
4152 OUTS (outf
, dregs (src1
));
4154 OUTS (outf
, imm5 (immag
));
4155 OUTS (outf
, " (V)");
4157 else if (sop
== 0 && sopcde
== 1)
4159 OUTS (outf
, dregs (dst0
));
4161 OUTS (outf
, dregs (src1
));
4163 OUTS (outf
, uimm5 (newimmag
));
4164 OUTS (outf
, " (V)");
4166 else if (sop
== 1 && sopcde
== 2)
4168 OUTS (outf
, dregs (dst0
));
4170 OUTS (outf
, dregs (src1
));
4172 OUTS (outf
, uimm5 (immag
));
4175 else if (sop
== 2 && sopcde
== 2 && bit8
== 1)
4177 OUTS (outf
, dregs (dst0
));
4179 OUTS (outf
, dregs (src1
));
4181 OUTS (outf
, uimm5 (newimmag
));
4183 else if (sop
== 2 && sopcde
== 2 && bit8
== 0)
4185 OUTS (outf
, dregs (dst0
));
4187 OUTS (outf
, dregs (src1
));
4189 OUTS (outf
, uimm5 (immag
));
4191 else if (sop
== 3 && sopcde
== 2)
4193 OUTS (outf
, dregs (dst0
));
4194 OUTS (outf
, "= ROT ");
4195 OUTS (outf
, dregs (src1
));
4196 OUTS (outf
, " BY ");
4197 OUTS (outf
, imm6 (immag
));
4199 else if (sop
== 0 && sopcde
== 2)
4201 OUTS (outf
, dregs (dst0
));
4203 OUTS (outf
, dregs (src1
));
4205 OUTS (outf
, uimm5 (newimmag
));
4214 decode_pseudoDEBUG_0 (TIword iw0
, disassemble_info
*outf
)
4217 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
4218 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |.fn....|.grp.......|.reg.......|
4219 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
4220 int fn
= ((iw0
>> PseudoDbg_fn_bits
) & PseudoDbg_fn_mask
);
4221 int grp
= ((iw0
>> PseudoDbg_grp_bits
) & PseudoDbg_grp_mask
);
4222 int reg
= ((iw0
>> PseudoDbg_reg_bits
) & PseudoDbg_reg_mask
);
4224 if (reg
== 0 && fn
== 3)
4225 OUTS (outf
, "DBG A0");
4227 else if (reg
== 1 && fn
== 3)
4228 OUTS (outf
, "DBG A1");
4230 else if (reg
== 3 && fn
== 3)
4231 OUTS (outf
, "ABORT");
4233 else if (reg
== 4 && fn
== 3)
4236 else if (reg
== 5 && fn
== 3)
4237 OUTS (outf
, "DBGHALT");
4239 else if (reg
== 6 && fn
== 3)
4241 OUTS (outf
, "DBGCMPLX(");
4242 OUTS (outf
, dregs (grp
));
4245 else if (reg
== 7 && fn
== 3)
4248 else if (grp
== 0 && fn
== 2)
4250 OUTS (outf
, "OUTC");
4251 OUTS (outf
, dregs (reg
));
4256 OUTS (outf
, allregs (reg
, grp
));
4260 OUTS (outf
, "PRNT");
4261 OUTS (outf
, allregs (reg
, grp
));
4270 decode_pseudodbg_assert_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
4273 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
4274 | 1 | 1 | 1 | 1 | 0 | - | - | - | - | - |.dbgop.....|.regtest...|
4275 |.expected......................................................|
4276 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
4277 int expected
= ((iw1
>> PseudoDbg_Assert_expected_bits
) & PseudoDbg_Assert_expected_mask
);
4278 int dbgop
= ((iw0
>> (PseudoDbg_Assert_dbgop_bits
- 16)) & PseudoDbg_Assert_dbgop_mask
);
4279 int regtest
= ((iw0
>> (PseudoDbg_Assert_regtest_bits
- 16)) & PseudoDbg_Assert_regtest_mask
);
4283 OUTS (outf
, "DBGA(");
4284 OUTS (outf
, dregs_lo (regtest
));
4286 OUTS (outf
, uimm16 (expected
));
4289 else if (dbgop
== 1)
4291 OUTS (outf
, "DBGA(");
4292 OUTS (outf
, dregs_hi (regtest
));
4294 OUTS (outf
, uimm16 (expected
));
4297 else if (dbgop
== 2)
4299 OUTS (outf
, "DBGAL(");
4300 OUTS (outf
, dregs (regtest
));
4302 OUTS (outf
, uimm16 (expected
));
4305 else if (dbgop
== 3)
4307 OUTS (outf
, "DBGAH(");
4308 OUTS (outf
, dregs (regtest
));
4310 OUTS (outf
, uimm16 (expected
));
4319 _print_insn_bfin (bfd_vma pc
, disassemble_info
*outf
)
4327 status
= (*outf
->read_memory_func
) (pc
& ~0x1, buf
, 2, outf
);
4328 status
= (*outf
->read_memory_func
) ((pc
+ 2) & ~0x1, buf
+ 2, 2, outf
);
4330 iw0
= bfd_getl16 (buf
);
4331 iw1
= bfd_getl16 (buf
+ 2);
4333 if ((iw0
& 0xf7ff) == 0xc003 && iw1
== 0x1800)
4335 OUTS (outf
, "mnop");
4338 else if ((iw0
& 0xff00) == 0x0000)
4339 rv
= decode_ProgCtrl_0 (iw0
, outf
);
4340 else if ((iw0
& 0xffc0) == 0x0240)
4341 rv
= decode_CaCTRL_0 (iw0
, outf
);
4342 else if ((iw0
& 0xff80) == 0x0100)
4343 rv
= decode_PushPopReg_0 (iw0
, outf
);
4344 else if ((iw0
& 0xfe00) == 0x0400)
4345 rv
= decode_PushPopMultiple_0 (iw0
, outf
);
4346 else if ((iw0
& 0xfe00) == 0x0600)
4347 rv
= decode_ccMV_0 (iw0
, outf
);
4348 else if ((iw0
& 0xf800) == 0x0800)
4349 rv
= decode_CCflag_0 (iw0
, outf
);
4350 else if ((iw0
& 0xffe0) == 0x0200)
4351 rv
= decode_CC2dreg_0 (iw0
, outf
);
4352 else if ((iw0
& 0xff00) == 0x0300)
4353 rv
= decode_CC2stat_0 (iw0
, outf
);
4354 else if ((iw0
& 0xf000) == 0x1000)
4355 rv
= decode_BRCC_0 (iw0
, pc
, outf
);
4356 else if ((iw0
& 0xf000) == 0x2000)
4357 rv
= decode_UJUMP_0 (iw0
, pc
, outf
);
4358 else if ((iw0
& 0xf000) == 0x3000)
4359 rv
= decode_REGMV_0 (iw0
, outf
);
4360 else if ((iw0
& 0xfc00) == 0x4000)
4361 rv
= decode_ALU2op_0 (iw0
, outf
);
4362 else if ((iw0
& 0xfe00) == 0x4400)
4363 rv
= decode_PTR2op_0 (iw0
, outf
);
4364 else if ((iw0
& 0xf800) == 0x4800)
4365 rv
= decode_LOGI2op_0 (iw0
, outf
);
4366 else if ((iw0
& 0xf000) == 0x5000)
4367 rv
= decode_COMP3op_0 (iw0
, outf
);
4368 else if ((iw0
& 0xf800) == 0x6000)
4369 rv
= decode_COMPI2opD_0 (iw0
, outf
);
4370 else if ((iw0
& 0xf800) == 0x6800)
4371 rv
= decode_COMPI2opP_0 (iw0
, outf
);
4372 else if ((iw0
& 0xf000) == 0x8000)
4373 rv
= decode_LDSTpmod_0 (iw0
, outf
);
4374 else if ((iw0
& 0xff60) == 0x9e60)
4375 rv
= decode_dagMODim_0 (iw0
, outf
);
4376 else if ((iw0
& 0xfff0) == 0x9f60)
4377 rv
= decode_dagMODik_0 (iw0
, outf
);
4378 else if ((iw0
& 0xfc00) == 0x9c00)
4379 rv
= decode_dspLDST_0 (iw0
, outf
);
4380 else if ((iw0
& 0xf000) == 0x9000)
4381 rv
= decode_LDST_0 (iw0
, outf
);
4382 else if ((iw0
& 0xfc00) == 0xb800)
4383 rv
= decode_LDSTiiFP_0 (iw0
, outf
);
4384 else if ((iw0
& 0xe000) == 0xA000)
4385 rv
= decode_LDSTii_0 (iw0
, outf
);
4386 else if ((iw0
& 0xff80) == 0xe080 && (iw1
& 0x0C00) == 0x0000)
4387 rv
= decode_LoopSetup_0 (iw0
, iw1
, pc
, outf
);
4388 else if ((iw0
& 0xff00) == 0xe100 && (iw1
& 0x0000) == 0x0000)
4389 rv
= decode_LDIMMhalf_0 (iw0
, iw1
, outf
);
4390 else if ((iw0
& 0xfe00) == 0xe200 && (iw1
& 0x0000) == 0x0000)
4391 rv
= decode_CALLa_0 (iw0
, iw1
, pc
, outf
);
4392 else if ((iw0
& 0xfc00) == 0xe400 && (iw1
& 0x0000) == 0x0000)
4393 rv
= decode_LDSTidxI_0 (iw0
, iw1
, outf
);
4394 else if ((iw0
& 0xfffe) == 0xe800 && (iw1
& 0x0000) == 0x0000)
4395 rv
= decode_linkage_0 (iw0
, iw1
, outf
);
4396 else if ((iw0
& 0xf600) == 0xc000 && (iw1
& 0x0000) == 0x0000)
4397 rv
= decode_dsp32mac_0 (iw0
, iw1
, outf
);
4398 else if ((iw0
& 0xf600) == 0xc200 && (iw1
& 0x0000) == 0x0000)
4399 rv
= decode_dsp32mult_0 (iw0
, iw1
, outf
);
4400 else if ((iw0
& 0xf7c0) == 0xc400 && (iw1
& 0x0000) == 0x0000)
4401 rv
= decode_dsp32alu_0 (iw0
, iw1
, outf
);
4402 else if ((iw0
& 0xf780) == 0xc600 && (iw1
& 0x01c0) == 0x0000)
4403 rv
= decode_dsp32shift_0 (iw0
, iw1
, outf
);
4404 else if ((iw0
& 0xf780) == 0xc680 && (iw1
& 0x0000) == 0x0000)
4405 rv
= decode_dsp32shiftimm_0 (iw0
, iw1
, outf
);
4406 else if ((iw0
& 0xff00) == 0xf800)
4407 rv
= decode_pseudoDEBUG_0 (iw0
, outf
);
4409 else if ((iw0
& 0xFF00) == 0xF900)
4410 rv
= decode_pseudoOChar_0 (iw0
, iw1
, pc
, outf
);
4412 else if ((iw0
& 0xFFC0) == 0xf000 && (iw1
& 0x0000) == 0x0000)
4413 rv
= decode_pseudodbg_assert_0 (iw0
, iw1
, outf
);
4420 print_insn_bfin (bfd_vma pc
, disassemble_info
*outf
)
4427 status
= (*outf
->read_memory_func
) (pc
& ~0x01, buf
, 2, outf
);
4428 iw0
= bfd_getl16 (buf
);
4430 count
+= _print_insn_bfin (pc
, outf
);
4432 /* Proper display of multiple issue instructions. */
4434 if ((iw0
& 0xc000) == 0xc000 && (iw0
& BIT_MULTI_INS
)
4435 && ((iw0
& 0xe800) != 0xe800 /* Not Linkage. */ ))
4437 outf
->fprintf_func (outf
->stream
, " || ");
4438 count
+= _print_insn_bfin (pc
+ 4, outf
);
4439 outf
->fprintf_func (outf
->stream
, " || ");
4440 count
+= _print_insn_bfin (pc
+ 6, outf
);
4444 outf
->fprintf_func (outf
->stream
, "ILLEGAL");
4447 outf
->fprintf_func (outf
->stream
, ";");