1 /* Disassemble ADI Blackfin Instructions.
2 Copyright (C) 2005-2020 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. */
24 #include "opcode/bfin.h"
36 #define SIGNBIT(bits) (1ul << ((bits) - 1))
37 #define MASKBITS(val, bits) ((val) & ((1ul << (bits)) - 1))
38 #define SIGNEXTEND(v, n) ((MASKBITS (v, n) ^ SIGNBIT (n)) - SIGNBIT (n))
40 #include "disassemble.h"
42 typedef unsigned int bu32
;
47 bfd_boolean comment
, parallel
;
52 c_0
, c_1
, c_4
, c_2
, c_uimm2
, c_uimm3
, c_imm3
, c_pcrel4
,
53 c_imm4
, c_uimm4s4
, c_uimm4s4d
, c_uimm4
, c_uimm4s2
, c_negimm5s4
, c_imm5
, c_imm5d
, c_uimm5
, c_imm6
,
54 c_imm7
, c_imm7d
, c_imm8
, c_uimm8
, c_pcrel8
, c_uimm8s4
, c_pcrel8s4
, c_lppcrel10
, c_pcrel10
,
55 c_pcrel12
, c_imm16s4
, c_luimm16
, c_imm16
, c_imm16d
, c_huimm16
, c_rimm16
, c_imm16s2
, c_uimm16s4
,
56 c_uimm16s4d
, c_uimm16
, c_pcrel24
, c_uimm32
, c_imm32
, c_huimm32
, c_huimm32e
,
73 } constant_formats
[] =
75 { "0", 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
76 { "1", 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
77 { "4", 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
78 { "2", 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
79 { "uimm2", 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
80 { "uimm3", 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
81 { "imm3", 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
82 { "pcrel4", 4, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0},
83 { "imm4", 4, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
84 { "uimm4s4", 4, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0},
85 { "uimm4s4d", 4, 0, 0, 0, 2, 0, 0, 1, 1, 0, 0},
86 { "uimm4", 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
87 { "uimm4s2", 4, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0},
88 { "negimm5s4", 5, 0, 1, 0, 2, 0, 1, 0, 0, 0, 0},
89 { "imm5", 5, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
90 { "imm5d", 5, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
91 { "uimm5", 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
92 { "imm6", 6, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
93 { "imm7", 7, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
94 { "imm7d", 7, 0, 1, 0, 0, 0, 0, 0, 1, 3, 0},
95 { "imm8", 8, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
96 { "uimm8", 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
97 { "pcrel8", 8, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0},
98 { "uimm8s4", 8, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0},
99 { "pcrel8s4", 8, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0},
100 { "lppcrel10", 10, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0},
101 { "pcrel10", 10, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0},
102 { "pcrel12", 12, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0},
103 { "imm16s4", 16, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0},
104 { "luimm16", 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
105 { "imm16", 16, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
106 { "imm16d", 16, 0, 1, 0, 0, 0, 0, 0, 1, 3, 0},
107 { "huimm16", 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
108 { "rimm16", 16, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
109 { "imm16s2", 16, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0},
110 { "uimm16s4", 16, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0},
111 { "uimm16s4d", 16, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0},
112 { "uimm16", 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
113 { "pcrel24", 24, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0},
114 { "uimm32", 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
115 { "imm32", 32, 0, 1, 0, 0, 0, 0, 0, 1, 3, 0},
116 { "huimm32", 32, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
117 { "huimm32e", 32, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1},
121 fmtconst (const_forms_t cf
, TIword x
, bfd_vma pc
, disassemble_info
*outf
)
125 if (constant_formats
[cf
].reloc
)
129 if (constant_formats
[cf
].pcrel
)
130 x
= SIGNEXTEND (x
, constant_formats
[cf
].nbits
);
131 ea
= x
+ constant_formats
[cf
].offset
;
132 ea
= ea
<< constant_formats
[cf
].scale
;
133 if (constant_formats
[cf
].pcrel
)
136 /* truncate to 32-bits for proper symbol lookup/matching */
139 if (outf
->symbol_at_address_func (ea
, outf
) || !constant_formats
[cf
].exact
)
141 outf
->print_address_func (ea
, outf
);
146 sprintf (buf
, "%lx", (unsigned long) x
);
151 /* Negative constants have an implied sign bit. */
152 if (constant_formats
[cf
].negative
)
154 int nb
= constant_formats
[cf
].nbits
+ 1;
156 x
= x
| (1ul << constant_formats
[cf
].nbits
);
157 x
= SIGNEXTEND (x
, nb
);
159 else if (constant_formats
[cf
].issigned
)
160 x
= SIGNEXTEND (x
, constant_formats
[cf
].nbits
);
162 x
+= constant_formats
[cf
].offset
;
163 x
= (unsigned long) x
<< constant_formats
[cf
].scale
;
165 if (constant_formats
[cf
].decimal
)
166 sprintf (buf
, "%*li", constant_formats
[cf
].leading
, x
);
169 if (constant_formats
[cf
].issigned
&& x
< 0)
170 sprintf (buf
, "-0x%lx", (unsigned long)(- x
));
172 sprintf (buf
, "0x%lx", (unsigned long) x
);
179 fmtconst_val (const_forms_t cf
, unsigned int x
, unsigned int pc
)
181 if (0 && constant_formats
[cf
].reloc
)
185 if (constant_formats
[cf
].pcrel
)
186 x
= SIGNEXTEND (x
, constant_formats
[cf
].nbits
);
187 ea
= x
+ constant_formats
[cf
].offset
;
188 ea
= ea
<< constant_formats
[cf
].scale
;
189 if (constant_formats
[cf
].pcrel
)
195 /* Negative constants have an implied sign bit. */
196 if (constant_formats
[cf
].negative
)
198 int nb
= constant_formats
[cf
].nbits
+ 1;
199 x
= x
| (1ul << constant_formats
[cf
].nbits
);
200 x
= SIGNEXTEND (x
, nb
);
202 else if (constant_formats
[cf
].issigned
)
203 x
= SIGNEXTEND (x
, constant_formats
[cf
].nbits
);
205 x
+= constant_formats
[cf
].offset
;
206 x
<<= constant_formats
[cf
].scale
;
211 enum machine_registers
213 REG_RL0
, REG_RL1
, REG_RL2
, REG_RL3
, REG_RL4
, REG_RL5
, REG_RL6
, REG_RL7
,
214 REG_RH0
, REG_RH1
, REG_RH2
, REG_RH3
, REG_RH4
, REG_RH5
, REG_RH6
, REG_RH7
,
215 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
216 REG_R1_0
, REG_R3_2
, REG_R5_4
, REG_R7_6
, REG_P0
, REG_P1
, REG_P2
, REG_P3
,
217 REG_P4
, REG_P5
, REG_SP
, REG_FP
, REG_A0x
, REG_A1x
, REG_A0w
, REG_A1w
,
218 REG_A0
, REG_A1
, REG_I0
, REG_I1
, REG_I2
, REG_I3
, REG_M0
, REG_M1
,
219 REG_M2
, REG_M3
, REG_B0
, REG_B1
, REG_B2
, REG_B3
, REG_L0
, REG_L1
,
221 REG_AZ
, REG_AN
, REG_AC0
, REG_AC1
, REG_AV0
, REG_AV1
, REG_AV0S
, REG_AV1S
,
222 REG_AQ
, REG_V
, REG_VS
,
223 REG_sftreset
, REG_omode
, REG_excause
, REG_emucause
, REG_idle_req
, REG_hwerrcause
, REG_CC
, REG_LC0
,
224 REG_LC1
, REG_ASTAT
, REG_RETS
, REG_LT0
, REG_LB0
, REG_LT1
, REG_LB1
,
225 REG_CYCLES
, REG_CYCLES2
, REG_USP
, REG_SEQSTAT
, REG_SYSCFG
, REG_RETI
, REG_RETX
, REG_RETN
,
226 REG_RETE
, REG_EMUDAT
, REG_BR0
, REG_BR1
, REG_BR2
, REG_BR3
, REG_BR4
, REG_BR5
, REG_BR6
,
227 REG_BR7
, REG_PL0
, REG_PL1
, REG_PL2
, REG_PL3
, REG_PL4
, REG_PL5
, REG_SLP
, REG_FLP
,
228 REG_PH0
, REG_PH1
, REG_PH2
, REG_PH3
, REG_PH4
, REG_PH5
, REG_SHP
, REG_FHP
,
229 REG_IL0
, REG_IL1
, REG_IL2
, REG_IL3
, REG_ML0
, REG_ML1
, REG_ML2
, REG_ML3
,
230 REG_BL0
, REG_BL1
, REG_BL2
, REG_BL3
, REG_LL0
, REG_LL1
, REG_LL2
, REG_LL3
,
231 REG_IH0
, REG_IH1
, REG_IH2
, REG_IH3
, REG_MH0
, REG_MH1
, REG_MH2
, REG_MH3
,
232 REG_BH0
, REG_BH1
, REG_BH2
, REG_BH3
, REG_LH0
, REG_LH1
, REG_LH2
, REG_LH3
,
233 REG_AC0_COPY
, REG_V_COPY
, REG_RND_MOD
,
239 rc_dregs_lo
, rc_dregs_hi
, rc_dregs
, rc_dregs_pair
, rc_pregs
, rc_spfp
, rc_dregs_hilo
, rc_accum_ext
,
240 rc_accum_word
, rc_accum
, rc_iregs
, rc_mregs
, rc_bregs
, rc_lregs
, rc_dpregs
, rc_gregs
,
241 rc_regs
, rc_statbits
, rc_ignore_bits
, rc_ccstat
, rc_counters
, rc_dregs2_sysregs1
, rc_open
, rc_sysregs2
,
242 rc_sysregs3
, rc_allregs
,
246 static const char * const reg_names
[] =
248 "R0.L", "R1.L", "R2.L", "R3.L", "R4.L", "R5.L", "R6.L", "R7.L",
249 "R0.H", "R1.H", "R2.H", "R3.H", "R4.H", "R5.H", "R6.H", "R7.H",
250 "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7",
251 "R1:0", "R3:2", "R5:4", "R7:6", "P0", "P1", "P2", "P3",
252 "P4", "P5", "SP", "FP", "A0.X", "A1.X", "A0.W", "A1.W",
253 "A0", "A1", "I0", "I1", "I2", "I3", "M0", "M1",
254 "M2", "M3", "B0", "B1", "B2", "B3", "L0", "L1",
256 "AZ", "AN", "AC0", "AC1", "AV0", "AV1", "AV0S", "AV1S",
258 "sftreset", "omode", "excause", "emucause", "idle_req", "hwerrcause", "CC", "LC0",
259 "LC1", "ASTAT", "RETS", "LT0", "LB0", "LT1", "LB1",
260 "CYCLES", "CYCLES2", "USP", "SEQSTAT", "SYSCFG", "RETI", "RETX", "RETN",
262 "R0.B", "R1.B", "R2.B", "R3.B", "R4.B", "R5.B", "R6.B", "R7.B",
263 "P0.L", "P1.L", "P2.L", "P3.L", "P4.L", "P5.L", "SP.L", "FP.L",
264 "P0.H", "P1.H", "P2.H", "P3.H", "P4.H", "P5.H", "SP.H", "FP.H",
265 "I0.L", "I1.L", "I2.L", "I3.L", "M0.L", "M1.L", "M2.L", "M3.L",
266 "B0.L", "B1.L", "B2.L", "B3.L", "L0.L", "L1.L", "L2.L", "L3.L",
267 "I0.H", "I1.H", "I2.H", "I3.H", "M0.H", "M1.H", "M2.H", "M3.H",
268 "B0.H", "B1.H", "B2.H", "B3.H", "L0.H", "L1.H", "L2.H", "L3.H",
269 "AC0_COPY", "V_COPY", "RND_MOD",
274 #define REGNAME(x) ((x) < REG_LASTREG ? (reg_names[x]) : "...... Illegal register .......")
277 static const enum machine_registers decode_dregs_lo
[] =
279 REG_RL0
, REG_RL1
, REG_RL2
, REG_RL3
, REG_RL4
, REG_RL5
, REG_RL6
, REG_RL7
,
282 #define dregs_lo(x) REGNAME (decode_dregs_lo[(x) & 7])
285 static const enum machine_registers decode_dregs_hi
[] =
287 REG_RH0
, REG_RH1
, REG_RH2
, REG_RH3
, REG_RH4
, REG_RH5
, REG_RH6
, REG_RH7
,
290 #define dregs_hi(x) REGNAME (decode_dregs_hi[(x) & 7])
293 static const enum machine_registers decode_dregs
[] =
295 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
298 #define dregs(x) REGNAME (decode_dregs[(x) & 7])
301 static const enum machine_registers decode_dregs_byte
[] =
303 REG_BR0
, REG_BR1
, REG_BR2
, REG_BR3
, REG_BR4
, REG_BR5
, REG_BR6
, REG_BR7
,
306 #define dregs_byte(x) REGNAME (decode_dregs_byte[(x) & 7])
309 static const enum machine_registers decode_pregs
[] =
311 REG_P0
, REG_P1
, REG_P2
, REG_P3
, REG_P4
, REG_P5
, REG_SP
, REG_FP
,
314 #define pregs(x) REGNAME (decode_pregs[(x) & 7])
315 #define spfp(x) REGNAME (decode_spfp[(x) & 1])
316 #define dregs_hilo(x, i) REGNAME (decode_dregs_hilo[((i) << 3) | (x)])
317 #define accum_ext(x) REGNAME (decode_accum_ext[(x) & 1])
318 #define accum_word(x) REGNAME (decode_accum_word[(x) & 1])
319 #define accum(x) REGNAME (decode_accum[(x) & 1])
322 static const enum machine_registers decode_iregs
[] =
324 REG_I0
, REG_I1
, REG_I2
, REG_I3
,
327 #define iregs(x) REGNAME (decode_iregs[(x) & 3])
330 static const enum machine_registers decode_mregs
[] =
332 REG_M0
, REG_M1
, REG_M2
, REG_M3
,
335 #define mregs(x) REGNAME (decode_mregs[(x) & 3])
336 #define bregs(x) REGNAME (decode_bregs[(x) & 3])
337 #define lregs(x) REGNAME (decode_lregs[(x) & 3])
340 static const enum machine_registers decode_dpregs
[] =
342 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
343 REG_P0
, REG_P1
, REG_P2
, REG_P3
, REG_P4
, REG_P5
, REG_SP
, REG_FP
,
346 #define dpregs(x) REGNAME (decode_dpregs[(x) & 15])
349 static const enum machine_registers decode_gregs
[] =
351 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
352 REG_P0
, REG_P1
, REG_P2
, REG_P3
, REG_P4
, REG_P5
, REG_SP
, REG_FP
,
355 #define gregs(x, i) REGNAME (decode_gregs[(((i) << 3) | (x)) & 15])
357 /* [dregs pregs (iregs mregs) (bregs lregs)]. */
358 static const enum machine_registers decode_regs
[] =
360 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
361 REG_P0
, REG_P1
, REG_P2
, REG_P3
, REG_P4
, REG_P5
, REG_SP
, REG_FP
,
362 REG_I0
, REG_I1
, REG_I2
, REG_I3
, REG_M0
, REG_M1
, REG_M2
, REG_M3
,
363 REG_B0
, REG_B1
, REG_B2
, REG_B3
, REG_L0
, REG_L1
, REG_L2
, REG_L3
,
366 #define regs(x, i) REGNAME (decode_regs[(((i) << 3) | (x)) & 31])
368 /* [dregs pregs (iregs mregs) (bregs lregs) Low Half]. */
369 static const enum machine_registers decode_regs_lo
[] =
371 REG_RL0
, REG_RL1
, REG_RL2
, REG_RL3
, REG_RL4
, REG_RL5
, REG_RL6
, REG_RL7
,
372 REG_PL0
, REG_PL1
, REG_PL2
, REG_PL3
, REG_PL4
, REG_PL5
, REG_SLP
, REG_FLP
,
373 REG_IL0
, REG_IL1
, REG_IL2
, REG_IL3
, REG_ML0
, REG_ML1
, REG_ML2
, REG_ML3
,
374 REG_BL0
, REG_BL1
, REG_BL2
, REG_BL3
, REG_LL0
, REG_LL1
, REG_LL2
, REG_LL3
,
377 #define regs_lo(x, i) REGNAME (decode_regs_lo[(((i) << 3) | (x)) & 31])
379 /* [dregs pregs (iregs mregs) (bregs lregs) High Half]. */
380 static const enum machine_registers decode_regs_hi
[] =
382 REG_RH0
, REG_RH1
, REG_RH2
, REG_RH3
, REG_RH4
, REG_RH5
, REG_RH6
, REG_RH7
,
383 REG_PH0
, REG_PH1
, REG_PH2
, REG_PH3
, REG_PH4
, REG_PH5
, REG_SHP
, REG_FHP
,
384 REG_IH0
, REG_IH1
, REG_IH2
, REG_IH3
, REG_MH0
, REG_MH1
, REG_MH2
, REG_MH3
,
385 REG_BH0
, REG_BH1
, REG_BH2
, REG_BH3
, REG_LH0
, REG_LH1
, REG_LH2
, REG_LH3
,
388 #define regs_hi(x, i) REGNAME (decode_regs_hi[(((i) << 3) | (x)) & 31])
390 static const enum machine_registers decode_statbits
[] =
392 REG_AZ
, REG_AN
, REG_AC0_COPY
, REG_V_COPY
,
393 REG_LASTREG
, REG_LASTREG
, REG_AQ
, REG_LASTREG
,
394 REG_RND_MOD
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
,
395 REG_AC0
, REG_AC1
, REG_LASTREG
, REG_LASTREG
,
396 REG_AV0
, REG_AV0S
, REG_AV1
, REG_AV1S
,
397 REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
,
398 REG_V
, REG_VS
, REG_LASTREG
, REG_LASTREG
,
399 REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
,
402 #define statbits(x) REGNAME (decode_statbits[(x) & 31])
405 static const enum machine_registers decode_counters
[] =
410 #define counters(x) REGNAME (decode_counters[(x) & 1])
411 #define dregs2_sysregs1(x) REGNAME (decode_dregs2_sysregs1[(x) & 7])
413 /* [dregs pregs (iregs mregs) (bregs lregs)
414 dregs2_sysregs1 open sysregs2 sysregs3]. */
415 static const enum machine_registers decode_allregs
[] =
417 REG_R0
, REG_R1
, REG_R2
, REG_R3
, REG_R4
, REG_R5
, REG_R6
, REG_R7
,
418 REG_P0
, REG_P1
, REG_P2
, REG_P3
, REG_P4
, REG_P5
, REG_SP
, REG_FP
,
419 REG_I0
, REG_I1
, REG_I2
, REG_I3
, REG_M0
, REG_M1
, REG_M2
, REG_M3
,
420 REG_B0
, REG_B1
, REG_B2
, REG_B3
, REG_L0
, REG_L1
, REG_L2
, REG_L3
,
421 REG_A0x
, REG_A0w
, REG_A1x
, REG_A1w
, REG_LASTREG
, REG_LASTREG
, REG_ASTAT
, REG_RETS
,
422 REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
, REG_LASTREG
,
423 REG_LC0
, REG_LT0
, REG_LB0
, REG_LC1
, REG_LT1
, REG_LB1
, REG_CYCLES
, REG_CYCLES2
,
424 REG_USP
, REG_SEQSTAT
, REG_SYSCFG
, REG_RETI
, REG_RETX
, REG_RETN
, REG_RETE
, REG_EMUDAT
,
428 #define IS_DREG(g,r) ((g) == 0 && (r) < 8)
429 #define IS_PREG(g,r) ((g) == 1 && (r) < 8)
430 #define IS_AREG(g,r) ((g) == 4 && (r) >= 0 && (r) < 4)
431 #define IS_GENREG(g,r) ((((g) == 0 || (g) == 1) && (r) < 8) || IS_AREG (g, r))
432 #define IS_DAGREG(g,r) (((g) == 2 || (g) == 3) && (r) < 8)
433 #define IS_SYSREG(g,r) \
434 (((g) == 4 && ((r) == 6 || (r) == 7)) || (g) == 6 || (g) == 7)
435 #define IS_RESERVEDREG(g,r) \
436 (((r) > 7) || ((g) == 4 && ((r) == 4 || (r) == 5)) || (g) == 5)
438 #define allreg(r,g) (!IS_RESERVEDREG (g, r))
439 #define mostreg(r,g) (!(IS_DREG (g, r) || IS_PREG (g, r) || IS_RESERVEDREG (g, r)))
441 #define allregs(x, i) REGNAME (decode_allregs[((i) << 3) | (x)])
442 #define uimm16s4(x) fmtconst (c_uimm16s4, x, 0, outf)
443 #define uimm16s4d(x) fmtconst (c_uimm16s4d, x, 0, outf)
444 #define pcrel4(x) fmtconst (c_pcrel4, x, pc, outf)
445 #define pcrel8(x) fmtconst (c_pcrel8, x, pc, outf)
446 #define pcrel8s4(x) fmtconst (c_pcrel8s4, x, pc, outf)
447 #define pcrel10(x) fmtconst (c_pcrel10, x, pc, outf)
448 #define pcrel12(x) fmtconst (c_pcrel12, x, pc, outf)
449 #define negimm5s4(x) fmtconst (c_negimm5s4, x, 0, outf)
450 #define rimm16(x) fmtconst (c_rimm16, x, 0, outf)
451 #define huimm16(x) fmtconst (c_huimm16, x, 0, outf)
452 #define imm16(x) fmtconst (c_imm16, x, 0, outf)
453 #define imm16d(x) fmtconst (c_imm16d, x, 0, outf)
454 #define uimm2(x) fmtconst (c_uimm2, x, 0, outf)
455 #define uimm3(x) fmtconst (c_uimm3, x, 0, outf)
456 #define luimm16(x) fmtconst (c_luimm16, x, 0, outf)
457 #define uimm4(x) fmtconst (c_uimm4, x, 0, outf)
458 #define uimm5(x) fmtconst (c_uimm5, x, 0, outf)
459 #define imm16s2(x) fmtconst (c_imm16s2, x, 0, outf)
460 #define uimm8(x) fmtconst (c_uimm8, x, 0, outf)
461 #define imm16s4(x) fmtconst (c_imm16s4, x, 0, outf)
462 #define uimm4s2(x) fmtconst (c_uimm4s2, x, 0, outf)
463 #define uimm4s4(x) fmtconst (c_uimm4s4, x, 0, outf)
464 #define uimm4s4d(x) fmtconst (c_uimm4s4d, x, 0, outf)
465 #define lppcrel10(x) fmtconst (c_lppcrel10, x, pc, outf)
466 #define imm3(x) fmtconst (c_imm3, x, 0, outf)
467 #define imm4(x) fmtconst (c_imm4, x, 0, outf)
468 #define uimm8s4(x) fmtconst (c_uimm8s4, x, 0, outf)
469 #define imm5(x) fmtconst (c_imm5, x, 0, outf)
470 #define imm5d(x) fmtconst (c_imm5d, x, 0, outf)
471 #define imm6(x) fmtconst (c_imm6, x, 0, outf)
472 #define imm7(x) fmtconst (c_imm7, x, 0, outf)
473 #define imm7d(x) fmtconst (c_imm7d, x, 0, outf)
474 #define imm8(x) fmtconst (c_imm8, x, 0, outf)
475 #define pcrel24(x) fmtconst (c_pcrel24, x, pc, outf)
476 #define uimm16(x) fmtconst (c_uimm16, x, 0, outf)
477 #define uimm32(x) fmtconst (c_uimm32, x, 0, outf)
478 #define imm32(x) fmtconst (c_imm32, x, 0, outf)
479 #define huimm32(x) fmtconst (c_huimm32, x, 0, outf)
480 #define huimm32e(x) fmtconst (c_huimm32e, x, 0, outf)
481 #define imm7_val(x) fmtconst_val (c_imm7, x, 0)
482 #define imm16_val(x) fmtconst_val (c_uimm16, x, 0)
483 #define luimm16_val(x) fmtconst_val (c_luimm16, x, 0)
485 /* (arch.pm)arch_disassembler_functions. */
487 #define OUTS(p, txt) (p)->fprintf_func ((p)->stream, "%s", txt)
489 #define OUT(p, txt, ...) (p)->fprintf_func ((p)->stream, txt, ## __VA_ARGS__)
492 amod0 (int s0
, int x0
, disassemble_info
*outf
)
494 if (s0
== 1 && x0
== 0)
496 else if (s0
== 0 && x0
== 1)
497 OUTS (outf
, " (CO)");
498 else if (s0
== 1 && x0
== 1)
499 OUTS (outf
, " (SCO)");
503 amod1 (int s0
, int x0
, disassemble_info
*outf
)
505 if (s0
== 0 && x0
== 0)
506 OUTS (outf
, " (NS)");
507 else if (s0
== 1 && x0
== 0)
512 amod0amod2 (int s0
, int x0
, int aop0
, disassemble_info
*outf
)
514 if (s0
== 1 && x0
== 0 && aop0
== 0)
516 else if (s0
== 0 && x0
== 1 && aop0
== 0)
517 OUTS (outf
, " (CO)");
518 else if (s0
== 1 && x0
== 1 && aop0
== 0)
519 OUTS (outf
, " (SCO)");
520 else if (s0
== 0 && x0
== 0 && aop0
== 2)
521 OUTS (outf
, " (ASR)");
522 else if (s0
== 1 && x0
== 0 && aop0
== 2)
523 OUTS (outf
, " (S, ASR)");
524 else if (s0
== 0 && x0
== 1 && aop0
== 2)
525 OUTS (outf
, " (CO, ASR)");
526 else if (s0
== 1 && x0
== 1 && aop0
== 2)
527 OUTS (outf
, " (SCO, ASR)");
528 else if (s0
== 0 && x0
== 0 && aop0
== 3)
529 OUTS (outf
, " (ASL)");
530 else if (s0
== 1 && x0
== 0 && aop0
== 3)
531 OUTS (outf
, " (S, ASL)");
532 else if (s0
== 0 && x0
== 1 && aop0
== 3)
533 OUTS (outf
, " (CO, ASL)");
534 else if (s0
== 1 && x0
== 1 && aop0
== 3)
535 OUTS (outf
, " (SCO, ASL)");
539 searchmod (int r0
, disassemble_info
*outf
)
552 aligndir (int r0
, disassemble_info
*outf
)
559 decode_multfunc (int h0
, int h1
, int src0
, int src1
, disassemble_info
*outf
)
564 s0
= dregs_hi (src0
);
566 s0
= dregs_lo (src0
);
569 s1
= dregs_hi (src1
);
571 s1
= dregs_lo (src1
);
580 decode_macfunc (int which
, int op
, int h0
, int h1
, int src0
, int src1
, disassemble_info
*outf
)
583 const char *sop
= "<unknown op>";
598 case 0: sop
= " = "; break;
599 case 1: sop
= " += "; break;
600 case 2: sop
= " -= "; break;
606 decode_multfunc (h0
, h1
, src0
, src1
, outf
);
612 decode_optmode (int mod
, int MM
, disassemble_info
*outf
)
614 if (mod
== 0 && MM
== 0)
629 OUTS (outf
, "S2RND");
632 else if (mod
== M_W32
)
634 else if (mod
== M_FU
)
636 else if (mod
== M_TFU
)
638 else if (mod
== M_IS
)
640 else if (mod
== M_ISS2
)
642 else if (mod
== M_IH
)
644 else if (mod
== M_IU
)
652 static struct saved_state
654 bu32 dpregs
[16], iregs
[4], mregs
[4], bregs
[4], lregs
[4];
656 bu32 lt
[2], lc
[2], lb
[2];
660 #define DREG(x) (saved_state.dpregs[x])
661 #define GREG(x, i) DPREG ((x) | ((i) << 3))
662 #define DPREG(x) (saved_state.dpregs[x])
663 #define DREG(x) (saved_state.dpregs[x])
664 #define PREG(x) (saved_state.dpregs[(x) + 8])
665 #define SPREG PREG (6)
666 #define FPREG PREG (7)
667 #define IREG(x) (saved_state.iregs[x])
668 #define MREG(x) (saved_state.mregs[x])
669 #define BREG(x) (saved_state.bregs[x])
670 #define LREG(x) (saved_state.lregs[x])
671 #define AXREG(x) (saved_state.ax[x])
672 #define AWREG(x) (saved_state.aw[x])
673 #define LCREG(x) (saved_state.lc[x])
674 #define LTREG(x) (saved_state.lt[x])
675 #define LBREG(x) (saved_state.lb[x])
676 #define RETSREG (saved_state.rets)
679 get_allreg (int grp
, int reg
)
681 int fullreg
= (grp
<< 3) | reg
;
682 /* REG_R0, REG_R1, REG_R2, REG_R3, REG_R4, REG_R5, REG_R6, REG_R7,
683 REG_P0, REG_P1, REG_P2, REG_P3, REG_P4, REG_P5, REG_SP, REG_FP,
684 REG_I0, REG_I1, REG_I2, REG_I3, REG_M0, REG_M1, REG_M2, REG_M3,
685 REG_B0, REG_B1, REG_B2, REG_B3, REG_L0, REG_L1, REG_L2, REG_L3,
686 REG_A0x, REG_A0w, REG_A1x, REG_A1w, , , REG_ASTAT, REG_RETS,
688 REG_LC0, REG_LT0, REG_LB0, REG_LC1, REG_LT1, REG_LB1, REG_CYCLES,
690 REG_USP, REG_SEQSTAT, REG_SYSCFG, REG_RETI, REG_RETX, REG_RETN, REG_RETE,
692 switch (fullreg
>> 2)
694 case 0: case 1: return &DREG (reg
);
695 case 2: case 3: return &PREG (reg
);
696 case 4: return &IREG (reg
& 3);
697 case 5: return &MREG (reg
& 3);
698 case 6: return &BREG (reg
& 3);
699 case 7: return &LREG (reg
& 3);
703 case 32: return &AXREG (0);
704 case 33: return &AWREG (0);
705 case 34: return &AXREG (1);
706 case 35: return &AWREG (1);
707 case 39: return &RETSREG
;
708 case 48: return &LCREG (0);
709 case 49: return <REG (0);
710 case 50: return &LBREG (0);
711 case 51: return &LCREG (1);
712 case 52: return <REG (1);
713 case 53: return &LBREG (1);
720 decode_ProgCtrl_0 (TIword iw0
, disassemble_info
*outf
)
722 struct private *priv
= outf
->private_data
;
724 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
725 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |.prgfunc.......|.poprnd........|
726 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
727 int poprnd
= ((iw0
>> ProgCtrl_poprnd_bits
) & ProgCtrl_poprnd_mask
);
728 int prgfunc
= ((iw0
>> ProgCtrl_prgfunc_bits
) & ProgCtrl_prgfunc_mask
);
730 if (prgfunc
== 0 && poprnd
== 0)
732 else if (priv
->parallel
)
734 else if (prgfunc
== 1 && poprnd
== 0)
736 else if (prgfunc
== 1 && poprnd
== 1)
738 else if (prgfunc
== 1 && poprnd
== 2)
740 else if (prgfunc
== 1 && poprnd
== 3)
742 else if (prgfunc
== 1 && poprnd
== 4)
744 else if (prgfunc
== 2 && poprnd
== 0)
746 else if (prgfunc
== 2 && poprnd
== 3)
747 OUTS (outf
, "CSYNC");
748 else if (prgfunc
== 2 && poprnd
== 4)
749 OUTS (outf
, "SSYNC");
750 else if (prgfunc
== 2 && poprnd
== 5)
751 OUTS (outf
, "EMUEXCPT");
752 else if (prgfunc
== 3 && IS_DREG (0, poprnd
))
755 OUTS (outf
, dregs (poprnd
));
757 else if (prgfunc
== 4 && IS_DREG (0, poprnd
))
760 OUTS (outf
, dregs (poprnd
));
762 else if (prgfunc
== 5 && IS_PREG (1, poprnd
))
764 OUTS (outf
, "JUMP (");
765 OUTS (outf
, pregs (poprnd
));
768 else if (prgfunc
== 6 && IS_PREG (1, poprnd
))
770 OUTS (outf
, "CALL (");
771 OUTS (outf
, pregs (poprnd
));
774 else if (prgfunc
== 7 && IS_PREG (1, poprnd
))
776 OUTS (outf
, "CALL (PC + ");
777 OUTS (outf
, pregs (poprnd
));
780 else if (prgfunc
== 8 && IS_PREG (1, poprnd
))
782 OUTS (outf
, "JUMP (PC + ");
783 OUTS (outf
, pregs (poprnd
));
786 else if (prgfunc
== 9)
788 OUTS (outf
, "RAISE ");
789 OUTS (outf
, uimm4 (poprnd
));
791 else if (prgfunc
== 10)
793 OUTS (outf
, "EXCPT ");
794 OUTS (outf
, uimm4 (poprnd
));
796 else if (prgfunc
== 11 && IS_PREG (1, poprnd
) && poprnd
<= 5)
798 OUTS (outf
, "TESTSET (");
799 OUTS (outf
, pregs (poprnd
));
808 decode_CaCTRL_0 (TIword iw0
, disassemble_info
*outf
)
810 struct private *priv
= outf
->private_data
;
812 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
813 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 |.a.|.op....|.reg.......|
814 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
815 int a
= ((iw0
>> CaCTRL_a_bits
) & CaCTRL_a_mask
);
816 int op
= ((iw0
>> CaCTRL_op_bits
) & CaCTRL_op_mask
);
817 int reg
= ((iw0
>> CaCTRL_reg_bits
) & CaCTRL_reg_mask
);
822 if (a
== 0 && op
== 0)
824 OUTS (outf
, "PREFETCH[");
825 OUTS (outf
, pregs (reg
));
828 else if (a
== 0 && op
== 1)
830 OUTS (outf
, "FLUSHINV[");
831 OUTS (outf
, pregs (reg
));
834 else if (a
== 0 && op
== 2)
836 OUTS (outf
, "FLUSH[");
837 OUTS (outf
, pregs (reg
));
840 else if (a
== 0 && op
== 3)
842 OUTS (outf
, "IFLUSH[");
843 OUTS (outf
, pregs (reg
));
846 else if (a
== 1 && op
== 0)
848 OUTS (outf
, "PREFETCH[");
849 OUTS (outf
, pregs (reg
));
852 else if (a
== 1 && op
== 1)
854 OUTS (outf
, "FLUSHINV[");
855 OUTS (outf
, pregs (reg
));
858 else if (a
== 1 && op
== 2)
860 OUTS (outf
, "FLUSH[");
861 OUTS (outf
, pregs (reg
));
864 else if (a
== 1 && op
== 3)
866 OUTS (outf
, "IFLUSH[");
867 OUTS (outf
, pregs (reg
));
876 decode_PushPopReg_0 (TIword iw0
, disassemble_info
*outf
)
878 struct private *priv
= outf
->private_data
;
880 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
881 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |.W.|.grp.......|.reg.......|
882 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
883 int W
= ((iw0
>> PushPopReg_W_bits
) & PushPopReg_W_mask
);
884 int grp
= ((iw0
>> PushPopReg_grp_bits
) & PushPopReg_grp_mask
);
885 int reg
= ((iw0
>> PushPopReg_reg_bits
) & PushPopReg_reg_mask
);
890 if (W
== 0 && mostreg (reg
, grp
))
892 OUTS (outf
, allregs (reg
, grp
));
893 OUTS (outf
, " = [SP++]");
895 else if (W
== 1 && allreg (reg
, grp
) && !(grp
== 1 && reg
== 6))
897 OUTS (outf
, "[--SP] = ");
898 OUTS (outf
, allregs (reg
, grp
));
906 decode_PushPopMultiple_0 (TIword iw0
, disassemble_info
*outf
)
908 struct private *priv
= outf
->private_data
;
910 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
911 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |.d.|.p.|.W.|.dr........|.pr........|
912 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
913 int p
= ((iw0
>> PushPopMultiple_p_bits
) & PushPopMultiple_p_mask
);
914 int d
= ((iw0
>> PushPopMultiple_d_bits
) & PushPopMultiple_d_mask
);
915 int W
= ((iw0
>> PushPopMultiple_W_bits
) & PushPopMultiple_W_mask
);
916 int dr
= ((iw0
>> PushPopMultiple_dr_bits
) & PushPopMultiple_dr_mask
);
917 int pr
= ((iw0
>> PushPopMultiple_pr_bits
) & PushPopMultiple_pr_mask
);
925 if (W
== 1 && d
== 1 && p
== 1)
927 OUTS (outf
, "[--SP] = (R7:");
928 OUTS (outf
, imm5d (dr
));
929 OUTS (outf
, ", P5:");
930 OUTS (outf
, imm5d (pr
));
933 else if (W
== 1 && d
== 1 && p
== 0 && pr
== 0)
935 OUTS (outf
, "[--SP] = (R7:");
936 OUTS (outf
, imm5d (dr
));
939 else if (W
== 1 && d
== 0 && p
== 1 && dr
== 0)
941 OUTS (outf
, "[--SP] = (P5:");
942 OUTS (outf
, imm5d (pr
));
945 else if (W
== 0 && d
== 1 && p
== 1)
948 OUTS (outf
, imm5d (dr
));
949 OUTS (outf
, ", P5:");
950 OUTS (outf
, imm5d (pr
));
951 OUTS (outf
, ") = [SP++]");
953 else if (W
== 0 && d
== 1 && p
== 0 && pr
== 0)
956 OUTS (outf
, imm5d (dr
));
957 OUTS (outf
, ") = [SP++]");
959 else if (W
== 0 && d
== 0 && p
== 1 && dr
== 0)
962 OUTS (outf
, imm5d (pr
));
963 OUTS (outf
, ") = [SP++]");
971 decode_ccMV_0 (TIword iw0
, disassemble_info
*outf
)
973 struct private *priv
= outf
->private_data
;
975 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
976 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |.T.|.d.|.s.|.dst.......|.src.......|
977 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
978 int s
= ((iw0
>> CCmv_s_bits
) & CCmv_s_mask
);
979 int d
= ((iw0
>> CCmv_d_bits
) & CCmv_d_mask
);
980 int T
= ((iw0
>> CCmv_T_bits
) & CCmv_T_mask
);
981 int src
= ((iw0
>> CCmv_src_bits
) & CCmv_src_mask
);
982 int dst
= ((iw0
>> CCmv_dst_bits
) & CCmv_dst_mask
);
989 OUTS (outf
, "IF CC ");
990 OUTS (outf
, gregs (dst
, d
));
992 OUTS (outf
, gregs (src
, s
));
996 OUTS (outf
, "IF !CC ");
997 OUTS (outf
, gregs (dst
, d
));
999 OUTS (outf
, gregs (src
, s
));
1007 decode_CCflag_0 (TIword iw0
, disassemble_info
*outf
)
1009 struct private *priv
= outf
->private_data
;
1011 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1012 | 0 | 0 | 0 | 0 | 1 |.I.|.opc.......|.G.|.y.........|.x.........|
1013 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1014 int x
= ((iw0
>> CCflag_x_bits
) & CCflag_x_mask
);
1015 int y
= ((iw0
>> CCflag_y_bits
) & CCflag_y_mask
);
1016 int I
= ((iw0
>> CCflag_I_bits
) & CCflag_I_mask
);
1017 int G
= ((iw0
>> CCflag_G_bits
) & CCflag_G_mask
);
1018 int opc
= ((iw0
>> CCflag_opc_bits
) & CCflag_opc_mask
);
1023 if (opc
== 0 && I
== 0 && G
== 0)
1025 OUTS (outf
, "CC = ");
1026 OUTS (outf
, dregs (x
));
1027 OUTS (outf
, " == ");
1028 OUTS (outf
, dregs (y
));
1030 else if (opc
== 1 && I
== 0 && G
== 0)
1032 OUTS (outf
, "CC = ");
1033 OUTS (outf
, dregs (x
));
1035 OUTS (outf
, dregs (y
));
1037 else if (opc
== 2 && I
== 0 && G
== 0)
1039 OUTS (outf
, "CC = ");
1040 OUTS (outf
, dregs (x
));
1041 OUTS (outf
, " <= ");
1042 OUTS (outf
, dregs (y
));
1044 else if (opc
== 3 && I
== 0 && G
== 0)
1046 OUTS (outf
, "CC = ");
1047 OUTS (outf
, dregs (x
));
1049 OUTS (outf
, dregs (y
));
1050 OUTS (outf
, " (IU)");
1052 else if (opc
== 4 && I
== 0 && G
== 0)
1054 OUTS (outf
, "CC = ");
1055 OUTS (outf
, dregs (x
));
1056 OUTS (outf
, " <= ");
1057 OUTS (outf
, dregs (y
));
1058 OUTS (outf
, " (IU)");
1060 else if (opc
== 0 && I
== 1 && G
== 0)
1062 OUTS (outf
, "CC = ");
1063 OUTS (outf
, dregs (x
));
1064 OUTS (outf
, " == ");
1065 OUTS (outf
, imm3 (y
));
1067 else if (opc
== 1 && I
== 1 && G
== 0)
1069 OUTS (outf
, "CC = ");
1070 OUTS (outf
, dregs (x
));
1072 OUTS (outf
, imm3 (y
));
1074 else if (opc
== 2 && I
== 1 && G
== 0)
1076 OUTS (outf
, "CC = ");
1077 OUTS (outf
, dregs (x
));
1078 OUTS (outf
, " <= ");
1079 OUTS (outf
, imm3 (y
));
1081 else if (opc
== 3 && I
== 1 && G
== 0)
1083 OUTS (outf
, "CC = ");
1084 OUTS (outf
, dregs (x
));
1086 OUTS (outf
, uimm3 (y
));
1087 OUTS (outf
, " (IU)");
1089 else if (opc
== 4 && I
== 1 && G
== 0)
1091 OUTS (outf
, "CC = ");
1092 OUTS (outf
, dregs (x
));
1093 OUTS (outf
, " <= ");
1094 OUTS (outf
, uimm3 (y
));
1095 OUTS (outf
, " (IU)");
1097 else if (opc
== 0 && I
== 0 && G
== 1)
1099 OUTS (outf
, "CC = ");
1100 OUTS (outf
, pregs (x
));
1101 OUTS (outf
, " == ");
1102 OUTS (outf
, pregs (y
));
1104 else if (opc
== 1 && I
== 0 && G
== 1)
1106 OUTS (outf
, "CC = ");
1107 OUTS (outf
, pregs (x
));
1109 OUTS (outf
, pregs (y
));
1111 else if (opc
== 2 && I
== 0 && G
== 1)
1113 OUTS (outf
, "CC = ");
1114 OUTS (outf
, pregs (x
));
1115 OUTS (outf
, " <= ");
1116 OUTS (outf
, pregs (y
));
1118 else if (opc
== 3 && I
== 0 && G
== 1)
1120 OUTS (outf
, "CC = ");
1121 OUTS (outf
, pregs (x
));
1123 OUTS (outf
, pregs (y
));
1124 OUTS (outf
, " (IU)");
1126 else if (opc
== 4 && I
== 0 && G
== 1)
1128 OUTS (outf
, "CC = ");
1129 OUTS (outf
, pregs (x
));
1130 OUTS (outf
, " <= ");
1131 OUTS (outf
, pregs (y
));
1132 OUTS (outf
, " (IU)");
1134 else if (opc
== 0 && I
== 1 && G
== 1)
1136 OUTS (outf
, "CC = ");
1137 OUTS (outf
, pregs (x
));
1138 OUTS (outf
, " == ");
1139 OUTS (outf
, imm3 (y
));
1141 else if (opc
== 1 && I
== 1 && G
== 1)
1143 OUTS (outf
, "CC = ");
1144 OUTS (outf
, pregs (x
));
1146 OUTS (outf
, imm3 (y
));
1148 else if (opc
== 2 && I
== 1 && G
== 1)
1150 OUTS (outf
, "CC = ");
1151 OUTS (outf
, pregs (x
));
1152 OUTS (outf
, " <= ");
1153 OUTS (outf
, imm3 (y
));
1155 else if (opc
== 3 && I
== 1 && G
== 1)
1157 OUTS (outf
, "CC = ");
1158 OUTS (outf
, pregs (x
));
1160 OUTS (outf
, uimm3 (y
));
1161 OUTS (outf
, " (IU)");
1163 else if (opc
== 4 && I
== 1 && G
== 1)
1165 OUTS (outf
, "CC = ");
1166 OUTS (outf
, pregs (x
));
1167 OUTS (outf
, " <= ");
1168 OUTS (outf
, uimm3 (y
));
1169 OUTS (outf
, " (IU)");
1171 else if (opc
== 5 && I
== 0 && G
== 0 && x
== 0 && y
== 0)
1172 OUTS (outf
, "CC = A0 == A1");
1174 else if (opc
== 6 && I
== 0 && G
== 0 && x
== 0 && y
== 0)
1175 OUTS (outf
, "CC = A0 < A1");
1177 else if (opc
== 7 && I
== 0 && G
== 0 && x
== 0 && y
== 0)
1178 OUTS (outf
, "CC = A0 <= A1");
1186 decode_CC2dreg_0 (TIword iw0
, disassemble_info
*outf
)
1188 struct private *priv
= outf
->private_data
;
1190 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1191 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |.op....|.reg.......|
1192 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1193 int op
= ((iw0
>> CC2dreg_op_bits
) & CC2dreg_op_mask
);
1194 int reg
= ((iw0
>> CC2dreg_reg_bits
) & CC2dreg_reg_mask
);
1201 OUTS (outf
, dregs (reg
));
1202 OUTS (outf
, " = CC");
1206 OUTS (outf
, "CC = ");
1207 OUTS (outf
, dregs (reg
));
1209 else if (op
== 3 && reg
== 0)
1210 OUTS (outf
, "CC = !CC");
1218 decode_CC2stat_0 (TIword iw0
, disassemble_info
*outf
)
1220 struct private *priv
= outf
->private_data
;
1222 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1223 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |.D.|.op....|.cbit..............|
1224 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1225 int D
= ((iw0
>> CC2stat_D_bits
) & CC2stat_D_mask
);
1226 int op
= ((iw0
>> CC2stat_op_bits
) & CC2stat_op_mask
);
1227 int cbit
= ((iw0
>> CC2stat_cbit_bits
) & CC2stat_cbit_mask
);
1229 const char *bitname
= statbits (cbit
);
1230 const char * const op_names
[] = { "", "|", "&", "^" } ;
1235 if (decode_statbits
[cbit
] == REG_LASTREG
)
1237 /* All ASTAT bits except CC may be operated on in hardware, but may
1238 not have a dedicated insn, so still decode "valid" insns. */
1239 static char bitnames
[64];
1241 sprintf (bitnames
, "ASTAT[%i /* unused bit */]", cbit
);
1249 OUT (outf
, "CC %s= %s", op_names
[op
], bitname
);
1251 OUT (outf
, "%s %s= CC", bitname
, op_names
[op
]);
1257 decode_BRCC_0 (TIword iw0
, bfd_vma pc
, disassemble_info
*outf
)
1259 struct private *priv
= outf
->private_data
;
1261 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1262 | 0 | 0 | 0 | 1 |.T.|.B.|.offset................................|
1263 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1264 int B
= ((iw0
>> BRCC_B_bits
) & BRCC_B_mask
);
1265 int T
= ((iw0
>> BRCC_T_bits
) & BRCC_T_mask
);
1266 int offset
= ((iw0
>> BRCC_offset_bits
) & BRCC_offset_mask
);
1271 if (T
== 1 && B
== 1)
1273 OUTS (outf
, "IF CC JUMP 0x");
1274 OUTS (outf
, pcrel10 (offset
));
1275 OUTS (outf
, " (BP)");
1277 else if (T
== 0 && B
== 1)
1279 OUTS (outf
, "IF !CC JUMP 0x");
1280 OUTS (outf
, pcrel10 (offset
));
1281 OUTS (outf
, " (BP)");
1285 OUTS (outf
, "IF CC JUMP 0x");
1286 OUTS (outf
, pcrel10 (offset
));
1290 OUTS (outf
, "IF !CC JUMP 0x");
1291 OUTS (outf
, pcrel10 (offset
));
1300 decode_UJUMP_0 (TIword iw0
, bfd_vma pc
, disassemble_info
*outf
)
1302 struct private *priv
= outf
->private_data
;
1304 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1305 | 0 | 0 | 1 | 0 |.offset........................................|
1306 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1307 int offset
= ((iw0
>> UJump_offset_bits
) & UJump_offset_mask
);
1312 OUTS (outf
, "JUMP.S 0x");
1313 OUTS (outf
, pcrel12 (offset
));
1318 decode_REGMV_0 (TIword iw0
, disassemble_info
*outf
)
1321 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1322 | 0 | 0 | 1 | 1 |.gd........|.gs........|.dst.......|.src.......|
1323 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1324 int gs
= ((iw0
>> RegMv_gs_bits
) & RegMv_gs_mask
);
1325 int gd
= ((iw0
>> RegMv_gd_bits
) & RegMv_gd_mask
);
1326 int src
= ((iw0
>> RegMv_src_bits
) & RegMv_src_mask
);
1327 int dst
= ((iw0
>> RegMv_dst_bits
) & RegMv_dst_mask
);
1329 /* Reserved slots cannot be a src/dst. */
1330 if (IS_RESERVEDREG (gs
, src
) || IS_RESERVEDREG (gd
, dst
))
1333 /* Standard register moves */
1334 if ((gs
< 2) || /* Dregs/Pregs as source */
1335 (gd
< 2) || /* Dregs/Pregs as dest */
1336 (gs
== 4 && src
< 4) || /* Accumulators as source */
1337 (gd
== 4 && dst
< 4 && (gs
< 4)) || /* Accumulators as dest */
1338 (gs
== 7 && src
== 7 && !(gd
== 4 && dst
< 4)) || /* EMUDAT as src */
1339 (gd
== 7 && dst
== 7)) /* EMUDAT as dest */
1342 /* dareg = dareg (IMBL) */
1343 if (gs
< 4 && gd
< 4)
1346 /* USP can be src to sysregs, but not dagregs. */
1347 if ((gs
== 7 && src
== 0) && (gd
>= 4))
1350 /* USP can move between genregs (only check Accumulators). */
1351 if (((gs
== 7 && src
== 0) && (gd
== 4 && dst
< 4)) ||
1352 ((gd
== 7 && dst
== 0) && (gs
== 4 && src
< 4)))
1355 /* Still here ? Invalid reg pair. */
1360 OUTS (outf
, allregs (dst
, gd
));
1362 OUTS (outf
, allregs (src
, gs
));
1367 decode_ALU2op_0 (TIword iw0
, disassemble_info
*outf
)
1370 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1371 | 0 | 1 | 0 | 0 | 0 | 0 |.opc...........|.src.......|.dst.......|
1372 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1373 int src
= ((iw0
>> ALU2op_src_bits
) & ALU2op_src_mask
);
1374 int opc
= ((iw0
>> ALU2op_opc_bits
) & ALU2op_opc_mask
);
1375 int dst
= ((iw0
>> ALU2op_dst_bits
) & ALU2op_dst_mask
);
1379 OUTS (outf
, dregs (dst
));
1380 OUTS (outf
, " >>>= ");
1381 OUTS (outf
, dregs (src
));
1385 OUTS (outf
, dregs (dst
));
1386 OUTS (outf
, " >>= ");
1387 OUTS (outf
, dregs (src
));
1391 OUTS (outf
, dregs (dst
));
1392 OUTS (outf
, " <<= ");
1393 OUTS (outf
, dregs (src
));
1397 OUTS (outf
, dregs (dst
));
1398 OUTS (outf
, " *= ");
1399 OUTS (outf
, dregs (src
));
1403 OUTS (outf
, dregs (dst
));
1404 OUTS (outf
, " = (");
1405 OUTS (outf
, dregs (dst
));
1407 OUTS (outf
, dregs (src
));
1408 OUTS (outf
, ") << 0x1");
1412 OUTS (outf
, dregs (dst
));
1413 OUTS (outf
, " = (");
1414 OUTS (outf
, dregs (dst
));
1416 OUTS (outf
, dregs (src
));
1417 OUTS (outf
, ") << 0x2");
1421 OUTS (outf
, "DIVQ (");
1422 OUTS (outf
, dregs (dst
));
1424 OUTS (outf
, dregs (src
));
1429 OUTS (outf
, "DIVS (");
1430 OUTS (outf
, dregs (dst
));
1432 OUTS (outf
, dregs (src
));
1437 OUTS (outf
, dregs (dst
));
1439 OUTS (outf
, dregs_lo (src
));
1440 OUTS (outf
, " (X)");
1444 OUTS (outf
, dregs (dst
));
1446 OUTS (outf
, dregs_lo (src
));
1447 OUTS (outf
, " (Z)");
1451 OUTS (outf
, dregs (dst
));
1453 OUTS (outf
, dregs_byte (src
));
1454 OUTS (outf
, " (X)");
1458 OUTS (outf
, dregs (dst
));
1460 OUTS (outf
, dregs_byte (src
));
1461 OUTS (outf
, " (Z)");
1465 OUTS (outf
, dregs (dst
));
1466 OUTS (outf
, " = -");
1467 OUTS (outf
, dregs (src
));
1471 OUTS (outf
, dregs (dst
));
1472 OUTS (outf
, " =~ ");
1473 OUTS (outf
, dregs (src
));
1482 decode_PTR2op_0 (TIword iw0
, disassemble_info
*outf
)
1485 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1486 | 0 | 1 | 0 | 0 | 0 | 1 | 0 |.opc.......|.src.......|.dst.......|
1487 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1488 int src
= ((iw0
>> PTR2op_src_bits
) & PTR2op_dst_mask
);
1489 int opc
= ((iw0
>> PTR2op_opc_bits
) & PTR2op_opc_mask
);
1490 int dst
= ((iw0
>> PTR2op_dst_bits
) & PTR2op_dst_mask
);
1494 OUTS (outf
, pregs (dst
));
1495 OUTS (outf
, " -= ");
1496 OUTS (outf
, pregs (src
));
1500 OUTS (outf
, pregs (dst
));
1502 OUTS (outf
, pregs (src
));
1503 OUTS (outf
, " << 0x2");
1507 OUTS (outf
, pregs (dst
));
1509 OUTS (outf
, pregs (src
));
1510 OUTS (outf
, " >> 0x2");
1514 OUTS (outf
, pregs (dst
));
1516 OUTS (outf
, pregs (src
));
1517 OUTS (outf
, " >> 0x1");
1521 OUTS (outf
, pregs (dst
));
1522 OUTS (outf
, " += ");
1523 OUTS (outf
, pregs (src
));
1524 OUTS (outf
, " (BREV)");
1528 OUTS (outf
, pregs (dst
));
1529 OUTS (outf
, " = (");
1530 OUTS (outf
, pregs (dst
));
1532 OUTS (outf
, pregs (src
));
1533 OUTS (outf
, ") << 0x1");
1537 OUTS (outf
, pregs (dst
));
1538 OUTS (outf
, " = (");
1539 OUTS (outf
, pregs (dst
));
1541 OUTS (outf
, pregs (src
));
1542 OUTS (outf
, ") << 0x2");
1551 decode_LOGI2op_0 (TIword iw0
, disassemble_info
*outf
)
1553 struct private *priv
= outf
->private_data
;
1555 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1556 | 0 | 1 | 0 | 0 | 1 |.opc.......|.src...............|.dst.......|
1557 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1558 int src
= ((iw0
>> LOGI2op_src_bits
) & LOGI2op_src_mask
);
1559 int opc
= ((iw0
>> LOGI2op_opc_bits
) & LOGI2op_opc_mask
);
1560 int dst
= ((iw0
>> LOGI2op_dst_bits
) & LOGI2op_dst_mask
);
1567 OUTS (outf
, "CC = !BITTST (");
1568 OUTS (outf
, dregs (dst
));
1570 OUTS (outf
, uimm5 (src
));
1571 OUTS (outf
, ");\t\t/* bit");
1572 OUTS (outf
, imm7d (src
));
1574 priv
->comment
= TRUE
;
1578 OUTS (outf
, "CC = BITTST (");
1579 OUTS (outf
, dregs (dst
));
1581 OUTS (outf
, uimm5 (src
));
1582 OUTS (outf
, ");\t\t/* bit");
1583 OUTS (outf
, imm7d (src
));
1585 priv
->comment
= TRUE
;
1589 OUTS (outf
, "BITSET (");
1590 OUTS (outf
, dregs (dst
));
1592 OUTS (outf
, uimm5 (src
));
1593 OUTS (outf
, ");\t\t/* bit");
1594 OUTS (outf
, imm7d (src
));
1596 priv
->comment
= TRUE
;
1600 OUTS (outf
, "BITTGL (");
1601 OUTS (outf
, dregs (dst
));
1603 OUTS (outf
, uimm5 (src
));
1604 OUTS (outf
, ");\t\t/* bit");
1605 OUTS (outf
, imm7d (src
));
1607 priv
->comment
= TRUE
;
1611 OUTS (outf
, "BITCLR (");
1612 OUTS (outf
, dregs (dst
));
1614 OUTS (outf
, uimm5 (src
));
1615 OUTS (outf
, ");\t\t/* bit");
1616 OUTS (outf
, imm7d (src
));
1618 priv
->comment
= TRUE
;
1622 OUTS (outf
, dregs (dst
));
1623 OUTS (outf
, " >>>= ");
1624 OUTS (outf
, uimm5 (src
));
1628 OUTS (outf
, dregs (dst
));
1629 OUTS (outf
, " >>= ");
1630 OUTS (outf
, uimm5 (src
));
1634 OUTS (outf
, dregs (dst
));
1635 OUTS (outf
, " <<= ");
1636 OUTS (outf
, uimm5 (src
));
1645 decode_COMP3op_0 (TIword iw0
, disassemble_info
*outf
)
1648 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1649 | 0 | 1 | 0 | 1 |.opc.......|.dst.......|.src1......|.src0......|
1650 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1651 int opc
= ((iw0
>> COMP3op_opc_bits
) & COMP3op_opc_mask
);
1652 int dst
= ((iw0
>> COMP3op_dst_bits
) & COMP3op_dst_mask
);
1653 int src0
= ((iw0
>> COMP3op_src0_bits
) & COMP3op_src0_mask
);
1654 int src1
= ((iw0
>> COMP3op_src1_bits
) & COMP3op_src1_mask
);
1656 if (opc
== 5 && src1
== src0
)
1658 OUTS (outf
, pregs (dst
));
1660 OUTS (outf
, pregs (src0
));
1661 OUTS (outf
, " << 0x1");
1665 OUTS (outf
, dregs (dst
));
1667 OUTS (outf
, dregs (src0
));
1669 OUTS (outf
, dregs (src1
));
1673 OUTS (outf
, dregs (dst
));
1675 OUTS (outf
, dregs (src0
));
1677 OUTS (outf
, dregs (src1
));
1681 OUTS (outf
, dregs (dst
));
1683 OUTS (outf
, dregs (src0
));
1685 OUTS (outf
, dregs (src1
));
1689 OUTS (outf
, dregs (dst
));
1691 OUTS (outf
, dregs (src0
));
1693 OUTS (outf
, dregs (src1
));
1697 OUTS (outf
, pregs (dst
));
1699 OUTS (outf
, pregs (src0
));
1701 OUTS (outf
, pregs (src1
));
1705 OUTS (outf
, pregs (dst
));
1707 OUTS (outf
, pregs (src0
));
1708 OUTS (outf
, " + (");
1709 OUTS (outf
, pregs (src1
));
1710 OUTS (outf
, " << 0x1)");
1714 OUTS (outf
, pregs (dst
));
1716 OUTS (outf
, pregs (src0
));
1717 OUTS (outf
, " + (");
1718 OUTS (outf
, pregs (src1
));
1719 OUTS (outf
, " << 0x2)");
1723 OUTS (outf
, dregs (dst
));
1725 OUTS (outf
, dregs (src0
));
1727 OUTS (outf
, dregs (src1
));
1736 decode_COMPI2opD_0 (TIword iw0
, disassemble_info
*outf
)
1738 struct private *priv
= outf
->private_data
;
1740 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1741 | 0 | 1 | 1 | 0 | 0 |.op|..src......................|.dst.......|
1742 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1743 int op
= ((iw0
>> COMPI2opD_op_bits
) & COMPI2opD_op_mask
);
1744 int dst
= ((iw0
>> COMPI2opD_dst_bits
) & COMPI2opD_dst_mask
);
1745 int src
= ((iw0
>> COMPI2opD_src_bits
) & COMPI2opD_src_mask
);
1747 bu32
*pval
= get_allreg (0, dst
);
1752 /* Since we don't have 32-bit immediate loads, we allow the disassembler
1753 to combine them, so it prints out the right values.
1754 Here we keep track of the registers. */
1757 *pval
= imm7_val (src
);
1759 *pval
|= 0xFFFFFF80;
1766 OUTS (outf
, dregs (dst
));
1768 OUTS (outf
, imm7 (src
));
1769 OUTS (outf
, " (X);\t\t/*\t\t");
1770 OUTS (outf
, dregs (dst
));
1772 OUTS (outf
, uimm32 (*pval
));
1774 OUTS (outf
, imm32 (*pval
));
1775 OUTS (outf
, ") */");
1776 priv
->comment
= TRUE
;
1780 OUTS (outf
, dregs (dst
));
1781 OUTS (outf
, " += ");
1782 OUTS (outf
, imm7 (src
));
1783 OUTS (outf
, ";\t\t/* (");
1784 OUTS (outf
, imm7d (src
));
1785 OUTS (outf
, ") */");
1786 priv
->comment
= TRUE
;
1795 decode_COMPI2opP_0 (TIword iw0
, disassemble_info
*outf
)
1797 struct private *priv
= outf
->private_data
;
1799 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1800 | 0 | 1 | 1 | 0 | 1 |.op|.src.......................|.dst.......|
1801 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1802 int op
= ((iw0
>> COMPI2opP_op_bits
) & COMPI2opP_op_mask
);
1803 int src
= ((iw0
>> COMPI2opP_src_bits
) & COMPI2opP_src_mask
);
1804 int dst
= ((iw0
>> COMPI2opP_dst_bits
) & COMPI2opP_dst_mask
);
1806 bu32
*pval
= get_allreg (1, dst
);
1813 *pval
= imm7_val (src
);
1815 *pval
|= 0xFFFFFF80;
1822 OUTS (outf
, pregs (dst
));
1824 OUTS (outf
, imm7 (src
));
1825 OUTS (outf
, " (X);\t\t/*\t\t");
1826 OUTS (outf
, pregs (dst
));
1828 OUTS (outf
, uimm32 (*pval
));
1830 OUTS (outf
, imm32 (*pval
));
1831 OUTS (outf
, ") */");
1832 priv
->comment
= TRUE
;
1836 OUTS (outf
, pregs (dst
));
1837 OUTS (outf
, " += ");
1838 OUTS (outf
, imm7 (src
));
1839 OUTS (outf
, ";\t\t/* (");
1840 OUTS (outf
, imm7d (src
));
1841 OUTS (outf
, ") */");
1842 priv
->comment
= TRUE
;
1851 decode_LDSTpmod_0 (TIword iw0
, disassemble_info
*outf
)
1854 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1855 | 1 | 0 | 0 | 0 |.W.|.aop...|.reg.......|.idx.......|.ptr.......|
1856 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1857 int W
= ((iw0
>> LDSTpmod_W_bits
) & LDSTpmod_W_mask
);
1858 int aop
= ((iw0
>> LDSTpmod_aop_bits
) & LDSTpmod_aop_mask
);
1859 int idx
= ((iw0
>> LDSTpmod_idx_bits
) & LDSTpmod_idx_mask
);
1860 int ptr
= ((iw0
>> LDSTpmod_ptr_bits
) & LDSTpmod_ptr_mask
);
1861 int reg
= ((iw0
>> LDSTpmod_reg_bits
) & LDSTpmod_reg_mask
);
1863 if (aop
== 1 && W
== 0 && idx
== ptr
)
1865 OUTS (outf
, dregs_lo (reg
));
1866 OUTS (outf
, " = W[");
1867 OUTS (outf
, pregs (ptr
));
1870 else if (aop
== 2 && W
== 0 && idx
== ptr
)
1872 OUTS (outf
, dregs_hi (reg
));
1873 OUTS (outf
, " = W[");
1874 OUTS (outf
, pregs (ptr
));
1877 else if (aop
== 1 && W
== 1 && idx
== ptr
)
1880 OUTS (outf
, pregs (ptr
));
1881 OUTS (outf
, "] = ");
1882 OUTS (outf
, dregs_lo (reg
));
1884 else if (aop
== 2 && W
== 1 && idx
== ptr
)
1887 OUTS (outf
, pregs (ptr
));
1888 OUTS (outf
, "] = ");
1889 OUTS (outf
, dregs_hi (reg
));
1891 else if (aop
== 0 && W
== 0)
1893 OUTS (outf
, dregs (reg
));
1894 OUTS (outf
, " = [");
1895 OUTS (outf
, pregs (ptr
));
1896 OUTS (outf
, " ++ ");
1897 OUTS (outf
, pregs (idx
));
1900 else if (aop
== 1 && W
== 0)
1902 OUTS (outf
, dregs_lo (reg
));
1903 OUTS (outf
, " = W[");
1904 OUTS (outf
, pregs (ptr
));
1905 OUTS (outf
, " ++ ");
1906 OUTS (outf
, pregs (idx
));
1909 else if (aop
== 2 && W
== 0)
1911 OUTS (outf
, dregs_hi (reg
));
1912 OUTS (outf
, " = W[");
1913 OUTS (outf
, pregs (ptr
));
1914 OUTS (outf
, " ++ ");
1915 OUTS (outf
, pregs (idx
));
1918 else if (aop
== 3 && W
== 0)
1920 OUTS (outf
, dregs (reg
));
1921 OUTS (outf
, " = W[");
1922 OUTS (outf
, pregs (ptr
));
1923 OUTS (outf
, " ++ ");
1924 OUTS (outf
, pregs (idx
));
1925 OUTS (outf
, "] (Z)");
1927 else if (aop
== 3 && W
== 1)
1929 OUTS (outf
, dregs (reg
));
1930 OUTS (outf
, " = W[");
1931 OUTS (outf
, pregs (ptr
));
1932 OUTS (outf
, " ++ ");
1933 OUTS (outf
, pregs (idx
));
1934 OUTS (outf
, "] (X)");
1936 else if (aop
== 0 && W
== 1)
1939 OUTS (outf
, pregs (ptr
));
1940 OUTS (outf
, " ++ ");
1941 OUTS (outf
, pregs (idx
));
1942 OUTS (outf
, "] = ");
1943 OUTS (outf
, dregs (reg
));
1945 else if (aop
== 1 && W
== 1)
1948 OUTS (outf
, pregs (ptr
));
1949 OUTS (outf
, " ++ ");
1950 OUTS (outf
, pregs (idx
));
1951 OUTS (outf
, "] = ");
1952 OUTS (outf
, dregs_lo (reg
));
1954 else if (aop
== 2 && W
== 1)
1957 OUTS (outf
, pregs (ptr
));
1958 OUTS (outf
, " ++ ");
1959 OUTS (outf
, pregs (idx
));
1960 OUTS (outf
, "] = ");
1961 OUTS (outf
, dregs_hi (reg
));
1970 decode_dagMODim_0 (TIword iw0
, disassemble_info
*outf
)
1973 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
1974 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 |.br| 1 | 1 |.op|.m.....|.i.....|
1975 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
1976 int i
= ((iw0
>> DagMODim_i_bits
) & DagMODim_i_mask
);
1977 int m
= ((iw0
>> DagMODim_m_bits
) & DagMODim_m_mask
);
1978 int br
= ((iw0
>> DagMODim_br_bits
) & DagMODim_br_mask
);
1979 int op
= ((iw0
>> DagMODim_op_bits
) & DagMODim_op_mask
);
1981 if (op
== 0 && br
== 1)
1983 OUTS (outf
, iregs (i
));
1984 OUTS (outf
, " += ");
1985 OUTS (outf
, mregs (m
));
1986 OUTS (outf
, " (BREV)");
1990 OUTS (outf
, iregs (i
));
1991 OUTS (outf
, " += ");
1992 OUTS (outf
, mregs (m
));
1994 else if (op
== 1 && br
== 0)
1996 OUTS (outf
, iregs (i
));
1997 OUTS (outf
, " -= ");
1998 OUTS (outf
, mregs (m
));
2007 decode_dagMODik_0 (TIword iw0
, disassemble_info
*outf
)
2009 struct private *priv
= outf
->private_data
;
2011 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2012 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 0 |.op....|.i.....|
2013 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2014 int i
= ((iw0
>> DagMODik_i_bits
) & DagMODik_i_mask
);
2015 int op
= ((iw0
>> DagMODik_op_bits
) & DagMODik_op_mask
);
2019 OUTS (outf
, iregs (i
));
2020 OUTS (outf
, " += 0x2");
2024 OUTS (outf
, iregs (i
));
2025 OUTS (outf
, " -= 0x2");
2029 OUTS (outf
, iregs (i
));
2030 OUTS (outf
, " += 0x4");
2034 OUTS (outf
, iregs (i
));
2035 OUTS (outf
, " -= 0x4");
2040 if (!priv
->parallel
)
2042 OUTS (outf
, ";\t\t/* ( ");
2043 if (op
== 0 || op
== 1)
2045 else if (op
== 2 || op
== 3)
2047 OUTS (outf
, ") */");
2048 priv
->comment
= TRUE
;
2055 decode_dspLDST_0 (TIword iw0
, disassemble_info
*outf
)
2058 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2059 | 1 | 0 | 0 | 1 | 1 | 1 |.W.|.aop...|.m.....|.i.....|.reg.......|
2060 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2061 int i
= ((iw0
>> DspLDST_i_bits
) & DspLDST_i_mask
);
2062 int m
= ((iw0
>> DspLDST_m_bits
) & DspLDST_m_mask
);
2063 int W
= ((iw0
>> DspLDST_W_bits
) & DspLDST_W_mask
);
2064 int aop
= ((iw0
>> DspLDST_aop_bits
) & DspLDST_aop_mask
);
2065 int reg
= ((iw0
>> DspLDST_reg_bits
) & DspLDST_reg_mask
);
2067 if (aop
== 0 && W
== 0 && m
== 0)
2069 OUTS (outf
, dregs (reg
));
2070 OUTS (outf
, " = [");
2071 OUTS (outf
, iregs (i
));
2074 else if (aop
== 0 && W
== 0 && m
== 1)
2076 OUTS (outf
, dregs_lo (reg
));
2077 OUTS (outf
, " = W[");
2078 OUTS (outf
, iregs (i
));
2081 else if (aop
== 0 && W
== 0 && m
== 2)
2083 OUTS (outf
, dregs_hi (reg
));
2084 OUTS (outf
, " = W[");
2085 OUTS (outf
, iregs (i
));
2088 else if (aop
== 1 && W
== 0 && m
== 0)
2090 OUTS (outf
, dregs (reg
));
2091 OUTS (outf
, " = [");
2092 OUTS (outf
, iregs (i
));
2095 else if (aop
== 1 && W
== 0 && m
== 1)
2097 OUTS (outf
, dregs_lo (reg
));
2098 OUTS (outf
, " = W[");
2099 OUTS (outf
, iregs (i
));
2102 else if (aop
== 1 && W
== 0 && m
== 2)
2104 OUTS (outf
, dregs_hi (reg
));
2105 OUTS (outf
, " = W[");
2106 OUTS (outf
, iregs (i
));
2109 else if (aop
== 2 && W
== 0 && m
== 0)
2111 OUTS (outf
, dregs (reg
));
2112 OUTS (outf
, " = [");
2113 OUTS (outf
, iregs (i
));
2116 else if (aop
== 2 && W
== 0 && m
== 1)
2118 OUTS (outf
, dregs_lo (reg
));
2119 OUTS (outf
, " = W[");
2120 OUTS (outf
, iregs (i
));
2123 else if (aop
== 2 && W
== 0 && m
== 2)
2125 OUTS (outf
, dregs_hi (reg
));
2126 OUTS (outf
, " = W[");
2127 OUTS (outf
, iregs (i
));
2130 else if (aop
== 0 && W
== 1 && m
== 0)
2133 OUTS (outf
, iregs (i
));
2134 OUTS (outf
, "++] = ");
2135 OUTS (outf
, dregs (reg
));
2137 else if (aop
== 0 && W
== 1 && m
== 1)
2140 OUTS (outf
, iregs (i
));
2141 OUTS (outf
, "++] = ");
2142 OUTS (outf
, dregs_lo (reg
));
2144 else if (aop
== 0 && W
== 1 && m
== 2)
2147 OUTS (outf
, iregs (i
));
2148 OUTS (outf
, "++] = ");
2149 OUTS (outf
, dregs_hi (reg
));
2151 else if (aop
== 1 && W
== 1 && m
== 0)
2154 OUTS (outf
, iregs (i
));
2155 OUTS (outf
, "--] = ");
2156 OUTS (outf
, dregs (reg
));
2158 else if (aop
== 1 && W
== 1 && m
== 1)
2161 OUTS (outf
, iregs (i
));
2162 OUTS (outf
, "--] = ");
2163 OUTS (outf
, dregs_lo (reg
));
2165 else if (aop
== 1 && W
== 1 && m
== 2)
2168 OUTS (outf
, iregs (i
));
2169 OUTS (outf
, "--] = ");
2170 OUTS (outf
, dregs_hi (reg
));
2172 else if (aop
== 2 && W
== 1 && m
== 0)
2175 OUTS (outf
, iregs (i
));
2176 OUTS (outf
, "] = ");
2177 OUTS (outf
, dregs (reg
));
2179 else if (aop
== 2 && W
== 1 && m
== 1)
2182 OUTS (outf
, iregs (i
));
2183 OUTS (outf
, "] = ");
2184 OUTS (outf
, dregs_lo (reg
));
2186 else if (aop
== 2 && W
== 1 && m
== 2)
2189 OUTS (outf
, iregs (i
));
2190 OUTS (outf
, "] = ");
2191 OUTS (outf
, dregs_hi (reg
));
2193 else if (aop
== 3 && W
== 0)
2195 OUTS (outf
, dregs (reg
));
2196 OUTS (outf
, " = [");
2197 OUTS (outf
, iregs (i
));
2198 OUTS (outf
, " ++ ");
2199 OUTS (outf
, mregs (m
));
2202 else if (aop
== 3 && W
== 1)
2205 OUTS (outf
, iregs (i
));
2206 OUTS (outf
, " ++ ");
2207 OUTS (outf
, mregs (m
));
2208 OUTS (outf
, "] = ");
2209 OUTS (outf
, dregs (reg
));
2218 decode_LDST_0 (TIword iw0
, disassemble_info
*outf
)
2221 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2222 | 1 | 0 | 0 | 1 |.sz....|.W.|.aop...|.Z.|.ptr.......|.reg.......|
2223 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2224 int Z
= ((iw0
>> LDST_Z_bits
) & LDST_Z_mask
);
2225 int W
= ((iw0
>> LDST_W_bits
) & LDST_W_mask
);
2226 int sz
= ((iw0
>> LDST_sz_bits
) & LDST_sz_mask
);
2227 int aop
= ((iw0
>> LDST_aop_bits
) & LDST_aop_mask
);
2228 int reg
= ((iw0
>> LDST_reg_bits
) & LDST_reg_mask
);
2229 int ptr
= ((iw0
>> LDST_ptr_bits
) & LDST_ptr_mask
);
2231 if (aop
== 0 && sz
== 0 && Z
== 0 && W
== 0)
2233 OUTS (outf
, dregs (reg
));
2234 OUTS (outf
, " = [");
2235 OUTS (outf
, pregs (ptr
));
2238 else if (aop
== 0 && sz
== 0 && Z
== 1 && W
== 0 && reg
!= ptr
)
2240 OUTS (outf
, pregs (reg
));
2241 OUTS (outf
, " = [");
2242 OUTS (outf
, pregs (ptr
));
2245 else if (aop
== 0 && sz
== 1 && Z
== 0 && W
== 0)
2247 OUTS (outf
, dregs (reg
));
2248 OUTS (outf
, " = W[");
2249 OUTS (outf
, pregs (ptr
));
2250 OUTS (outf
, "++] (Z)");
2252 else if (aop
== 0 && sz
== 1 && Z
== 1 && W
== 0)
2254 OUTS (outf
, dregs (reg
));
2255 OUTS (outf
, " = W[");
2256 OUTS (outf
, pregs (ptr
));
2257 OUTS (outf
, "++] (X)");
2259 else if (aop
== 0 && sz
== 2 && Z
== 0 && W
== 0)
2261 OUTS (outf
, dregs (reg
));
2262 OUTS (outf
, " = B[");
2263 OUTS (outf
, pregs (ptr
));
2264 OUTS (outf
, "++] (Z)");
2266 else if (aop
== 0 && sz
== 2 && Z
== 1 && W
== 0)
2268 OUTS (outf
, dregs (reg
));
2269 OUTS (outf
, " = B[");
2270 OUTS (outf
, pregs (ptr
));
2271 OUTS (outf
, "++] (X)");
2273 else if (aop
== 1 && sz
== 0 && Z
== 0 && W
== 0)
2275 OUTS (outf
, dregs (reg
));
2276 OUTS (outf
, " = [");
2277 OUTS (outf
, pregs (ptr
));
2280 else if (aop
== 1 && sz
== 0 && Z
== 1 && W
== 0 && reg
!= ptr
)
2282 OUTS (outf
, pregs (reg
));
2283 OUTS (outf
, " = [");
2284 OUTS (outf
, pregs (ptr
));
2287 else if (aop
== 1 && sz
== 1 && Z
== 0 && W
== 0)
2289 OUTS (outf
, dregs (reg
));
2290 OUTS (outf
, " = W[");
2291 OUTS (outf
, pregs (ptr
));
2292 OUTS (outf
, "--] (Z)");
2294 else if (aop
== 1 && sz
== 1 && Z
== 1 && W
== 0)
2296 OUTS (outf
, dregs (reg
));
2297 OUTS (outf
, " = W[");
2298 OUTS (outf
, pregs (ptr
));
2299 OUTS (outf
, "--] (X)");
2301 else if (aop
== 1 && sz
== 2 && Z
== 0 && W
== 0)
2303 OUTS (outf
, dregs (reg
));
2304 OUTS (outf
, " = B[");
2305 OUTS (outf
, pregs (ptr
));
2306 OUTS (outf
, "--] (Z)");
2308 else if (aop
== 1 && sz
== 2 && Z
== 1 && W
== 0)
2310 OUTS (outf
, dregs (reg
));
2311 OUTS (outf
, " = B[");
2312 OUTS (outf
, pregs (ptr
));
2313 OUTS (outf
, "--] (X)");
2315 else if (aop
== 2 && sz
== 0 && Z
== 0 && W
== 0)
2317 OUTS (outf
, dregs (reg
));
2318 OUTS (outf
, " = [");
2319 OUTS (outf
, pregs (ptr
));
2322 else if (aop
== 2 && sz
== 0 && Z
== 1 && W
== 0)
2324 OUTS (outf
, pregs (reg
));
2325 OUTS (outf
, " = [");
2326 OUTS (outf
, pregs (ptr
));
2329 else if (aop
== 2 && sz
== 1 && Z
== 0 && W
== 0)
2331 OUTS (outf
, dregs (reg
));
2332 OUTS (outf
, " = W[");
2333 OUTS (outf
, pregs (ptr
));
2334 OUTS (outf
, "] (Z)");
2336 else if (aop
== 2 && sz
== 1 && Z
== 1 && W
== 0)
2338 OUTS (outf
, dregs (reg
));
2339 OUTS (outf
, " = W[");
2340 OUTS (outf
, pregs (ptr
));
2341 OUTS (outf
, "] (X)");
2343 else if (aop
== 2 && sz
== 2 && Z
== 0 && W
== 0)
2345 OUTS (outf
, dregs (reg
));
2346 OUTS (outf
, " = B[");
2347 OUTS (outf
, pregs (ptr
));
2348 OUTS (outf
, "] (Z)");
2350 else if (aop
== 2 && sz
== 2 && Z
== 1 && W
== 0)
2352 OUTS (outf
, dregs (reg
));
2353 OUTS (outf
, " = B[");
2354 OUTS (outf
, pregs (ptr
));
2355 OUTS (outf
, "] (X)");
2357 else if (aop
== 0 && sz
== 0 && Z
== 0 && W
== 1)
2360 OUTS (outf
, pregs (ptr
));
2361 OUTS (outf
, "++] = ");
2362 OUTS (outf
, dregs (reg
));
2364 else if (aop
== 0 && sz
== 0 && Z
== 1 && W
== 1)
2367 OUTS (outf
, pregs (ptr
));
2368 OUTS (outf
, "++] = ");
2369 OUTS (outf
, pregs (reg
));
2371 else if (aop
== 0 && sz
== 1 && Z
== 0 && W
== 1)
2374 OUTS (outf
, pregs (ptr
));
2375 OUTS (outf
, "++] = ");
2376 OUTS (outf
, dregs (reg
));
2378 else if (aop
== 0 && sz
== 2 && Z
== 0 && W
== 1)
2381 OUTS (outf
, pregs (ptr
));
2382 OUTS (outf
, "++] = ");
2383 OUTS (outf
, dregs (reg
));
2385 else if (aop
== 1 && sz
== 0 && Z
== 0 && W
== 1)
2388 OUTS (outf
, pregs (ptr
));
2389 OUTS (outf
, "--] = ");
2390 OUTS (outf
, dregs (reg
));
2392 else if (aop
== 1 && sz
== 0 && Z
== 1 && W
== 1)
2395 OUTS (outf
, pregs (ptr
));
2396 OUTS (outf
, "--] = ");
2397 OUTS (outf
, pregs (reg
));
2399 else if (aop
== 1 && sz
== 1 && Z
== 0 && W
== 1)
2402 OUTS (outf
, pregs (ptr
));
2403 OUTS (outf
, "--] = ");
2404 OUTS (outf
, dregs (reg
));
2406 else if (aop
== 1 && sz
== 2 && Z
== 0 && W
== 1)
2409 OUTS (outf
, pregs (ptr
));
2410 OUTS (outf
, "--] = ");
2411 OUTS (outf
, dregs (reg
));
2413 else if (aop
== 2 && sz
== 0 && Z
== 0 && W
== 1)
2416 OUTS (outf
, pregs (ptr
));
2417 OUTS (outf
, "] = ");
2418 OUTS (outf
, dregs (reg
));
2420 else if (aop
== 2 && sz
== 0 && Z
== 1 && W
== 1)
2423 OUTS (outf
, pregs (ptr
));
2424 OUTS (outf
, "] = ");
2425 OUTS (outf
, pregs (reg
));
2427 else if (aop
== 2 && sz
== 1 && Z
== 0 && W
== 1)
2430 OUTS (outf
, pregs (ptr
));
2431 OUTS (outf
, "] = ");
2432 OUTS (outf
, dregs (reg
));
2434 else if (aop
== 2 && sz
== 2 && Z
== 0 && W
== 1)
2437 OUTS (outf
, pregs (ptr
));
2438 OUTS (outf
, "] = ");
2439 OUTS (outf
, dregs (reg
));
2448 decode_LDSTiiFP_0 (TIword iw0
, disassemble_info
*outf
)
2451 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2452 | 1 | 0 | 1 | 1 | 1 | 0 |.W.|.offset............|.reg...........|
2453 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2454 int reg
= ((iw0
>> LDSTiiFP_reg_bits
) & LDSTiiFP_reg_mask
);
2455 int offset
= ((iw0
>> LDSTiiFP_offset_bits
) & LDSTiiFP_offset_mask
);
2456 int W
= ((iw0
>> LDSTiiFP_W_bits
) & LDSTiiFP_W_mask
);
2460 OUTS (outf
, dpregs (reg
));
2461 OUTS (outf
, " = [FP ");
2462 OUTS (outf
, negimm5s4 (offset
));
2467 OUTS (outf
, "[FP ");
2468 OUTS (outf
, negimm5s4 (offset
));
2469 OUTS (outf
, "] = ");
2470 OUTS (outf
, dpregs (reg
));
2479 decode_LDSTii_0 (TIword iw0
, disassemble_info
*outf
)
2482 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2483 | 1 | 0 | 1 |.W.|.op....|.offset........|.ptr.......|.reg.......|
2484 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2485 int reg
= ((iw0
>> LDSTii_reg_bit
) & LDSTii_reg_mask
);
2486 int ptr
= ((iw0
>> LDSTii_ptr_bit
) & LDSTii_ptr_mask
);
2487 int offset
= ((iw0
>> LDSTii_offset_bit
) & LDSTii_offset_mask
);
2488 int op
= ((iw0
>> LDSTii_op_bit
) & LDSTii_op_mask
);
2489 int W
= ((iw0
>> LDSTii_W_bit
) & LDSTii_W_mask
);
2491 if (W
== 0 && op
== 0)
2493 OUTS (outf
, dregs (reg
));
2494 OUTS (outf
, " = [");
2495 OUTS (outf
, pregs (ptr
));
2497 OUTS (outf
, uimm4s4 (offset
));
2500 else if (W
== 0 && op
== 1)
2502 OUTS (outf
, dregs (reg
));
2503 OUTS (outf
, " = W[");
2504 OUTS (outf
, pregs (ptr
));
2506 OUTS (outf
, uimm4s2 (offset
));
2507 OUTS (outf
, "] (Z)");
2509 else if (W
== 0 && op
== 2)
2511 OUTS (outf
, dregs (reg
));
2512 OUTS (outf
, " = W[");
2513 OUTS (outf
, pregs (ptr
));
2515 OUTS (outf
, uimm4s2 (offset
));
2516 OUTS (outf
, "] (X)");
2518 else if (W
== 0 && op
== 3)
2520 OUTS (outf
, pregs (reg
));
2521 OUTS (outf
, " = [");
2522 OUTS (outf
, pregs (ptr
));
2524 OUTS (outf
, uimm4s4 (offset
));
2527 else if (W
== 1 && op
== 0)
2530 OUTS (outf
, pregs (ptr
));
2532 OUTS (outf
, uimm4s4 (offset
));
2533 OUTS (outf
, "] = ");
2534 OUTS (outf
, dregs (reg
));
2536 else if (W
== 1 && op
== 1)
2539 OUTS (outf
, pregs (ptr
));
2541 OUTS (outf
, uimm4s2 (offset
));
2542 OUTS (outf
, "] = ");
2543 OUTS (outf
, dregs (reg
));
2545 else if (W
== 1 && op
== 3)
2548 OUTS (outf
, pregs (ptr
));
2550 OUTS (outf
, uimm4s4 (offset
));
2551 OUTS (outf
, "] = ");
2552 OUTS (outf
, pregs (reg
));
2561 decode_LoopSetup_0 (TIword iw0
, TIword iw1
, bfd_vma pc
, disassemble_info
*outf
)
2563 struct private *priv
= outf
->private_data
;
2565 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2566 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 |.rop...|.c.|.soffset.......|
2567 |.reg...........| - | - |.eoffset...............................|
2568 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2569 int c
= ((iw0
>> (LoopSetup_c_bits
- 16)) & LoopSetup_c_mask
);
2570 int reg
= ((iw1
>> LoopSetup_reg_bits
) & LoopSetup_reg_mask
);
2571 int rop
= ((iw0
>> (LoopSetup_rop_bits
- 16)) & LoopSetup_rop_mask
);
2572 int soffset
= ((iw0
>> (LoopSetup_soffset_bits
- 16)) & LoopSetup_soffset_mask
);
2573 int eoffset
= ((iw1
>> LoopSetup_eoffset_bits
) & LoopSetup_eoffset_mask
);
2583 OUTS (outf
, "LSETUP");
2585 OUTS (outf
, pcrel4 (soffset
));
2586 OUTS (outf
, ", 0x");
2587 OUTS (outf
, lppcrel10 (eoffset
));
2589 OUTS (outf
, counters (c
));
2593 OUTS (outf
, "LSETUP");
2595 OUTS (outf
, pcrel4 (soffset
));
2596 OUTS (outf
, ", 0x");
2597 OUTS (outf
, lppcrel10 (eoffset
));
2599 OUTS (outf
, counters (c
));
2601 OUTS (outf
, pregs (reg
));
2605 OUTS (outf
, "LSETUP");
2607 OUTS (outf
, pcrel4 (soffset
));
2608 OUTS (outf
, ", 0x");
2609 OUTS (outf
, lppcrel10 (eoffset
));
2611 OUTS (outf
, counters (c
));
2613 OUTS (outf
, pregs (reg
));
2614 OUTS (outf
, " >> 0x1");
2623 decode_LDIMMhalf_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2625 struct private *priv
= outf
->private_data
;
2627 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2628 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 |.Z.|.H.|.S.|.grp...|.reg.......|
2629 |.hword.........................................................|
2630 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2631 int H
= ((iw0
>> (LDIMMhalf_H_bits
- 16)) & LDIMMhalf_H_mask
);
2632 int Z
= ((iw0
>> (LDIMMhalf_Z_bits
- 16)) & LDIMMhalf_Z_mask
);
2633 int S
= ((iw0
>> (LDIMMhalf_S_bits
- 16)) & LDIMMhalf_S_mask
);
2634 int reg
= ((iw0
>> (LDIMMhalf_reg_bits
- 16)) & LDIMMhalf_reg_mask
);
2635 int grp
= ((iw0
>> (LDIMMhalf_grp_bits
- 16)) & LDIMMhalf_grp_mask
);
2636 int hword
= ((iw1
>> LDIMMhalf_hword_bits
) & LDIMMhalf_hword_mask
);
2638 bu32
*pval
= get_allreg (grp
, reg
);
2643 /* Since we don't have 32-bit immediate loads, we allow the disassembler
2644 to combine them, so it prints out the right values.
2645 Here we keep track of the registers. */
2646 if (H
== 0 && S
== 1 && Z
== 0)
2648 /* regs = imm16 (x) */
2649 *pval
= imm16_val (hword
);
2651 *pval
|= 0xFFFF0000;
2655 else if (H
== 0 && S
== 0 && Z
== 1)
2657 /* regs = luimm16 (Z) */
2658 *pval
= luimm16_val (hword
);
2661 else if (H
== 0 && S
== 0 && Z
== 0)
2663 /* regs_lo = luimm16 */
2664 *pval
&= 0xFFFF0000;
2665 *pval
|= luimm16_val (hword
);
2667 else if (H
== 1 && S
== 0 && Z
== 0)
2669 /* regs_hi = huimm16 */
2671 *pval
|= luimm16_val (hword
) << 16;
2674 /* Here we do the disassembly */
2675 if (grp
== 0 && H
== 0 && S
== 0 && Z
== 0)
2677 OUTS (outf
, dregs_lo (reg
));
2679 OUTS (outf
, uimm16 (hword
));
2681 else if (grp
== 0 && H
== 1 && S
== 0 && Z
== 0)
2683 OUTS (outf
, dregs_hi (reg
));
2685 OUTS (outf
, uimm16 (hword
));
2687 else if (grp
== 0 && H
== 0 && S
== 1 && Z
== 0)
2689 OUTS (outf
, dregs (reg
));
2691 OUTS (outf
, imm16 (hword
));
2692 OUTS (outf
, " (X)");
2694 else if (H
== 0 && S
== 1 && Z
== 0)
2696 OUTS (outf
, regs (reg
, grp
));
2698 OUTS (outf
, imm16 (hword
));
2699 OUTS (outf
, " (X)");
2701 else if (H
== 0 && S
== 0 && Z
== 1)
2703 OUTS (outf
, regs (reg
, grp
));
2705 OUTS (outf
, uimm16 (hword
));
2706 OUTS (outf
, " (Z)");
2708 else if (H
== 0 && S
== 0 && Z
== 0)
2710 OUTS (outf
, regs_lo (reg
, grp
));
2712 OUTS (outf
, uimm16 (hword
));
2714 else if (H
== 1 && S
== 0 && Z
== 0)
2716 OUTS (outf
, regs_hi (reg
, grp
));
2718 OUTS (outf
, uimm16 (hword
));
2723 /* And we print out the 32-bit value if it is a pointer. */
2724 if (S
== 0 && Z
== 0)
2726 OUTS (outf
, ";\t\t/* (");
2727 OUTS (outf
, imm16d (hword
));
2730 /* If it is an MMR, don't print the symbol. */
2731 if (*pval
< 0xFFC00000 && grp
== 1)
2733 OUTS (outf
, regs (reg
, grp
));
2735 OUTS (outf
, huimm32e (*pval
));
2739 OUTS (outf
, regs (reg
, grp
));
2741 OUTS (outf
, huimm32e (*pval
));
2743 OUTS (outf
, imm32 (*pval
));
2748 priv
->comment
= TRUE
;
2750 if (S
== 1 || Z
== 1)
2752 OUTS (outf
, ";\t\t/*\t\t");
2753 OUTS (outf
, regs (reg
, grp
));
2755 OUTS (outf
, huimm32e (*pval
));
2757 OUTS (outf
, imm32 (*pval
));
2758 OUTS (outf
, ") */");
2759 priv
->comment
= TRUE
;
2765 decode_CALLa_0 (TIword iw0
, TIword iw1
, bfd_vma pc
, disassemble_info
*outf
)
2767 struct private *priv
= outf
->private_data
;
2769 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2770 | 1 | 1 | 1 | 0 | 0 | 0 | 1 |.S.|.msw...........................|
2771 |.lsw...........................................................|
2772 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2773 int S
= ((iw0
>> (CALLa_S_bits
- 16)) & CALLa_S_mask
);
2774 int lsw
= ((iw1
>> 0) & 0xffff);
2775 int msw
= ((iw0
>> 0) & 0xff);
2781 OUTS (outf
, "CALL 0x");
2783 OUTS (outf
, "JUMP.L 0x");
2787 OUTS (outf
, pcrel24 (((msw
) << 16) | (lsw
)));
2792 decode_LDSTidxI_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2795 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2796 | 1 | 1 | 1 | 0 | 0 | 1 |.W.|.Z.|.sz....|.ptr.......|.reg.......|
2797 |.offset........................................................|
2798 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2799 int Z
= ((iw0
>> (LDSTidxI_Z_bits
- 16)) & LDSTidxI_Z_mask
);
2800 int W
= ((iw0
>> (LDSTidxI_W_bits
- 16)) & LDSTidxI_W_mask
);
2801 int sz
= ((iw0
>> (LDSTidxI_sz_bits
- 16)) & LDSTidxI_sz_mask
);
2802 int reg
= ((iw0
>> (LDSTidxI_reg_bits
- 16)) & LDSTidxI_reg_mask
);
2803 int ptr
= ((iw0
>> (LDSTidxI_ptr_bits
- 16)) & LDSTidxI_ptr_mask
);
2804 int offset
= ((iw1
>> LDSTidxI_offset_bits
) & LDSTidxI_offset_mask
);
2806 if (W
== 0 && sz
== 0 && Z
== 0)
2808 OUTS (outf
, dregs (reg
));
2809 OUTS (outf
, " = [");
2810 OUTS (outf
, pregs (ptr
));
2812 OUTS (outf
, imm16s4 (offset
));
2815 else if (W
== 0 && sz
== 0 && Z
== 1)
2817 OUTS (outf
, pregs (reg
));
2818 OUTS (outf
, " = [");
2819 OUTS (outf
, pregs (ptr
));
2821 OUTS (outf
, imm16s4 (offset
));
2824 else if (W
== 0 && sz
== 1 && Z
== 0)
2826 OUTS (outf
, dregs (reg
));
2827 OUTS (outf
, " = W[");
2828 OUTS (outf
, pregs (ptr
));
2830 OUTS (outf
, imm16s2 (offset
));
2831 OUTS (outf
, "] (Z)");
2833 else if (W
== 0 && sz
== 1 && Z
== 1)
2835 OUTS (outf
, dregs (reg
));
2836 OUTS (outf
, " = W[");
2837 OUTS (outf
, pregs (ptr
));
2839 OUTS (outf
, imm16s2 (offset
));
2840 OUTS (outf
, "] (X)");
2842 else if (W
== 0 && sz
== 2 && Z
== 0)
2844 OUTS (outf
, dregs (reg
));
2845 OUTS (outf
, " = B[");
2846 OUTS (outf
, pregs (ptr
));
2848 OUTS (outf
, imm16 (offset
));
2849 OUTS (outf
, "] (Z)");
2851 else if (W
== 0 && sz
== 2 && Z
== 1)
2853 OUTS (outf
, dregs (reg
));
2854 OUTS (outf
, " = B[");
2855 OUTS (outf
, pregs (ptr
));
2857 OUTS (outf
, imm16 (offset
));
2858 OUTS (outf
, "] (X)");
2860 else if (W
== 1 && sz
== 0 && Z
== 0)
2863 OUTS (outf
, pregs (ptr
));
2865 OUTS (outf
, imm16s4 (offset
));
2866 OUTS (outf
, "] = ");
2867 OUTS (outf
, dregs (reg
));
2869 else if (W
== 1 && sz
== 0 && Z
== 1)
2872 OUTS (outf
, pregs (ptr
));
2874 OUTS (outf
, imm16s4 (offset
));
2875 OUTS (outf
, "] = ");
2876 OUTS (outf
, pregs (reg
));
2878 else if (W
== 1 && sz
== 1 && Z
== 0)
2881 OUTS (outf
, pregs (ptr
));
2883 OUTS (outf
, imm16s2 (offset
));
2884 OUTS (outf
, "] = ");
2885 OUTS (outf
, dregs (reg
));
2887 else if (W
== 1 && sz
== 2 && Z
== 0)
2890 OUTS (outf
, pregs (ptr
));
2892 OUTS (outf
, imm16 (offset
));
2893 OUTS (outf
, "] = ");
2894 OUTS (outf
, dregs (reg
));
2903 decode_linkage_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2905 struct private *priv
= outf
->private_data
;
2907 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2908 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |.R.|
2909 |.framesize.....................................................|
2910 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2911 int R
= ((iw0
>> (Linkage_R_bits
- 16)) & Linkage_R_mask
);
2912 int framesize
= ((iw1
>> Linkage_framesize_bits
) & Linkage_framesize_mask
);
2919 OUTS (outf
, "LINK ");
2920 OUTS (outf
, uimm16s4 (framesize
));
2921 OUTS (outf
, ";\t\t/* (");
2922 OUTS (outf
, uimm16s4d (framesize
));
2923 OUTS (outf
, ") */");
2924 priv
->comment
= TRUE
;
2927 OUTS (outf
, "UNLINK");
2935 decode_dsp32mac_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
2938 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
2939 | 1 | 1 | 0 | 0 |.M.| 0 | 0 |.mmod..........|.MM|.P.|.w1|.op1...|
2940 |.h01|.h11|.w0|.op0...|.h00|.h10|.dst.......|.src0......|.src1..|
2941 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
2942 int op1
= ((iw0
>> (DSP32Mac_op1_bits
- 16)) & DSP32Mac_op1_mask
);
2943 int w1
= ((iw0
>> (DSP32Mac_w1_bits
- 16)) & DSP32Mac_w1_mask
);
2944 int P
= ((iw0
>> (DSP32Mac_p_bits
- 16)) & DSP32Mac_p_mask
);
2945 int MM
= ((iw0
>> (DSP32Mac_MM_bits
- 16)) & DSP32Mac_MM_mask
);
2946 int mmod
= ((iw0
>> (DSP32Mac_mmod_bits
- 16)) & DSP32Mac_mmod_mask
);
2947 int w0
= ((iw1
>> DSP32Mac_w0_bits
) & DSP32Mac_w0_mask
);
2948 int src0
= ((iw1
>> DSP32Mac_src0_bits
) & DSP32Mac_src0_mask
);
2949 int src1
= ((iw1
>> DSP32Mac_src1_bits
) & DSP32Mac_src1_mask
);
2950 int dst
= ((iw1
>> DSP32Mac_dst_bits
) & DSP32Mac_dst_mask
);
2951 int h10
= ((iw1
>> DSP32Mac_h10_bits
) & DSP32Mac_h10_mask
);
2952 int h00
= ((iw1
>> DSP32Mac_h00_bits
) & DSP32Mac_h00_mask
);
2953 int op0
= ((iw1
>> DSP32Mac_op0_bits
) & DSP32Mac_op0_mask
);
2954 int h11
= ((iw1
>> DSP32Mac_h11_bits
) & DSP32Mac_h11_mask
);
2955 int h01
= ((iw1
>> DSP32Mac_h01_bits
) & DSP32Mac_h01_mask
);
2957 if (w0
== 0 && w1
== 0 && op1
== 3 && op0
== 3)
2963 if ((w1
|| w0
) && mmod
== M_W32
)
2966 if (((1 << mmod
) & (P
? 0x131b : 0x1b5f)) == 0)
2969 if (w1
== 1 || op1
!= 3)
2972 OUTS (outf
, P
? dregs (dst
+ 1) : dregs_hi (dst
));
2975 OUTS (outf
, " = A1");
2979 OUTS (outf
, " = (");
2980 decode_macfunc (1, op1
, h01
, h11
, src0
, src1
, outf
);
2985 if (w0
== 1 || op0
!= 3)
2988 OUTS (outf
, " (M)");
2993 if (w0
== 1 || op0
!= 3)
2995 /* Clear MM option since it only matters for MAC1, and if we made
2996 it this far, we've already shown it or we want to ignore it. */
3000 OUTS (outf
, P
? dregs (dst
) : dregs_lo (dst
));
3003 OUTS (outf
, " = A0");
3007 OUTS (outf
, " = (");
3008 decode_macfunc (0, op0
, h00
, h10
, src0
, src1
, outf
);
3014 decode_optmode (mmod
, MM
, outf
);
3020 decode_dsp32mult_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
3023 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
3024 | 1 | 1 | 0 | 0 |.M.| 0 | 1 |.mmod..........|.MM|.P.|.w1|.op1...|
3025 |.h01|.h11|.w0|.op0...|.h00|.h10|.dst.......|.src0......|.src1..|
3026 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
3027 int w1
= ((iw0
>> (DSP32Mac_w1_bits
- 16)) & DSP32Mac_w1_mask
);
3028 int P
= ((iw0
>> (DSP32Mac_p_bits
- 16)) & DSP32Mac_p_mask
);
3029 int MM
= ((iw0
>> (DSP32Mac_MM_bits
- 16)) & DSP32Mac_MM_mask
);
3030 int mmod
= ((iw0
>> (DSP32Mac_mmod_bits
- 16)) & DSP32Mac_mmod_mask
);
3031 int w0
= ((iw1
>> DSP32Mac_w0_bits
) & DSP32Mac_w0_mask
);
3032 int src0
= ((iw1
>> DSP32Mac_src0_bits
) & DSP32Mac_src0_mask
);
3033 int src1
= ((iw1
>> DSP32Mac_src1_bits
) & DSP32Mac_src1_mask
);
3034 int dst
= ((iw1
>> DSP32Mac_dst_bits
) & DSP32Mac_dst_mask
);
3035 int h10
= ((iw1
>> DSP32Mac_h10_bits
) & DSP32Mac_h10_mask
);
3036 int h00
= ((iw1
>> DSP32Mac_h00_bits
) & DSP32Mac_h00_mask
);
3037 int h11
= ((iw1
>> DSP32Mac_h11_bits
) & DSP32Mac_h11_mask
);
3038 int h01
= ((iw1
>> DSP32Mac_h01_bits
) & DSP32Mac_h01_mask
);
3040 if (w1
== 0 && w0
== 0)
3043 if (((1 << mmod
) & (P
? 0x313 : 0x1b57)) == 0)
3048 OUTS (outf
, P
? dregs (dst
+ 1) : dregs_hi (dst
));
3050 decode_multfunc (h01
, h11
, src0
, src1
, outf
);
3055 OUTS (outf
, " (M)");
3063 OUTS (outf
, P
? dregs (dst
) : dregs_lo (dst
));
3065 decode_multfunc (h00
, h10
, src0
, src1
, outf
);
3068 decode_optmode (mmod
, MM
, outf
);
3073 decode_dsp32alu_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
3076 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
3077 | 1 | 1 | 0 | 0 |.M.| 1 | 0 | - | - | - |.HL|.aopcde............|
3078 |.aop...|.s.|.x.|.dst0......|.dst1......|.src0......|.src1......|
3079 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
3080 int s
= ((iw1
>> DSP32Alu_s_bits
) & DSP32Alu_s_mask
);
3081 int x
= ((iw1
>> DSP32Alu_x_bits
) & DSP32Alu_x_mask
);
3082 int aop
= ((iw1
>> DSP32Alu_aop_bits
) & DSP32Alu_aop_mask
);
3083 int src0
= ((iw1
>> DSP32Alu_src0_bits
) & DSP32Alu_src0_mask
);
3084 int src1
= ((iw1
>> DSP32Alu_src1_bits
) & DSP32Alu_src1_mask
);
3085 int dst0
= ((iw1
>> DSP32Alu_dst0_bits
) & DSP32Alu_dst0_mask
);
3086 int dst1
= ((iw1
>> DSP32Alu_dst1_bits
) & DSP32Alu_dst1_mask
);
3087 int HL
= ((iw0
>> (DSP32Alu_HL_bits
- 16)) & DSP32Alu_HL_mask
);
3088 int aopcde
= ((iw0
>> (DSP32Alu_aopcde_bits
- 16)) & DSP32Alu_aopcde_mask
);
3090 if (aop
== 0 && aopcde
== 9 && HL
== 0 && s
== 0)
3092 OUTS (outf
, "A0.L = ");
3093 OUTS (outf
, dregs_lo (src0
));
3095 else if (aop
== 2 && aopcde
== 9 && HL
== 1 && s
== 0)
3097 OUTS (outf
, "A1.H = ");
3098 OUTS (outf
, dregs_hi (src0
));
3100 else if (aop
== 2 && aopcde
== 9 && HL
== 0 && s
== 0)
3102 OUTS (outf
, "A1.L = ");
3103 OUTS (outf
, dregs_lo (src0
));
3105 else if (aop
== 0 && aopcde
== 9 && HL
== 1 && s
== 0)
3107 OUTS (outf
, "A0.H = ");
3108 OUTS (outf
, dregs_hi (src0
));
3110 else if (x
== 1 && HL
== 1 && aop
== 3 && aopcde
== 5)
3112 OUTS (outf
, dregs_hi (dst0
));
3114 OUTS (outf
, dregs (src0
));
3116 OUTS (outf
, dregs (src1
));
3117 OUTS (outf
, " (RND20)");
3119 else if (x
== 1 && HL
== 1 && aop
== 2 && aopcde
== 5)
3121 OUTS (outf
, dregs_hi (dst0
));
3123 OUTS (outf
, dregs (src0
));
3125 OUTS (outf
, dregs (src1
));
3126 OUTS (outf
, " (RND20)");
3128 else if (x
== 0 && HL
== 0 && aop
== 1 && aopcde
== 5)
3130 OUTS (outf
, dregs_lo (dst0
));
3132 OUTS (outf
, dregs (src0
));
3134 OUTS (outf
, dregs (src1
));
3135 OUTS (outf
, " (RND12)");
3137 else if (x
== 0 && HL
== 0 && aop
== 0 && aopcde
== 5)
3139 OUTS (outf
, dregs_lo (dst0
));
3141 OUTS (outf
, dregs (src0
));
3143 OUTS (outf
, dregs (src1
));
3144 OUTS (outf
, " (RND12)");
3146 else if (x
== 1 && HL
== 0 && aop
== 3 && aopcde
== 5)
3148 OUTS (outf
, dregs_lo (dst0
));
3150 OUTS (outf
, dregs (src0
));
3152 OUTS (outf
, dregs (src1
));
3153 OUTS (outf
, " (RND20)");
3155 else if (x
== 0 && HL
== 1 && aop
== 0 && aopcde
== 5)
3157 OUTS (outf
, dregs_hi (dst0
));
3159 OUTS (outf
, dregs (src0
));
3161 OUTS (outf
, dregs (src1
));
3162 OUTS (outf
, " (RND12)");
3164 else if (x
== 1 && HL
== 0 && aop
== 2 && aopcde
== 5)
3166 OUTS (outf
, dregs_lo (dst0
));
3168 OUTS (outf
, dregs (src0
));
3170 OUTS (outf
, dregs (src1
));
3171 OUTS (outf
, " (RND20)");
3173 else if (x
== 0 && HL
== 1 && aop
== 1 && aopcde
== 5)
3175 OUTS (outf
, dregs_hi (dst0
));
3177 OUTS (outf
, dregs (src0
));
3179 OUTS (outf
, dregs (src1
));
3180 OUTS (outf
, " (RND12)");
3182 else if (HL
== 1 && aop
== 0 && aopcde
== 2)
3184 OUTS (outf
, dregs_hi (dst0
));
3186 OUTS (outf
, dregs_lo (src0
));
3188 OUTS (outf
, dregs_lo (src1
));
3191 else if (HL
== 1 && aop
== 1 && aopcde
== 2)
3193 OUTS (outf
, dregs_hi (dst0
));
3195 OUTS (outf
, dregs_lo (src0
));
3197 OUTS (outf
, dregs_hi (src1
));
3200 else if (HL
== 1 && aop
== 2 && aopcde
== 2)
3202 OUTS (outf
, dregs_hi (dst0
));
3204 OUTS (outf
, dregs_hi (src0
));
3206 OUTS (outf
, dregs_lo (src1
));
3209 else if (HL
== 1 && aop
== 3 && aopcde
== 2)
3211 OUTS (outf
, dregs_hi (dst0
));
3213 OUTS (outf
, dregs_hi (src0
));
3215 OUTS (outf
, dregs_hi (src1
));
3218 else if (HL
== 0 && aop
== 0 && aopcde
== 3)
3220 OUTS (outf
, dregs_lo (dst0
));
3222 OUTS (outf
, dregs_lo (src0
));
3224 OUTS (outf
, dregs_lo (src1
));
3227 else if (HL
== 0 && aop
== 1 && aopcde
== 3)
3229 OUTS (outf
, dregs_lo (dst0
));
3231 OUTS (outf
, dregs_lo (src0
));
3233 OUTS (outf
, dregs_hi (src1
));
3236 else if (HL
== 0 && aop
== 3 && aopcde
== 2)
3238 OUTS (outf
, dregs_lo (dst0
));
3240 OUTS (outf
, dregs_hi (src0
));
3242 OUTS (outf
, dregs_hi (src1
));
3245 else if (HL
== 1 && aop
== 0 && aopcde
== 3)
3247 OUTS (outf
, dregs_hi (dst0
));
3249 OUTS (outf
, dregs_lo (src0
));
3251 OUTS (outf
, dregs_lo (src1
));
3254 else if (HL
== 1 && aop
== 1 && aopcde
== 3)
3256 OUTS (outf
, dregs_hi (dst0
));
3258 OUTS (outf
, dregs_lo (src0
));
3260 OUTS (outf
, dregs_hi (src1
));
3263 else if (HL
== 1 && aop
== 2 && aopcde
== 3)
3265 OUTS (outf
, dregs_hi (dst0
));
3267 OUTS (outf
, dregs_hi (src0
));
3269 OUTS (outf
, dregs_lo (src1
));
3272 else if (HL
== 1 && aop
== 3 && aopcde
== 3)
3274 OUTS (outf
, dregs_hi (dst0
));
3276 OUTS (outf
, dregs_hi (src0
));
3278 OUTS (outf
, dregs_hi (src1
));
3281 else if (HL
== 0 && aop
== 2 && aopcde
== 2)
3283 OUTS (outf
, dregs_lo (dst0
));
3285 OUTS (outf
, dregs_hi (src0
));
3287 OUTS (outf
, dregs_lo (src1
));
3290 else if (HL
== 0 && aop
== 1 && aopcde
== 2)
3292 OUTS (outf
, dregs_lo (dst0
));
3294 OUTS (outf
, dregs_lo (src0
));
3296 OUTS (outf
, dregs_hi (src1
));
3299 else if (HL
== 0 && aop
== 2 && aopcde
== 3)
3301 OUTS (outf
, dregs_lo (dst0
));
3303 OUTS (outf
, dregs_hi (src0
));
3305 OUTS (outf
, dregs_lo (src1
));
3308 else if (HL
== 0 && aop
== 3 && aopcde
== 3)
3310 OUTS (outf
, dregs_lo (dst0
));
3312 OUTS (outf
, dregs_hi (src0
));
3314 OUTS (outf
, dregs_hi (src1
));
3317 else if (HL
== 0 && aop
== 0 && aopcde
== 2)
3319 OUTS (outf
, dregs_lo (dst0
));
3321 OUTS (outf
, dregs_lo (src0
));
3323 OUTS (outf
, dregs_lo (src1
));
3326 else if (aop
== 0 && aopcde
== 9 && s
== 1)
3328 OUTS (outf
, "A0 = ");
3329 OUTS (outf
, dregs (src0
));
3331 else if (aop
== 3 && aopcde
== 11 && s
== 0)
3332 OUTS (outf
, "A0 -= A1");
3334 else if (aop
== 3 && aopcde
== 11 && s
== 1)
3335 OUTS (outf
, "A0 -= A1 (W32)");
3337 else if (aop
== 1 && aopcde
== 22 && HL
== 1)
3339 OUTS (outf
, dregs (dst0
));
3340 OUTS (outf
, " = BYTEOP2P (");
3341 OUTS (outf
, dregs (src0
+ 1));
3343 OUTS (outf
, imm5d (src0
));
3345 OUTS (outf
, dregs (src1
+ 1));
3347 OUTS (outf
, imm5d (src1
));
3348 OUTS (outf
, ") (TH");
3350 OUTS (outf
, ", R)");
3354 else if (aop
== 1 && aopcde
== 22 && HL
== 0)
3356 OUTS (outf
, dregs (dst0
));
3357 OUTS (outf
, " = BYTEOP2P (");
3358 OUTS (outf
, dregs (src0
+ 1));
3360 OUTS (outf
, imm5d (src0
));
3362 OUTS (outf
, dregs (src1
+ 1));
3364 OUTS (outf
, imm5d (src1
));
3365 OUTS (outf
, ") (TL");
3367 OUTS (outf
, ", R)");
3371 else if (aop
== 0 && aopcde
== 22 && HL
== 1)
3373 OUTS (outf
, dregs (dst0
));
3374 OUTS (outf
, " = BYTEOP2P (");
3375 OUTS (outf
, dregs (src0
+ 1));
3377 OUTS (outf
, imm5d (src0
));
3379 OUTS (outf
, dregs (src1
+ 1));
3381 OUTS (outf
, imm5d (src1
));
3382 OUTS (outf
, ") (RNDH");
3384 OUTS (outf
, ", R)");
3388 else if (aop
== 0 && aopcde
== 22 && HL
== 0)
3390 OUTS (outf
, dregs (dst0
));
3391 OUTS (outf
, " = BYTEOP2P (");
3392 OUTS (outf
, dregs (src0
+ 1));
3394 OUTS (outf
, imm5d (src0
));
3396 OUTS (outf
, dregs (src1
+ 1));
3398 OUTS (outf
, imm5d (src1
));
3399 OUTS (outf
, ") (RNDL");
3401 OUTS (outf
, ", R)");
3405 else if (aop
== 0 && s
== 0 && aopcde
== 8)
3406 OUTS (outf
, "A0 = 0");
3408 else if (aop
== 0 && s
== 1 && aopcde
== 8)
3409 OUTS (outf
, "A0 = A0 (S)");
3411 else if (aop
== 1 && s
== 0 && aopcde
== 8)
3412 OUTS (outf
, "A1 = 0");
3414 else if (aop
== 1 && s
== 1 && aopcde
== 8)
3415 OUTS (outf
, "A1 = A1 (S)");
3417 else if (aop
== 2 && s
== 0 && aopcde
== 8)
3418 OUTS (outf
, "A1 = A0 = 0");
3420 else if (aop
== 2 && s
== 1 && aopcde
== 8)
3421 OUTS (outf
, "A1 = A1 (S), A0 = A0 (S)");
3423 else if (aop
== 3 && s
== 0 && aopcde
== 8)
3424 OUTS (outf
, "A0 = A1");
3426 else if (aop
== 3 && s
== 1 && aopcde
== 8)
3427 OUTS (outf
, "A1 = A0");
3429 else if (aop
== 1 && aopcde
== 9 && s
== 0)
3431 OUTS (outf
, "A0.X = ");
3432 OUTS (outf
, dregs_lo (src0
));
3434 else if (aop
== 1 && HL
== 0 && aopcde
== 11)
3436 OUTS (outf
, dregs_lo (dst0
));
3437 OUTS (outf
, " = (A0 += A1)");
3439 else if (aop
== 3 && HL
== 0 && aopcde
== 16)
3440 OUTS (outf
, "A1 = ABS A1, A0 = ABS A0");
3442 else if (aop
== 0 && aopcde
== 23 && HL
== 1)
3444 OUTS (outf
, dregs (dst0
));
3445 OUTS (outf
, " = BYTEOP3P (");
3446 OUTS (outf
, dregs (src0
+ 1));
3448 OUTS (outf
, imm5d (src0
));
3450 OUTS (outf
, dregs (src1
+ 1));
3452 OUTS (outf
, imm5d (src1
));
3453 OUTS (outf
, ") (HI");
3455 OUTS (outf
, ", R)");
3459 else if (aop
== 3 && aopcde
== 9 && s
== 0)
3461 OUTS (outf
, "A1.X = ");
3462 OUTS (outf
, dregs_lo (src0
));
3464 else if (aop
== 1 && HL
== 1 && aopcde
== 16)
3465 OUTS (outf
, "A1 = ABS A1");
3467 else if (aop
== 0 && HL
== 1 && aopcde
== 16)
3468 OUTS (outf
, "A1 = ABS A0");
3470 else if (aop
== 2 && aopcde
== 9 && s
== 1)
3472 OUTS (outf
, "A1 = ");
3473 OUTS (outf
, dregs (src0
));
3475 else if (HL
== 0 && aop
== 3 && aopcde
== 12)
3477 OUTS (outf
, dregs_lo (dst0
));
3479 OUTS (outf
, dregs (src0
));
3480 OUTS (outf
, " (RND)");
3482 else if (aop
== 1 && HL
== 0 && aopcde
== 16)
3483 OUTS (outf
, "A0 = ABS A1");
3485 else if (aop
== 0 && HL
== 0 && aopcde
== 16)
3486 OUTS (outf
, "A0 = ABS A0");
3488 else if (aop
== 3 && HL
== 0 && aopcde
== 15)
3490 OUTS (outf
, dregs (dst0
));
3491 OUTS (outf
, " = -");
3492 OUTS (outf
, dregs (src0
));
3493 OUTS (outf
, " (V)");
3495 else if (aop
== 3 && s
== 1 && HL
== 0 && aopcde
== 7)
3497 OUTS (outf
, dregs (dst0
));
3498 OUTS (outf
, " = -");
3499 OUTS (outf
, dregs (src0
));
3500 OUTS (outf
, " (S)");
3502 else if (aop
== 3 && s
== 0 && HL
== 0 && aopcde
== 7)
3504 OUTS (outf
, dregs (dst0
));
3505 OUTS (outf
, " = -");
3506 OUTS (outf
, dregs (src0
));
3507 OUTS (outf
, " (NS)");
3509 else if (aop
== 1 && HL
== 1 && aopcde
== 11)
3511 OUTS (outf
, dregs_hi (dst0
));
3512 OUTS (outf
, " = (A0 += A1)");
3514 else if (aop
== 2 && aopcde
== 11 && s
== 0)
3515 OUTS (outf
, "A0 += A1");
3517 else if (aop
== 2 && aopcde
== 11 && s
== 1)
3518 OUTS (outf
, "A0 += A1 (W32)");
3520 else if (aop
== 3 && HL
== 0 && aopcde
== 14)
3521 OUTS (outf
, "A1 = -A1, A0 = -A0");
3523 else if (HL
== 1 && aop
== 3 && aopcde
== 12)
3525 OUTS (outf
, dregs_hi (dst0
));
3527 OUTS (outf
, dregs (src0
));
3528 OUTS (outf
, " (RND)");
3530 else if (aop
== 0 && aopcde
== 23 && HL
== 0)
3532 OUTS (outf
, dregs (dst0
));
3533 OUTS (outf
, " = BYTEOP3P (");
3534 OUTS (outf
, dregs (src0
+ 1));
3536 OUTS (outf
, imm5d (src0
));
3538 OUTS (outf
, dregs (src1
+ 1));
3540 OUTS (outf
, imm5d (src1
));
3541 OUTS (outf
, ") (LO");
3543 OUTS (outf
, ", R)");
3547 else if (aop
== 0 && HL
== 0 && aopcde
== 14)
3548 OUTS (outf
, "A0 = -A0");
3550 else if (aop
== 1 && HL
== 0 && aopcde
== 14)
3551 OUTS (outf
, "A0 = -A1");
3553 else if (aop
== 0 && HL
== 1 && aopcde
== 14)
3554 OUTS (outf
, "A1 = -A0");
3556 else if (aop
== 1 && HL
== 1 && aopcde
== 14)
3557 OUTS (outf
, "A1 = -A1");
3559 else if (aop
== 0 && aopcde
== 12)
3561 OUTS (outf
, dregs_hi (dst0
));
3563 OUTS (outf
, dregs_lo (dst0
));
3564 OUTS (outf
, " = SIGN (");
3565 OUTS (outf
, dregs_hi (src0
));
3566 OUTS (outf
, ") * ");
3567 OUTS (outf
, dregs_hi (src1
));
3568 OUTS (outf
, " + SIGN (");
3569 OUTS (outf
, dregs_lo (src0
));
3570 OUTS (outf
, ") * ");
3571 OUTS (outf
, dregs_lo (src1
));
3573 else if (aop
== 2 && aopcde
== 0)
3575 OUTS (outf
, dregs (dst0
));
3577 OUTS (outf
, dregs (src0
));
3578 OUTS (outf
, " -|+ ");
3579 OUTS (outf
, dregs (src1
));
3582 else if (aop
== 1 && aopcde
== 12)
3584 OUTS (outf
, dregs (dst1
));
3585 OUTS (outf
, " = A1.L + A1.H, ");
3586 OUTS (outf
, dregs (dst0
));
3587 OUTS (outf
, " = A0.L + A0.H");
3589 else if (aop
== 2 && aopcde
== 4)
3591 OUTS (outf
, dregs (dst1
));
3593 OUTS (outf
, dregs (src0
));
3595 OUTS (outf
, dregs (src1
));
3597 OUTS (outf
, dregs (dst0
));
3599 OUTS (outf
, dregs (src0
));
3601 OUTS (outf
, dregs (src1
));
3604 else if (HL
== 0 && aopcde
== 1)
3606 OUTS (outf
, dregs (dst1
));
3608 OUTS (outf
, dregs (src0
));
3609 OUTS (outf
, " +|+ ");
3610 OUTS (outf
, dregs (src1
));
3612 OUTS (outf
, dregs (dst0
));
3614 OUTS (outf
, dregs (src0
));
3615 OUTS (outf
, " -|- ");
3616 OUTS (outf
, dregs (src1
));
3617 amod0amod2 (s
, x
, aop
, outf
);
3619 else if (aop
== 0 && aopcde
== 11)
3621 OUTS (outf
, dregs (dst0
));
3622 OUTS (outf
, " = (A0 += A1)");
3624 else if (aop
== 0 && aopcde
== 10)
3626 OUTS (outf
, dregs_lo (dst0
));
3627 OUTS (outf
, " = A0.X");
3629 else if (aop
== 1 && aopcde
== 10)
3631 OUTS (outf
, dregs_lo (dst0
));
3632 OUTS (outf
, " = A1.X");
3634 else if (aop
== 1 && aopcde
== 0)
3636 OUTS (outf
, dregs (dst0
));
3638 OUTS (outf
, dregs (src0
));
3639 OUTS (outf
, " +|- ");
3640 OUTS (outf
, dregs (src1
));
3643 else if (aop
== 3 && aopcde
== 0)
3645 OUTS (outf
, dregs (dst0
));
3647 OUTS (outf
, dregs (src0
));
3648 OUTS (outf
, " -|- ");
3649 OUTS (outf
, dregs (src1
));
3652 else if (aop
== 1 && aopcde
== 4)
3654 OUTS (outf
, dregs (dst0
));
3656 OUTS (outf
, dregs (src0
));
3658 OUTS (outf
, dregs (src1
));
3661 else if (aop
== 0 && aopcde
== 17)
3663 OUTS (outf
, dregs (dst1
));
3664 OUTS (outf
, " = A1 + A0, ");
3665 OUTS (outf
, dregs (dst0
));
3666 OUTS (outf
, " = A1 - A0");
3669 else if (aop
== 1 && aopcde
== 17)
3671 OUTS (outf
, dregs (dst1
));
3672 OUTS (outf
, " = A0 + A1, ");
3673 OUTS (outf
, dregs (dst0
));
3674 OUTS (outf
, " = A0 - A1");
3677 else if (aop
== 0 && aopcde
== 18)
3679 OUTS (outf
, "SAA (");
3680 OUTS (outf
, dregs (src0
+ 1));
3682 OUTS (outf
, imm5d (src0
));
3684 OUTS (outf
, dregs (src1
+ 1));
3686 OUTS (outf
, imm5d (src1
));
3690 else if (aop
== 3 && aopcde
== 18)
3691 OUTS (outf
, "DISALGNEXCPT");
3693 else if (aop
== 0 && aopcde
== 20)
3695 OUTS (outf
, dregs (dst0
));
3696 OUTS (outf
, " = BYTEOP1P (");
3697 OUTS (outf
, dregs (src0
+ 1));
3699 OUTS (outf
, imm5d (src0
));
3701 OUTS (outf
, dregs (src1
+ 1));
3703 OUTS (outf
, imm5d (src1
));
3707 else if (aop
== 1 && aopcde
== 20)
3709 OUTS (outf
, dregs (dst0
));
3710 OUTS (outf
, " = BYTEOP1P (");
3711 OUTS (outf
, dregs (src0
+ 1));
3713 OUTS (outf
, imm5d (src0
));
3715 OUTS (outf
, dregs (src1
+ 1));
3717 OUTS (outf
, imm5d (src1
));
3718 OUTS (outf
, ") (T");
3720 OUTS (outf
, ", R)");
3724 else if (aop
== 0 && aopcde
== 21)
3727 OUTS (outf
, dregs (dst1
));
3729 OUTS (outf
, dregs (dst0
));
3730 OUTS (outf
, ") = BYTEOP16P (");
3731 OUTS (outf
, dregs (src0
+ 1));
3733 OUTS (outf
, imm5d (src0
));
3735 OUTS (outf
, dregs (src1
+ 1));
3737 OUTS (outf
, imm5d (src1
));
3741 else if (aop
== 1 && aopcde
== 21)
3744 OUTS (outf
, dregs (dst1
));
3746 OUTS (outf
, dregs (dst0
));
3747 OUTS (outf
, ") = BYTEOP16M (");
3748 OUTS (outf
, dregs (src0
+ 1));
3750 OUTS (outf
, imm5d (src0
));
3752 OUTS (outf
, dregs (src1
+ 1));
3754 OUTS (outf
, imm5d (src1
));
3758 else if (aop
== 2 && aopcde
== 7)
3760 OUTS (outf
, dregs (dst0
));
3761 OUTS (outf
, " = ABS ");
3762 OUTS (outf
, dregs (src0
));
3764 else if (aop
== 1 && aopcde
== 7)
3766 OUTS (outf
, dregs (dst0
));
3767 OUTS (outf
, " = MIN (");
3768 OUTS (outf
, dregs (src0
));
3770 OUTS (outf
, dregs (src1
));
3773 else if (aop
== 0 && aopcde
== 7)
3775 OUTS (outf
, dregs (dst0
));
3776 OUTS (outf
, " = MAX (");
3777 OUTS (outf
, dregs (src0
));
3779 OUTS (outf
, dregs (src1
));
3782 else if (aop
== 2 && aopcde
== 6)
3784 OUTS (outf
, dregs (dst0
));
3785 OUTS (outf
, " = ABS ");
3786 OUTS (outf
, dregs (src0
));
3787 OUTS (outf
, " (V)");
3789 else if (aop
== 1 && aopcde
== 6)
3791 OUTS (outf
, dregs (dst0
));
3792 OUTS (outf
, " = MIN (");
3793 OUTS (outf
, dregs (src0
));
3795 OUTS (outf
, dregs (src1
));
3796 OUTS (outf
, ") (V)");
3798 else if (aop
== 0 && aopcde
== 6)
3800 OUTS (outf
, dregs (dst0
));
3801 OUTS (outf
, " = MAX (");
3802 OUTS (outf
, dregs (src0
));
3804 OUTS (outf
, dregs (src1
));
3805 OUTS (outf
, ") (V)");
3807 else if (HL
== 1 && aopcde
== 1)
3809 OUTS (outf
, dregs (dst1
));
3811 OUTS (outf
, dregs (src0
));
3812 OUTS (outf
, " +|- ");
3813 OUTS (outf
, dregs (src1
));
3815 OUTS (outf
, dregs (dst0
));
3817 OUTS (outf
, dregs (src0
));
3818 OUTS (outf
, " -|+ ");
3819 OUTS (outf
, dregs (src1
));
3820 amod0amod2 (s
, x
, aop
, outf
);
3822 else if (aop
== 0 && aopcde
== 4)
3824 OUTS (outf
, dregs (dst0
));
3826 OUTS (outf
, dregs (src0
));
3828 OUTS (outf
, dregs (src1
));
3831 else if (aop
== 0 && aopcde
== 0)
3833 OUTS (outf
, dregs (dst0
));
3835 OUTS (outf
, dregs (src0
));
3836 OUTS (outf
, " +|+ ");
3837 OUTS (outf
, dregs (src1
));
3840 else if (aop
== 0 && aopcde
== 24)
3842 OUTS (outf
, dregs (dst0
));
3843 OUTS (outf
, " = BYTEPACK (");
3844 OUTS (outf
, dregs (src0
));
3846 OUTS (outf
, dregs (src1
));
3849 else if (aop
== 1 && aopcde
== 24)
3852 OUTS (outf
, dregs (dst1
));
3854 OUTS (outf
, dregs (dst0
));
3855 OUTS (outf
, ") = BYTEUNPACK ");
3856 OUTS (outf
, dregs (src0
+ 1));
3858 OUTS (outf
, imm5d (src0
));
3861 else if (aopcde
== 13)
3864 OUTS (outf
, dregs (dst1
));
3866 OUTS (outf
, dregs (dst0
));
3867 OUTS (outf
, ") = SEARCH ");
3868 OUTS (outf
, dregs (src0
));
3870 searchmod (aop
, outf
);
3880 decode_dsp32shift_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
3883 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
3884 | 1 | 1 | 0 | 0 |.M.| 1 | 1 | 0 | 0 | - | - |.sopcde............|
3885 |.sop...|.HLs...|.dst0......| - | - | - |.src0......|.src1......|
3886 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
3887 int HLs
= ((iw1
>> DSP32Shift_HLs_bits
) & DSP32Shift_HLs_mask
);
3888 int sop
= ((iw1
>> DSP32Shift_sop_bits
) & DSP32Shift_sop_mask
);
3889 int src0
= ((iw1
>> DSP32Shift_src0_bits
) & DSP32Shift_src0_mask
);
3890 int src1
= ((iw1
>> DSP32Shift_src1_bits
) & DSP32Shift_src1_mask
);
3891 int dst0
= ((iw1
>> DSP32Shift_dst0_bits
) & DSP32Shift_dst0_mask
);
3892 int sopcde
= ((iw0
>> (DSP32Shift_sopcde_bits
- 16)) & DSP32Shift_sopcde_mask
);
3893 const char *acc01
= (HLs
& 1) == 0 ? "A0" : "A1";
3895 if (HLs
== 0 && sop
== 0 && sopcde
== 0)
3897 OUTS (outf
, dregs_lo (dst0
));
3898 OUTS (outf
, " = ASHIFT ");
3899 OUTS (outf
, dregs_lo (src1
));
3900 OUTS (outf
, " BY ");
3901 OUTS (outf
, dregs_lo (src0
));
3903 else if (HLs
== 1 && sop
== 0 && sopcde
== 0)
3905 OUTS (outf
, dregs_lo (dst0
));
3906 OUTS (outf
, " = ASHIFT ");
3907 OUTS (outf
, dregs_hi (src1
));
3908 OUTS (outf
, " BY ");
3909 OUTS (outf
, dregs_lo (src0
));
3911 else if (HLs
== 2 && sop
== 0 && sopcde
== 0)
3913 OUTS (outf
, dregs_hi (dst0
));
3914 OUTS (outf
, " = ASHIFT ");
3915 OUTS (outf
, dregs_lo (src1
));
3916 OUTS (outf
, " BY ");
3917 OUTS (outf
, dregs_lo (src0
));
3919 else if (HLs
== 3 && sop
== 0 && sopcde
== 0)
3921 OUTS (outf
, dregs_hi (dst0
));
3922 OUTS (outf
, " = ASHIFT ");
3923 OUTS (outf
, dregs_hi (src1
));
3924 OUTS (outf
, " BY ");
3925 OUTS (outf
, dregs_lo (src0
));
3927 else if (HLs
== 0 && sop
== 1 && sopcde
== 0)
3929 OUTS (outf
, dregs_lo (dst0
));
3930 OUTS (outf
, " = ASHIFT ");
3931 OUTS (outf
, dregs_lo (src1
));
3932 OUTS (outf
, " BY ");
3933 OUTS (outf
, dregs_lo (src0
));
3934 OUTS (outf
, " (S)");
3936 else if (HLs
== 1 && sop
== 1 && sopcde
== 0)
3938 OUTS (outf
, dregs_lo (dst0
));
3939 OUTS (outf
, " = ASHIFT ");
3940 OUTS (outf
, dregs_hi (src1
));
3941 OUTS (outf
, " BY ");
3942 OUTS (outf
, dregs_lo (src0
));
3943 OUTS (outf
, " (S)");
3945 else if (HLs
== 2 && sop
== 1 && sopcde
== 0)
3947 OUTS (outf
, dregs_hi (dst0
));
3948 OUTS (outf
, " = ASHIFT ");
3949 OUTS (outf
, dregs_lo (src1
));
3950 OUTS (outf
, " BY ");
3951 OUTS (outf
, dregs_lo (src0
));
3952 OUTS (outf
, " (S)");
3954 else if (HLs
== 3 && sop
== 1 && sopcde
== 0)
3956 OUTS (outf
, dregs_hi (dst0
));
3957 OUTS (outf
, " = ASHIFT ");
3958 OUTS (outf
, dregs_hi (src1
));
3959 OUTS (outf
, " BY ");
3960 OUTS (outf
, dregs_lo (src0
));
3961 OUTS (outf
, " (S)");
3963 else if (sop
== 2 && sopcde
== 0)
3965 OUTS (outf
, (HLs
& 2) == 0 ? dregs_lo (dst0
) : dregs_hi (dst0
));
3966 OUTS (outf
, " = LSHIFT ");
3967 OUTS (outf
, (HLs
& 1) == 0 ? dregs_lo (src1
) : dregs_hi (src1
));
3968 OUTS (outf
, " BY ");
3969 OUTS (outf
, dregs_lo (src0
));
3971 else if (sop
== 0 && sopcde
== 3)
3974 OUTS (outf
, " = ASHIFT ");
3976 OUTS (outf
, " BY ");
3977 OUTS (outf
, dregs_lo (src0
));
3979 else if (sop
== 1 && sopcde
== 3)
3982 OUTS (outf
, " = LSHIFT ");
3984 OUTS (outf
, " BY ");
3985 OUTS (outf
, dregs_lo (src0
));
3987 else if (sop
== 2 && sopcde
== 3)
3990 OUTS (outf
, " = ROT ");
3992 OUTS (outf
, " BY ");
3993 OUTS (outf
, dregs_lo (src0
));
3995 else if (sop
== 3 && sopcde
== 3)
3997 OUTS (outf
, dregs (dst0
));
3998 OUTS (outf
, " = ROT ");
3999 OUTS (outf
, dregs (src1
));
4000 OUTS (outf
, " BY ");
4001 OUTS (outf
, dregs_lo (src0
));
4003 else if (sop
== 1 && sopcde
== 1)
4005 OUTS (outf
, dregs (dst0
));
4006 OUTS (outf
, " = ASHIFT ");
4007 OUTS (outf
, dregs (src1
));
4008 OUTS (outf
, " BY ");
4009 OUTS (outf
, dregs_lo (src0
));
4010 OUTS (outf
, " (V, S)");
4012 else if (sop
== 0 && sopcde
== 1)
4014 OUTS (outf
, dregs (dst0
));
4015 OUTS (outf
, " = ASHIFT ");
4016 OUTS (outf
, dregs (src1
));
4017 OUTS (outf
, " BY ");
4018 OUTS (outf
, dregs_lo (src0
));
4019 OUTS (outf
, " (V)");
4021 else if (sop
== 0 && sopcde
== 2)
4023 OUTS (outf
, dregs (dst0
));
4024 OUTS (outf
, " = ASHIFT ");
4025 OUTS (outf
, dregs (src1
));
4026 OUTS (outf
, " BY ");
4027 OUTS (outf
, dregs_lo (src0
));
4029 else if (sop
== 1 && sopcde
== 2)
4031 OUTS (outf
, dregs (dst0
));
4032 OUTS (outf
, " = ASHIFT ");
4033 OUTS (outf
, dregs (src1
));
4034 OUTS (outf
, " BY ");
4035 OUTS (outf
, dregs_lo (src0
));
4036 OUTS (outf
, " (S)");
4038 else if (sop
== 2 && sopcde
== 2)
4040 OUTS (outf
, dregs (dst0
));
4041 OUTS (outf
, " = LSHIFT ");
4042 OUTS (outf
, dregs (src1
));
4043 OUTS (outf
, " BY ");
4044 OUTS (outf
, dregs_lo (src0
));
4046 else if (sop
== 3 && sopcde
== 2)
4048 OUTS (outf
, dregs (dst0
));
4049 OUTS (outf
, " = ROT ");
4050 OUTS (outf
, dregs (src1
));
4051 OUTS (outf
, " BY ");
4052 OUTS (outf
, dregs_lo (src0
));
4054 else if (sop
== 2 && sopcde
== 1)
4056 OUTS (outf
, dregs (dst0
));
4057 OUTS (outf
, " = LSHIFT ");
4058 OUTS (outf
, dregs (src1
));
4059 OUTS (outf
, " BY ");
4060 OUTS (outf
, dregs_lo (src0
));
4061 OUTS (outf
, " (V)");
4063 else if (sop
== 0 && sopcde
== 4)
4065 OUTS (outf
, dregs (dst0
));
4066 OUTS (outf
, " = PACK (");
4067 OUTS (outf
, dregs_lo (src1
));
4069 OUTS (outf
, dregs_lo (src0
));
4072 else if (sop
== 1 && sopcde
== 4)
4074 OUTS (outf
, dregs (dst0
));
4075 OUTS (outf
, " = PACK (");
4076 OUTS (outf
, dregs_lo (src1
));
4078 OUTS (outf
, dregs_hi (src0
));
4081 else if (sop
== 2 && sopcde
== 4)
4083 OUTS (outf
, dregs (dst0
));
4084 OUTS (outf
, " = PACK (");
4085 OUTS (outf
, dregs_hi (src1
));
4087 OUTS (outf
, dregs_lo (src0
));
4090 else if (sop
== 3 && sopcde
== 4)
4092 OUTS (outf
, dregs (dst0
));
4093 OUTS (outf
, " = PACK (");
4094 OUTS (outf
, dregs_hi (src1
));
4096 OUTS (outf
, dregs_hi (src0
));
4099 else if (sop
== 0 && sopcde
== 5)
4101 OUTS (outf
, dregs_lo (dst0
));
4102 OUTS (outf
, " = SIGNBITS ");
4103 OUTS (outf
, dregs (src1
));
4105 else if (sop
== 1 && sopcde
== 5)
4107 OUTS (outf
, dregs_lo (dst0
));
4108 OUTS (outf
, " = SIGNBITS ");
4109 OUTS (outf
, dregs_lo (src1
));
4111 else if (sop
== 2 && sopcde
== 5)
4113 OUTS (outf
, dregs_lo (dst0
));
4114 OUTS (outf
, " = SIGNBITS ");
4115 OUTS (outf
, dregs_hi (src1
));
4117 else if (sop
== 0 && sopcde
== 6)
4119 OUTS (outf
, dregs_lo (dst0
));
4120 OUTS (outf
, " = SIGNBITS A0");
4122 else if (sop
== 1 && sopcde
== 6)
4124 OUTS (outf
, dregs_lo (dst0
));
4125 OUTS (outf
, " = SIGNBITS A1");
4127 else if (sop
== 3 && sopcde
== 6)
4129 OUTS (outf
, dregs_lo (dst0
));
4130 OUTS (outf
, " = ONES ");
4131 OUTS (outf
, dregs (src1
));
4133 else if (sop
== 0 && sopcde
== 7)
4135 OUTS (outf
, dregs_lo (dst0
));
4136 OUTS (outf
, " = EXPADJ (");
4137 OUTS (outf
, dregs (src1
));
4139 OUTS (outf
, dregs_lo (src0
));
4142 else if (sop
== 1 && sopcde
== 7)
4144 OUTS (outf
, dregs_lo (dst0
));
4145 OUTS (outf
, " = EXPADJ (");
4146 OUTS (outf
, dregs (src1
));
4148 OUTS (outf
, dregs_lo (src0
));
4149 OUTS (outf
, ") (V)");
4151 else if (sop
== 2 && sopcde
== 7)
4153 OUTS (outf
, dregs_lo (dst0
));
4154 OUTS (outf
, " = EXPADJ (");
4155 OUTS (outf
, dregs_lo (src1
));
4157 OUTS (outf
, dregs_lo (src0
));
4160 else if (sop
== 3 && sopcde
== 7)
4162 OUTS (outf
, dregs_lo (dst0
));
4163 OUTS (outf
, " = EXPADJ (");
4164 OUTS (outf
, dregs_hi (src1
));
4166 OUTS (outf
, dregs_lo (src0
));
4169 else if (sop
== 0 && sopcde
== 8)
4171 OUTS (outf
, "BITMUX (");
4172 OUTS (outf
, dregs (src0
));
4174 OUTS (outf
, dregs (src1
));
4175 OUTS (outf
, ", A0) (ASR)");
4177 else if (sop
== 1 && sopcde
== 8)
4179 OUTS (outf
, "BITMUX (");
4180 OUTS (outf
, dregs (src0
));
4182 OUTS (outf
, dregs (src1
));
4183 OUTS (outf
, ", A0) (ASL)");
4185 else if (sop
== 0 && sopcde
== 9)
4187 OUTS (outf
, dregs_lo (dst0
));
4188 OUTS (outf
, " = VIT_MAX (");
4189 OUTS (outf
, dregs (src1
));
4190 OUTS (outf
, ") (ASL)");
4192 else if (sop
== 1 && sopcde
== 9)
4194 OUTS (outf
, dregs_lo (dst0
));
4195 OUTS (outf
, " = VIT_MAX (");
4196 OUTS (outf
, dregs (src1
));
4197 OUTS (outf
, ") (ASR)");
4199 else if (sop
== 2 && sopcde
== 9)
4201 OUTS (outf
, dregs (dst0
));
4202 OUTS (outf
, " = VIT_MAX (");
4203 OUTS (outf
, dregs (src1
));
4205 OUTS (outf
, dregs (src0
));
4206 OUTS (outf
, ") (ASL)");
4208 else if (sop
== 3 && sopcde
== 9)
4210 OUTS (outf
, dregs (dst0
));
4211 OUTS (outf
, " = VIT_MAX (");
4212 OUTS (outf
, dregs (src1
));
4214 OUTS (outf
, dregs (src0
));
4215 OUTS (outf
, ") (ASR)");
4217 else if (sop
== 0 && sopcde
== 10)
4219 OUTS (outf
, dregs (dst0
));
4220 OUTS (outf
, " = EXTRACT (");
4221 OUTS (outf
, dregs (src1
));
4223 OUTS (outf
, dregs_lo (src0
));
4224 OUTS (outf
, ") (Z)");
4226 else if (sop
== 1 && sopcde
== 10)
4228 OUTS (outf
, dregs (dst0
));
4229 OUTS (outf
, " = EXTRACT (");
4230 OUTS (outf
, dregs (src1
));
4232 OUTS (outf
, dregs_lo (src0
));
4233 OUTS (outf
, ") (X)");
4235 else if (sop
== 2 && sopcde
== 10)
4237 OUTS (outf
, dregs (dst0
));
4238 OUTS (outf
, " = DEPOSIT (");
4239 OUTS (outf
, dregs (src1
));
4241 OUTS (outf
, dregs (src0
));
4244 else if (sop
== 3 && sopcde
== 10)
4246 OUTS (outf
, dregs (dst0
));
4247 OUTS (outf
, " = DEPOSIT (");
4248 OUTS (outf
, dregs (src1
));
4250 OUTS (outf
, dregs (src0
));
4251 OUTS (outf
, ") (X)");
4253 else if (sop
== 0 && sopcde
== 11)
4255 OUTS (outf
, dregs_lo (dst0
));
4256 OUTS (outf
, " = CC = BXORSHIFT (A0, ");
4257 OUTS (outf
, dregs (src0
));
4260 else if (sop
== 1 && sopcde
== 11)
4262 OUTS (outf
, dregs_lo (dst0
));
4263 OUTS (outf
, " = CC = BXOR (A0, ");
4264 OUTS (outf
, dregs (src0
));
4267 else if (sop
== 0 && sopcde
== 12)
4268 OUTS (outf
, "A0 = BXORSHIFT (A0, A1, CC)");
4270 else if (sop
== 1 && sopcde
== 12)
4272 OUTS (outf
, dregs_lo (dst0
));
4273 OUTS (outf
, " = CC = BXOR (A0, A1, CC)");
4275 else if (sop
== 0 && sopcde
== 13)
4277 OUTS (outf
, dregs (dst0
));
4278 OUTS (outf
, " = ALIGN8 (");
4279 OUTS (outf
, dregs (src1
));
4281 OUTS (outf
, dregs (src0
));
4284 else if (sop
== 1 && sopcde
== 13)
4286 OUTS (outf
, dregs (dst0
));
4287 OUTS (outf
, " = ALIGN16 (");
4288 OUTS (outf
, dregs (src1
));
4290 OUTS (outf
, dregs (src0
));
4293 else if (sop
== 2 && sopcde
== 13)
4295 OUTS (outf
, dregs (dst0
));
4296 OUTS (outf
, " = ALIGN24 (");
4297 OUTS (outf
, dregs (src1
));
4299 OUTS (outf
, dregs (src0
));
4309 decode_dsp32shiftimm_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
4312 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
4313 | 1 | 1 | 0 | 0 |.M.| 1 | 1 | 0 | 1 | - | - |.sopcde............|
4314 |.sop...|.HLs...|.dst0......|.immag.................|.src1......|
4315 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
4316 int src1
= ((iw1
>> DSP32ShiftImm_src1_bits
) & DSP32ShiftImm_src1_mask
);
4317 int sop
= ((iw1
>> DSP32ShiftImm_sop_bits
) & DSP32ShiftImm_sop_mask
);
4318 int bit8
= ((iw1
>> 8) & 0x1);
4319 int immag
= ((iw1
>> DSP32ShiftImm_immag_bits
) & DSP32ShiftImm_immag_mask
);
4320 int newimmag
= (-(iw1
>> DSP32ShiftImm_immag_bits
) & DSP32ShiftImm_immag_mask
);
4321 int dst0
= ((iw1
>> DSP32ShiftImm_dst0_bits
) & DSP32ShiftImm_dst0_mask
);
4322 int sopcde
= ((iw0
>> (DSP32ShiftImm_sopcde_bits
- 16)) & DSP32ShiftImm_sopcde_mask
);
4323 int HLs
= ((iw1
>> DSP32ShiftImm_HLs_bits
) & DSP32ShiftImm_HLs_mask
);
4325 if (sop
== 0 && sopcde
== 0)
4327 OUTS (outf
, (HLs
& 2) ? dregs_hi (dst0
) : dregs_lo (dst0
));
4329 OUTS (outf
, (HLs
& 1) ? dregs_hi (src1
) : dregs_lo (src1
));
4330 OUTS (outf
, " >>> ");
4331 OUTS (outf
, uimm4 (newimmag
));
4333 else if (sop
== 1 && sopcde
== 0 && bit8
== 0)
4335 OUTS (outf
, (HLs
& 2) ? dregs_hi (dst0
) : dregs_lo (dst0
));
4337 OUTS (outf
, (HLs
& 1) ? dregs_hi (src1
) : dregs_lo (src1
));
4338 OUTS (outf
, " << ");
4339 OUTS (outf
, uimm4 (immag
));
4340 OUTS (outf
, " (S)");
4342 else if (sop
== 1 && sopcde
== 0 && bit8
== 1)
4344 OUTS (outf
, (HLs
& 2) ? dregs_hi (dst0
) : dregs_lo (dst0
));
4346 OUTS (outf
, (HLs
& 1) ? dregs_hi (src1
) : dregs_lo (src1
));
4347 OUTS (outf
, " >>> ");
4348 OUTS (outf
, uimm4 (newimmag
));
4349 OUTS (outf
, " (S)");
4351 else if (sop
== 2 && sopcde
== 0 && bit8
== 0)
4353 OUTS (outf
, (HLs
& 2) ? dregs_hi (dst0
) : dregs_lo (dst0
));
4355 OUTS (outf
, (HLs
& 1) ? dregs_hi (src1
) : dregs_lo (src1
));
4356 OUTS (outf
, " << ");
4357 OUTS (outf
, uimm4 (immag
));
4359 else if (sop
== 2 && sopcde
== 0 && bit8
== 1)
4361 OUTS (outf
, (HLs
& 2) ? dregs_hi (dst0
) : dregs_lo (dst0
));
4363 OUTS (outf
, (HLs
& 1) ? dregs_hi (src1
) : dregs_lo (src1
));
4364 OUTS (outf
, " >> ");
4365 OUTS (outf
, uimm4 (newimmag
));
4367 else if (sop
== 2 && sopcde
== 3 && HLs
== 1)
4369 OUTS (outf
, "A1 = ROT A1 BY ");
4370 OUTS (outf
, imm6 (immag
));
4372 else if (sop
== 0 && sopcde
== 3 && HLs
== 0 && bit8
== 0)
4374 OUTS (outf
, "A0 = A0 << ");
4375 OUTS (outf
, uimm5 (immag
));
4377 else if (sop
== 0 && sopcde
== 3 && HLs
== 0 && bit8
== 1)
4379 OUTS (outf
, "A0 = A0 >>> ");
4380 OUTS (outf
, uimm5 (newimmag
));
4382 else if (sop
== 0 && sopcde
== 3 && HLs
== 1 && bit8
== 0)
4384 OUTS (outf
, "A1 = A1 << ");
4385 OUTS (outf
, uimm5 (immag
));
4387 else if (sop
== 0 && sopcde
== 3 && HLs
== 1 && bit8
== 1)
4389 OUTS (outf
, "A1 = A1 >>> ");
4390 OUTS (outf
, uimm5 (newimmag
));
4392 else if (sop
== 1 && sopcde
== 3 && HLs
== 0)
4394 OUTS (outf
, "A0 = A0 >> ");
4395 OUTS (outf
, uimm5 (newimmag
));
4397 else if (sop
== 1 && sopcde
== 3 && HLs
== 1)
4399 OUTS (outf
, "A1 = A1 >> ");
4400 OUTS (outf
, uimm5 (newimmag
));
4402 else if (sop
== 2 && sopcde
== 3 && HLs
== 0)
4404 OUTS (outf
, "A0 = ROT A0 BY ");
4405 OUTS (outf
, imm6 (immag
));
4407 else if (sop
== 1 && sopcde
== 1 && bit8
== 0)
4409 OUTS (outf
, dregs (dst0
));
4411 OUTS (outf
, dregs (src1
));
4412 OUTS (outf
, " << ");
4413 OUTS (outf
, uimm5 (immag
));
4414 OUTS (outf
, " (V, S)");
4416 else if (sop
== 1 && sopcde
== 1 && bit8
== 1)
4418 OUTS (outf
, dregs (dst0
));
4420 OUTS (outf
, dregs (src1
));
4421 OUTS (outf
, " >>> ");
4422 OUTS (outf
, imm5 (-immag
));
4423 OUTS (outf
, " (V, S)");
4425 else if (sop
== 2 && sopcde
== 1 && bit8
== 1)
4427 OUTS (outf
, dregs (dst0
));
4429 OUTS (outf
, dregs (src1
));
4430 OUTS (outf
, " >> ");
4431 OUTS (outf
, uimm5 (newimmag
));
4432 OUTS (outf
, " (V)");
4434 else if (sop
== 2 && sopcde
== 1 && bit8
== 0)
4436 OUTS (outf
, dregs (dst0
));
4438 OUTS (outf
, dregs (src1
));
4439 OUTS (outf
, " << ");
4440 OUTS (outf
, imm5 (immag
));
4441 OUTS (outf
, " (V)");
4443 else if (sop
== 0 && sopcde
== 1)
4445 OUTS (outf
, dregs (dst0
));
4447 OUTS (outf
, dregs (src1
));
4448 OUTS (outf
, " >>> ");
4449 OUTS (outf
, uimm5 (newimmag
));
4450 OUTS (outf
, " (V)");
4452 else if (sop
== 1 && sopcde
== 2)
4454 OUTS (outf
, dregs (dst0
));
4456 OUTS (outf
, dregs (src1
));
4457 OUTS (outf
, " << ");
4458 OUTS (outf
, uimm5 (immag
));
4459 OUTS (outf
, " (S)");
4461 else if (sop
== 2 && sopcde
== 2 && bit8
== 1)
4463 OUTS (outf
, dregs (dst0
));
4465 OUTS (outf
, dregs (src1
));
4466 OUTS (outf
, " >> ");
4467 OUTS (outf
, uimm5 (newimmag
));
4469 else if (sop
== 2 && sopcde
== 2 && bit8
== 0)
4471 OUTS (outf
, dregs (dst0
));
4473 OUTS (outf
, dregs (src1
));
4474 OUTS (outf
, " << ");
4475 OUTS (outf
, uimm5 (immag
));
4477 else if (sop
== 3 && sopcde
== 2)
4479 OUTS (outf
, dregs (dst0
));
4480 OUTS (outf
, " = ROT ");
4481 OUTS (outf
, dregs (src1
));
4482 OUTS (outf
, " BY ");
4483 OUTS (outf
, imm6 (immag
));
4485 else if (sop
== 0 && sopcde
== 2)
4487 OUTS (outf
, dregs (dst0
));
4489 OUTS (outf
, dregs (src1
));
4490 OUTS (outf
, " >>> ");
4491 OUTS (outf
, uimm5 (newimmag
));
4500 decode_pseudoDEBUG_0 (TIword iw0
, disassemble_info
*outf
)
4502 struct private *priv
= outf
->private_data
;
4504 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
4505 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |.fn....|.grp.......|.reg.......|
4506 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
4507 int fn
= ((iw0
>> PseudoDbg_fn_bits
) & PseudoDbg_fn_mask
);
4508 int grp
= ((iw0
>> PseudoDbg_grp_bits
) & PseudoDbg_grp_mask
);
4509 int reg
= ((iw0
>> PseudoDbg_reg_bits
) & PseudoDbg_reg_mask
);
4514 if (reg
== 0 && fn
== 3)
4515 OUTS (outf
, "DBG A0");
4517 else if (reg
== 1 && fn
== 3)
4518 OUTS (outf
, "DBG A1");
4520 else if (reg
== 3 && fn
== 3)
4521 OUTS (outf
, "ABORT");
4523 else if (reg
== 4 && fn
== 3)
4526 else if (reg
== 5 && fn
== 3)
4527 OUTS (outf
, "DBGHALT");
4529 else if (reg
== 6 && fn
== 3)
4531 OUTS (outf
, "DBGCMPLX (");
4532 OUTS (outf
, dregs (grp
));
4535 else if (reg
== 7 && fn
== 3)
4538 else if (grp
== 0 && fn
== 2)
4540 OUTS (outf
, "OUTC ");
4541 OUTS (outf
, dregs (reg
));
4545 OUTS (outf
, "DBG ");
4546 OUTS (outf
, allregs (reg
, grp
));
4550 OUTS (outf
, "PRNT ");
4551 OUTS (outf
, allregs (reg
, grp
));
4560 decode_pseudoOChar_0 (TIword iw0
, disassemble_info
*outf
)
4562 struct private *priv
= outf
->private_data
;
4564 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
4565 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 |.ch............................|
4566 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
4567 int ch
= ((iw0
>> PseudoChr_ch_bits
) & PseudoChr_ch_mask
);
4572 OUTS (outf
, "OUTC ");
4573 OUTS (outf
, uimm8 (ch
));
4579 decode_pseudodbg_assert_0 (TIword iw0
, TIword iw1
, disassemble_info
*outf
)
4581 struct private *priv
= outf
->private_data
;
4583 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+
4584 | 1 | 1 | 1 | 1 | 0 | - | - | - | dbgop |.grp.......|.regtest...|
4585 |.expected......................................................|
4586 +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */
4587 int expected
= ((iw1
>> PseudoDbg_Assert_expected_bits
) & PseudoDbg_Assert_expected_mask
);
4588 int dbgop
= ((iw0
>> (PseudoDbg_Assert_dbgop_bits
- 16)) & PseudoDbg_Assert_dbgop_mask
);
4589 int grp
= ((iw0
>> (PseudoDbg_Assert_grp_bits
- 16)) & PseudoDbg_Assert_grp_mask
);
4590 int regtest
= ((iw0
>> (PseudoDbg_Assert_regtest_bits
- 16)) & PseudoDbg_Assert_regtest_mask
);
4597 OUTS (outf
, "DBGA (");
4598 OUTS (outf
, regs_lo (regtest
, grp
));
4600 OUTS (outf
, uimm16 (expected
));
4603 else if (dbgop
== 1)
4605 OUTS (outf
, "DBGA (");
4606 OUTS (outf
, regs_hi (regtest
, grp
));
4608 OUTS (outf
, uimm16 (expected
));
4611 else if (dbgop
== 2)
4613 OUTS (outf
, "DBGAL (");
4614 OUTS (outf
, allregs (regtest
, grp
));
4616 OUTS (outf
, uimm16 (expected
));
4619 else if (dbgop
== 3)
4621 OUTS (outf
, "DBGAH (");
4622 OUTS (outf
, allregs (regtest
, grp
));
4624 OUTS (outf
, uimm16 (expected
));
4633 ifetch (bfd_vma pc
, disassemble_info
*outf
, TIword
*iw
)
4638 status
= (*outf
->read_memory_func
) (pc
, buf
, 2, outf
);
4641 (*outf
->memory_error_func
) (status
, pc
, outf
);
4645 *iw
= bfd_getl16 (buf
);
4650 _print_insn_bfin (bfd_vma pc
, disassemble_info
*outf
)
4652 struct private *priv
= outf
->private_data
;
4657 /* The PC must be 16-bit aligned. */
4660 OUTS (outf
, "ILLEGAL (UNALIGNED)");
4661 /* For people dumping data, just re-align the return value. */
4665 if (ifetch (pc
, outf
, &iw0
))
4669 if (((iw0
& 0xc000) == 0xc000) && ((iw0
& 0xff00) != 0xf800))
4672 if (ifetch (pc
+ 2, outf
, &iw1
))
4679 if ((iw0
& 0xf7ff) == 0xc003 && iw1
== 0x1800)
4683 OUTS (outf
, "ILLEGAL");
4686 OUTS (outf
, "MNOP");
4689 else if ((iw0
& 0xff00) == 0x0000)
4690 rv
= decode_ProgCtrl_0 (iw0
, outf
);
4691 else if ((iw0
& 0xffc0) == 0x0240)
4692 rv
= decode_CaCTRL_0 (iw0
, outf
);
4693 else if ((iw0
& 0xff80) == 0x0100)
4694 rv
= decode_PushPopReg_0 (iw0
, outf
);
4695 else if ((iw0
& 0xfe00) == 0x0400)
4696 rv
= decode_PushPopMultiple_0 (iw0
, outf
);
4697 else if ((iw0
& 0xfe00) == 0x0600)
4698 rv
= decode_ccMV_0 (iw0
, outf
);
4699 else if ((iw0
& 0xf800) == 0x0800)
4700 rv
= decode_CCflag_0 (iw0
, outf
);
4701 else if ((iw0
& 0xffe0) == 0x0200)
4702 rv
= decode_CC2dreg_0 (iw0
, outf
);
4703 else if ((iw0
& 0xff00) == 0x0300)
4704 rv
= decode_CC2stat_0 (iw0
, outf
);
4705 else if ((iw0
& 0xf000) == 0x1000)
4706 rv
= decode_BRCC_0 (iw0
, pc
, outf
);
4707 else if ((iw0
& 0xf000) == 0x2000)
4708 rv
= decode_UJUMP_0 (iw0
, pc
, outf
);
4709 else if ((iw0
& 0xf000) == 0x3000)
4710 rv
= decode_REGMV_0 (iw0
, outf
);
4711 else if ((iw0
& 0xfc00) == 0x4000)
4712 rv
= decode_ALU2op_0 (iw0
, outf
);
4713 else if ((iw0
& 0xfe00) == 0x4400)
4714 rv
= decode_PTR2op_0 (iw0
, outf
);
4715 else if ((iw0
& 0xf800) == 0x4800)
4716 rv
= decode_LOGI2op_0 (iw0
, outf
);
4717 else if ((iw0
& 0xf000) == 0x5000)
4718 rv
= decode_COMP3op_0 (iw0
, outf
);
4719 else if ((iw0
& 0xf800) == 0x6000)
4720 rv
= decode_COMPI2opD_0 (iw0
, outf
);
4721 else if ((iw0
& 0xf800) == 0x6800)
4722 rv
= decode_COMPI2opP_0 (iw0
, outf
);
4723 else if ((iw0
& 0xf000) == 0x8000)
4724 rv
= decode_LDSTpmod_0 (iw0
, outf
);
4725 else if ((iw0
& 0xff60) == 0x9e60)
4726 rv
= decode_dagMODim_0 (iw0
, outf
);
4727 else if ((iw0
& 0xfff0) == 0x9f60)
4728 rv
= decode_dagMODik_0 (iw0
, outf
);
4729 else if ((iw0
& 0xfc00) == 0x9c00)
4730 rv
= decode_dspLDST_0 (iw0
, outf
);
4731 else if ((iw0
& 0xf000) == 0x9000)
4732 rv
= decode_LDST_0 (iw0
, outf
);
4733 else if ((iw0
& 0xfc00) == 0xb800)
4734 rv
= decode_LDSTiiFP_0 (iw0
, outf
);
4735 else if ((iw0
& 0xe000) == 0xA000)
4736 rv
= decode_LDSTii_0 (iw0
, outf
);
4737 else if ((iw0
& 0xff80) == 0xe080 && (iw1
& 0x0C00) == 0x0000)
4738 rv
= decode_LoopSetup_0 (iw0
, iw1
, pc
, outf
);
4739 else if ((iw0
& 0xff00) == 0xe100 && (iw1
& 0x0000) == 0x0000)
4740 rv
= decode_LDIMMhalf_0 (iw0
, iw1
, outf
);
4741 else if ((iw0
& 0xfe00) == 0xe200 && (iw1
& 0x0000) == 0x0000)
4742 rv
= decode_CALLa_0 (iw0
, iw1
, pc
, outf
);
4743 else if ((iw0
& 0xfc00) == 0xe400 && (iw1
& 0x0000) == 0x0000)
4744 rv
= decode_LDSTidxI_0 (iw0
, iw1
, outf
);
4745 else if ((iw0
& 0xfffe) == 0xe800 && (iw1
& 0x0000) == 0x0000)
4746 rv
= decode_linkage_0 (iw0
, iw1
, outf
);
4747 else if ((iw0
& 0xf600) == 0xc000 && (iw1
& 0x0000) == 0x0000)
4748 rv
= decode_dsp32mac_0 (iw0
, iw1
, outf
);
4749 else if ((iw0
& 0xf600) == 0xc200 && (iw1
& 0x0000) == 0x0000)
4750 rv
= decode_dsp32mult_0 (iw0
, iw1
, outf
);
4751 else if ((iw0
& 0xf7c0) == 0xc400 && (iw1
& 0x0000) == 0x0000)
4752 rv
= decode_dsp32alu_0 (iw0
, iw1
, outf
);
4753 else if ((iw0
& 0xf780) == 0xc600 && (iw1
& 0x01c0) == 0x0000)
4754 rv
= decode_dsp32shift_0 (iw0
, iw1
, outf
);
4755 else if ((iw0
& 0xf780) == 0xc680 && (iw1
& 0x0000) == 0x0000)
4756 rv
= decode_dsp32shiftimm_0 (iw0
, iw1
, outf
);
4757 else if ((iw0
& 0xff00) == 0xf800)
4758 rv
= decode_pseudoDEBUG_0 (iw0
, outf
);
4759 else if ((iw0
& 0xFF00) == 0xF900)
4760 rv
= decode_pseudoOChar_0 (iw0
, outf
);
4761 else if ((iw0
& 0xFF00) == 0xf000 && (iw1
& 0x0000) == 0x0000)
4762 rv
= decode_pseudodbg_assert_0 (iw0
, iw1
, outf
);
4765 OUTS (outf
, "ILLEGAL");
4771 print_insn_bfin (bfd_vma pc
, disassemble_info
*outf
)
4773 struct private priv
;
4776 priv
.parallel
= FALSE
;
4777 priv
.comment
= FALSE
;
4778 outf
->private_data
= &priv
;
4780 count
= _print_insn_bfin (pc
, outf
);
4784 /* Proper display of multiple issue instructions. */
4786 if (count
== 4 && (priv
.iw0
& 0xc000) == 0xc000 && (priv
.iw0
& BIT_MULTI_INS
)
4787 && ((priv
.iw0
& 0xe800) != 0xe800 /* Not Linkage. */ ))
4789 bfd_boolean legal
= TRUE
;
4792 priv
.parallel
= TRUE
;
4793 OUTS (outf
, " || ");
4794 len
= _print_insn_bfin (pc
+ 4, outf
);
4797 OUTS (outf
, " || ");
4800 len
= _print_insn_bfin (pc
+ 6, outf
);
4810 OUTS (outf
, ";\t\t/* ILLEGAL PARALLEL INSTRUCTION */");
4811 priv
.comment
= TRUE
;