1 Upstream-Status: Backport
3 From f72b2c498bc98f42048a3bf7f7d7891db9cabcfc Mon Sep 17 00:00:00 2001
4 From: Pierre Muller <muller@ics.u-strasbg.fr>
5 Date: Fri, 25 Nov 2011 16:57:32 +0000
6 Subject: [PATCH 006/262] * mips-dis.c (print_insn_micromips): Rename
7 local variable iprintf to infprintf to
11 opcodes/ChangeLog | 5 ++
12 opcodes/mips-dis.c | 188 ++++++++++++++++++++++++++--------------------------
13 2 files changed, 99 insertions(+), 94 deletions(-)
15 2011-11-25 Pierre Muller <muller@ics.u-strasbg.fr>
17 * mips-dis.c (print_insn_micromips): Rename local variable iprintf
18 to infprintf to avoid shadow warning.
20 diff --git a/opcodes/mips-dis.c b/opcodes/mips-dis.c
21 index 4e18d8a..72285de 100644
22 --- a/opcodes/mips-dis.c
23 +++ b/opcodes/mips-dis.c
24 @@ -2260,7 +2260,7 @@ print_insn_mips16 (bfd_vma memaddr, struct disassemble_info *info)
26 print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
28 - const fprintf_ftype iprintf = info->fprintf_func;
29 + const fprintf_ftype infprintf = info->fprintf_func;
30 const struct mips_opcode *op, *opend;
31 unsigned int lsb, msbd, msb;
32 void *is = info->stream;
33 @@ -2307,7 +2307,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
34 status = (*info->read_memory_func) (memaddr + 2, buffer, 2, info);
37 - iprintf (is, "micromips 0x%x", higher);
38 + infprintf (is, "micromips 0x%x", higher);
39 (*info->memory_error_func) (status, memaddr + 2, info);
42 @@ -2320,7 +2320,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
43 status = (*info->read_memory_func) (memaddr + 4, buffer, 2, info);
46 - iprintf (is, "micromips 0x%x", higher);
47 + infprintf (is, "micromips 0x%x", higher);
48 (*info->memory_error_func) (status, memaddr + 4, info);
51 @@ -2328,7 +2328,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
52 insn = bfd_getb16 (buffer);
54 insn = bfd_getl16 (buffer);
55 - iprintf (is, "0x%x%04x (48-bit insn)", higher, insn);
56 + infprintf (is, "0x%x%04x (48-bit insn)", higher, insn);
58 info->insn_type = dis_noninsn;
60 @@ -2341,7 +2341,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
61 status = (*info->read_memory_func) (memaddr + 2, buffer, 2, info);
64 - iprintf (is, "micromips 0x%x", higher);
65 + infprintf (is, "micromips 0x%x", higher);
66 (*info->memory_error_func) (status, memaddr + 2, info);
69 @@ -2371,9 +2371,9 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
73 - iprintf (is, "%s", op->name);
74 + infprintf (is, "%s", op->name);
75 if (op->args[0] != '\0')
77 + infprintf (is, "\t");
79 for (s = op->args; *s != '\0'; s++)
81 @@ -2382,37 +2382,37 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
85 - iprintf (is, "%c", *s);
86 + infprintf (is, "%c", *s);
90 delta = GET_OP (insn, OFFSET10);
93 - iprintf (is, "%d", delta);
94 + infprintf (is, "%d", delta);
98 - iprintf (is, "0x%lx", GET_OP (insn, STYPE));
99 + infprintf (is, "0x%lx", GET_OP (insn, STYPE));
103 - iprintf (is, "0x%lx", GET_OP (insn, SHAMT));
104 + infprintf (is, "0x%lx", GET_OP (insn, SHAMT));
108 - iprintf (is, "0x%lx", GET_OP (insn, 3BITPOS));
109 + infprintf (is, "0x%lx", GET_OP (insn, 3BITPOS));
113 - iprintf (is, "0x%lx", GET_OP (insn, TRAP));
114 + infprintf (is, "0x%lx", GET_OP (insn, TRAP));
118 delta = GET_OP (insn, OFFSET12);
121 - iprintf (is, "%d", delta);
122 + infprintf (is, "%d", delta);
126 @@ -2433,34 +2433,34 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
130 - iprintf (is, "%s", mips_gpr_names[GET_OP (insn, RS)]);
131 + infprintf (is, "%s", mips_gpr_names[GET_OP (insn, RS)]);
135 - iprintf (is, "0x%lx", GET_OP (insn, CODE));
136 + infprintf (is, "0x%lx", GET_OP (insn, CODE));
140 - iprintf (is, "%s", mips_gpr_names[GET_OP (insn, RD)]);
141 + infprintf (is, "%s", mips_gpr_names[GET_OP (insn, RD)]);
145 - iprintf (is, "0x%lx", GET_OP (insn, PREFX));
146 + infprintf (is, "0x%lx", GET_OP (insn, PREFX));
151 - iprintf (is, "0x%lx", GET_OP (insn, IMMEDIATE));
152 + infprintf (is, "0x%lx", GET_OP (insn, IMMEDIATE));
155 case 'j': /* Same as i, but sign-extended. */
157 delta = (GET_OP (insn, DELTA) ^ 0x8000) - 0x8000;
158 - iprintf (is, "%d", delta);
159 + infprintf (is, "%d", delta);
163 - iprintf (is, "0x%x", GET_OP (insn, CACHE));
164 + infprintf (is, "0x%x", GET_OP (insn, CACHE));
168 @@ -2472,26 +2472,26 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
169 if (s_reg_encode != 0)
171 if (s_reg_encode == 1)
172 - iprintf (is, "%s", mips_gpr_names[16]);
173 + infprintf (is, "%s", mips_gpr_names[16]);
174 else if (s_reg_encode < 9)
175 - iprintf (is, "%s-%s",
176 + infprintf (is, "%s-%s",
178 mips_gpr_names[15 + s_reg_encode]);
179 else if (s_reg_encode == 9)
180 - iprintf (is, "%s-%s,%s",
181 + infprintf (is, "%s-%s,%s",
186 - iprintf (is, "UNKNOWN");
187 + infprintf (is, "UNKNOWN");
190 if (immed & 0x10) /* For ra. */
192 if (s_reg_encode == 0)
193 - iprintf (is, "%s", mips_gpr_names[31]);
194 + infprintf (is, "%s", mips_gpr_names[31]);
196 - iprintf (is, ",%s", mips_gpr_names[31]);
197 + infprintf (is, ",%s", mips_gpr_names[31]);
201 @@ -2504,32 +2504,32 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
205 - iprintf (is, "0x%lx", GET_OP (insn, CODE2));
206 + infprintf (is, "0x%lx", GET_OP (insn, CODE2));
211 - iprintf (is, "%s", mips_gpr_names[GET_OP (insn, RT)]);
212 + infprintf (is, "%s", mips_gpr_names[GET_OP (insn, RT)]);
216 - iprintf (is, "%s", mips_gpr_names[GET_OP (insn, RS3)]);
217 + infprintf (is, "%s", mips_gpr_names[GET_OP (insn, RS3)]);
221 - iprintf (is, "%s", mips_gpr_names[0]);
222 + infprintf (is, "%s", mips_gpr_names[0]);
226 - iprintf (is, "0x%lx", GET_OP (insn, CODE10));
227 + infprintf (is, "0x%lx", GET_OP (insn, CODE10));
231 - iprintf (is, "0x%lx", GET_OP (insn, COPZ));
232 + infprintf (is, "0x%lx", GET_OP (insn, COPZ));
236 - iprintf (is, "%s", mips_fpr_names[GET_OP (insn, FD)]);
237 + infprintf (is, "%s", mips_fpr_names[GET_OP (insn, FD)]);
241 @@ -2540,7 +2540,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
242 'T' format. Therefore, until we gain understanding of
243 cp2 register names, we can simply print the register
245 - iprintf (is, "$%ld", GET_OP (insn, RT));
246 + infprintf (is, "$%ld", GET_OP (insn, RT));
250 @@ -2559,44 +2559,44 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
251 case 0x000002fc: /* mtc0 */
252 case 0x580000fc: /* dmfc0 */
253 case 0x580002fc: /* dmtc0 */
254 - iprintf (is, "%s", mips_cp0_names[GET_OP (insn, RS)]);
255 + infprintf (is, "%s", mips_cp0_names[GET_OP (insn, RS)]);
258 - iprintf (is, "$%ld", GET_OP (insn, RS));
259 + infprintf (is, "$%ld", GET_OP (insn, RS));
265 - iprintf (is, "%ld", GET_OP (insn, SEL));
266 + infprintf (is, "%ld", GET_OP (insn, SEL));
270 - iprintf (is, "%s", mips_hwr_names[GET_OP (insn, RS)]);
271 + infprintf (is, "%s", mips_hwr_names[GET_OP (insn, RS)]);
275 - iprintf (is, "$fcc%ld", GET_OP (insn, CCC));
276 + infprintf (is, "$fcc%ld", GET_OP (insn, CCC));
282 (op->pinfo & (FP_D | FP_S)) != 0
283 ? "$fcc%ld" : "$cc%ld",
288 - iprintf (is, "%s", mips_fpr_names[GET_OP (insn, FR)]);
289 + infprintf (is, "%s", mips_fpr_names[GET_OP (insn, FR)]);
294 - iprintf (is, "%s", mips_fpr_names[GET_OP (insn, FS)]);
295 + infprintf (is, "%s", mips_fpr_names[GET_OP (insn, FS)]);
299 - iprintf (is, "%s", mips_fpr_names[GET_OP (insn, FT)]);
300 + infprintf (is, "%s", mips_fpr_names[GET_OP (insn, FT)]);
304 @@ -2606,18 +2606,18 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
307 lsb = GET_OP (insn, EXTLSB);
308 - iprintf (is, "0x%x", lsb);
309 + infprintf (is, "0x%x", lsb);
313 msb = GET_OP (insn, INSMSB);
314 - iprintf (is, "0x%x", msb - lsb + 1);
315 + infprintf (is, "0x%x", msb - lsb + 1);
320 msbd = GET_OP (insn, EXTMSBD);
321 - iprintf (is, "0x%x", msbd + 1);
322 + infprintf (is, "0x%x", msbd + 1);
326 @@ -2637,30 +2637,30 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
327 mips_cp0sel_names_len,
330 - iprintf (is, "%s", n->name);
331 + infprintf (is, "%s", n->name);
333 - iprintf (is, "$%d,%d", cp0reg, sel);
334 + infprintf (is, "$%d,%d", cp0reg, sel);
339 lsb = GET_OP (insn, EXTLSB) + 32;
340 - iprintf (is, "0x%x", lsb);
341 + infprintf (is, "0x%x", lsb);
345 msb = GET_OP (insn, INSMSB) + 32;
346 - iprintf (is, "0x%x", msb - lsb + 1);
347 + infprintf (is, "0x%x", msb - lsb + 1);
351 msbd = GET_OP (insn, EXTMSBD) + 32;
352 - iprintf (is, "0x%x", msbd + 1);
353 + infprintf (is, "0x%x", msbd + 1);
357 /* xgettext:c-format */
360 _("# internal disassembler error, "
361 "unrecognized modifier (+%c)"),
363 @@ -2674,111 +2674,111 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
366 case 'a': /* global pointer. */
367 - iprintf (is, "%s", mips_gpr_names[28]);
368 + infprintf (is, "%s", mips_gpr_names[28]);
372 regno = micromips_to_32_reg_b_map[GET_OP (insn, MB)];
373 - iprintf (is, "%s", mips_gpr_names[regno]);
374 + infprintf (is, "%s", mips_gpr_names[regno]);
378 regno = micromips_to_32_reg_c_map[GET_OP (insn, MC)];
379 - iprintf (is, "%s", mips_gpr_names[regno]);
380 + infprintf (is, "%s", mips_gpr_names[regno]);
384 regno = micromips_to_32_reg_d_map[GET_OP (insn, MD)];
385 - iprintf (is, "%s", mips_gpr_names[regno]);
386 + infprintf (is, "%s", mips_gpr_names[regno]);
390 regno = micromips_to_32_reg_e_map[GET_OP (insn, ME)];
391 - iprintf (is, "%s", mips_gpr_names[regno]);
392 + infprintf (is, "%s", mips_gpr_names[regno]);
396 /* Save lastregno for "mt" to print out later. */
397 lastregno = micromips_to_32_reg_f_map[GET_OP (insn, MF)];
398 - iprintf (is, "%s", mips_gpr_names[lastregno]);
399 + infprintf (is, "%s", mips_gpr_names[lastregno]);
403 regno = micromips_to_32_reg_g_map[GET_OP (insn, MG)];
404 - iprintf (is, "%s", mips_gpr_names[regno]);
405 + infprintf (is, "%s", mips_gpr_names[regno]);
409 regno = micromips_to_32_reg_h_map[GET_OP (insn, MH)];
410 - iprintf (is, "%s", mips_gpr_names[regno]);
411 + infprintf (is, "%s", mips_gpr_names[regno]);
415 regno = micromips_to_32_reg_i_map[GET_OP (insn, MI)];
416 - iprintf (is, "%s", mips_gpr_names[regno]);
417 + infprintf (is, "%s", mips_gpr_names[regno]);
421 - iprintf (is, "%s", mips_gpr_names[GET_OP (insn, MJ)]);
422 + infprintf (is, "%s", mips_gpr_names[GET_OP (insn, MJ)]);
426 regno = micromips_to_32_reg_l_map[GET_OP (insn, ML)];
427 - iprintf (is, "%s", mips_gpr_names[regno]);
428 + infprintf (is, "%s", mips_gpr_names[regno]);
432 regno = micromips_to_32_reg_m_map[GET_OP (insn, MM)];
433 - iprintf (is, "%s", mips_gpr_names[regno]);
434 + infprintf (is, "%s", mips_gpr_names[regno]);
438 regno = micromips_to_32_reg_n_map[GET_OP (insn, MN)];
439 - iprintf (is, "%s", mips_gpr_names[regno]);
440 + infprintf (is, "%s", mips_gpr_names[regno]);
444 /* Save lastregno for "mt" to print out later. */
445 lastregno = GET_OP (insn, MP);
446 - iprintf (is, "%s", mips_gpr_names[lastregno]);
447 + infprintf (is, "%s", mips_gpr_names[lastregno]);
451 regno = micromips_to_32_reg_q_map[GET_OP (insn, MQ)];
452 - iprintf (is, "%s", mips_gpr_names[regno]);
453 + infprintf (is, "%s", mips_gpr_names[regno]);
456 case 'r': /* program counter. */
457 - iprintf (is, "$pc");
458 + infprintf (is, "$pc");
461 case 's': /* stack pointer. */
463 - iprintf (is, "%s", mips_gpr_names[29]);
464 + infprintf (is, "%s", mips_gpr_names[29]);
468 - iprintf (is, "%s", mips_gpr_names[lastregno]);
469 + infprintf (is, "%s", mips_gpr_names[lastregno]);
473 - iprintf (is, "%s", mips_gpr_names[0]);
474 + infprintf (is, "%s", mips_gpr_names[0]);
478 /* Sign-extend the immediate. */
479 immed = ((GET_OP (insn, IMMA) ^ 0x40) - 0x40) << 2;
480 - iprintf (is, "%d", immed);
481 + infprintf (is, "%d", immed);
485 immed = micromips_imm_b_map[GET_OP (insn, IMMB)];
486 - iprintf (is, "%d", immed);
487 + infprintf (is, "%d", immed);
491 immed = micromips_imm_c_map[GET_OP (insn, IMMC)];
492 - iprintf (is, "0x%lx", immed);
493 + infprintf (is, "0x%lx", immed);
497 @@ -2797,50 +2797,50 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
500 immed = GET_OP (insn, IMMF);
501 - iprintf (is, "0x%x", immed);
502 + infprintf (is, "0x%x", immed);
506 immed = (insn >> MICROMIPSOP_SH_IMMG) + 1;
507 immed = (immed & MICROMIPSOP_MASK_IMMG) - 1;
508 - iprintf (is, "%d", immed);
509 + infprintf (is, "%d", immed);
513 immed = GET_OP (insn, IMMH) << 1;
514 - iprintf (is, "%d", immed);
515 + infprintf (is, "%d", immed);
519 immed = (insn >> MICROMIPSOP_SH_IMMI) + 1;
520 immed = (immed & MICROMIPSOP_MASK_IMMI) - 1;
521 - iprintf (is, "%d", immed);
522 + infprintf (is, "%d", immed);
526 immed = GET_OP (insn, IMMJ) << 2;
527 - iprintf (is, "%d", immed);
528 + infprintf (is, "%d", immed);
532 immed = GET_OP (insn, IMML);
533 - iprintf (is, "%d", immed);
534 + infprintf (is, "%d", immed);
538 immed = (insn >> MICROMIPSOP_SH_IMMM) - 1;
539 immed = (immed & MICROMIPSOP_MASK_IMMM) + 1;
540 - iprintf (is, "%d", immed);
541 + infprintf (is, "%d", immed);
545 immed = GET_OP (insn, IMMN);
547 - iprintf (is, "%s,%s",
548 + infprintf (is, "%s,%s",
552 - iprintf (is, "%s-%s,%s",
553 + infprintf (is, "%s-%s,%s",
555 mips_gpr_names[16 + immed],
557 @@ -2848,35 +2848,35 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
560 immed = GET_OP (insn, IMMO);
561 - iprintf (is, "0x%x", immed);
562 + infprintf (is, "0x%x", immed);
566 immed = GET_OP (insn, IMMP) << 2;
567 - iprintf (is, "%d", immed);
568 + infprintf (is, "%d", immed);
572 /* Sign-extend the immediate. */
573 immed = (GET_OP (insn, IMMQ) ^ 0x400000) - 0x400000;
575 - iprintf (is, "%d", immed);
576 + infprintf (is, "%d", immed);
580 immed = GET_OP (insn, IMMU) << 2;
581 - iprintf (is, "%d", immed);
582 + infprintf (is, "%d", immed);
586 immed = GET_OP (insn, IMMW) << 2;
587 - iprintf (is, "%d", immed);
588 + infprintf (is, "%d", immed);
592 /* Sign-extend the immediate. */
593 immed = (GET_OP (insn, IMMX) ^ 0x8) - 0x8;
594 - iprintf (is, "%d", immed);
595 + infprintf (is, "%d", immed);
599 @@ -2885,12 +2885,12 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
600 if (immed >= -2 && immed <= 1)
603 - iprintf (is, "%d", immed);
604 + infprintf (is, "%d", immed);
608 /* xgettext:c-format */
611 _("# internal disassembler error, "
612 "unrecognized modifier (m%c)"),
614 @@ -2900,7 +2900,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
617 /* xgettext:c-format */
620 _("# internal disassembler error, "
621 "unrecognized modifier (%c)"),
623 @@ -2937,7 +2937,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
627 - iprintf (is, "0x%x", insn);
628 + infprintf (is, "0x%x", insn);
629 info->insn_type = dis_noninsn;