1 /* Disassembler for the PA-RISC. Somewhat derived from sparc-pinsn.c.
2 Copyright 1989, 1990, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2003,
3 2005, 2007 Free Software Foundation, Inc.
5 Contributed by the Center for Software Science at the
6 University of Utah (pa-gdb-bugs@cs.utah.edu).
8 This file is part of the GNU opcodes library.
10 This library is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3, or (at your option)
15 It is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
18 License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
23 MA 02110-1301, USA. */
28 #include "opcode/hppa.h"
30 /* Integer register names, indexed by the numbers which appear in the
32 static const char *const reg_names
[] =
34 "flags", "r1", "rp", "r3", "r4", "r5", "r6", "r7", "r8", "r9",
35 "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19",
36 "r20", "r21", "r22", "r23", "r24", "r25", "r26", "dp", "ret0", "ret1",
40 /* Floating point register names, indexed by the numbers which appear in the
42 static const char *const fp_reg_names
[] =
44 "fpsr", "fpe2", "fpe4", "fpe6",
45 "fr4", "fr5", "fr6", "fr7", "fr8",
46 "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15",
47 "fr16", "fr17", "fr18", "fr19", "fr20", "fr21", "fr22", "fr23",
48 "fr24", "fr25", "fr26", "fr27", "fr28", "fr29", "fr30", "fr31"
51 typedef unsigned int CORE_ADDR
;
53 /* Get at various relevent fields of an instruction word. */
58 #define MASK_14 0x3fff
59 #define MASK_16 0xffff
60 #define MASK_21 0x1fffff
62 /* These macros get bit fields using HP's numbering (MSB = 0). */
64 #define GET_FIELD(X, FROM, TO) \
65 ((X) >> (31 - (TO)) & ((1 << ((TO) - (FROM) + 1)) - 1))
67 #define GET_BIT(X, WHICH) \
68 GET_FIELD (X, WHICH, WHICH)
70 /* Some of these have been converted to 2-d arrays because they
71 consume less storage this way. If the maintenance becomes a
72 problem, convert them back to const 1-d pointer arrays. */
73 static const char *const control_reg
[] =
75 "rctr", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7",
76 "pidr1", "pidr2", "ccr", "sar", "pidr3", "pidr4",
77 "iva", "eiem", "itmr", "pcsq", "pcoq", "iir", "isr",
78 "ior", "ipsw", "eirr", "tr0", "tr1", "tr2", "tr3",
79 "tr4", "tr5", "tr6", "tr7"
82 static const char *const compare_cond_names
[] =
84 "", ",=", ",<", ",<=", ",<<", ",<<=", ",sv", ",od",
85 ",tr", ",<>", ",>=", ",>", ",>>=", ",>>", ",nsv", ",ev"
87 static const char *const compare_cond_64_names
[] =
89 ",*", ",*=", ",*<", ",*<=", ",*<<", ",*<<=", ",*sv", ",*od",
90 ",*tr", ",*<>", ",*>=", ",*>", ",*>>=", ",*>>", ",*nsv", ",*ev"
92 static const char *const cmpib_cond_64_names
[] =
94 ",*<<", ",*=", ",*<", ",*<=", ",*>>=", ",*<>", ",*>=", ",*>"
96 static const char *const add_cond_names
[] =
98 "", ",=", ",<", ",<=", ",nuv", ",znv", ",sv", ",od",
99 ",tr", ",<>", ",>=", ",>", ",uv", ",vnz", ",nsv", ",ev"
101 static const char *const add_cond_64_names
[] =
103 ",*", ",*=", ",*<", ",*<=", ",*nuv", ",*znv", ",*sv", ",*od",
104 ",*tr", ",*<>", ",*>=", ",*>", ",*uv", ",*vnz", ",*nsv", ",*ev"
106 static const char *const wide_add_cond_names
[] =
108 "", ",=", ",<", ",<=", ",nuv", ",*=", ",*<", ",*<=",
109 ",tr", ",<>", ",>=", ",>", ",uv", ",*<>", ",*>=", ",*>"
111 static const char *const logical_cond_names
[] =
113 "", ",=", ",<", ",<=", 0, 0, 0, ",od",
114 ",tr", ",<>", ",>=", ",>", 0, 0, 0, ",ev"};
115 static const char *const logical_cond_64_names
[] =
117 ",*", ",*=", ",*<", ",*<=", 0, 0, 0, ",*od",
118 ",*tr", ",*<>", ",*>=", ",*>", 0, 0, 0, ",*ev"};
119 static const char *const unit_cond_names
[] =
121 "", ",swz", ",sbz", ",shz", ",sdc", ",swc", ",sbc", ",shc",
122 ",tr", ",nwz", ",nbz", ",nhz", ",ndc", ",nwc", ",nbc", ",nhc"
124 static const char *const unit_cond_64_names
[] =
126 ",*", ",*swz", ",*sbz", ",*shz", ",*sdc", ",*swc", ",*sbc", ",*shc",
127 ",*tr", ",*nwz", ",*nbz", ",*nhz", ",*ndc", ",*nwc", ",*nbc", ",*nhc"
129 static const char *const shift_cond_names
[] =
131 "", ",=", ",<", ",od", ",tr", ",<>", ",>=", ",ev"
133 static const char *const shift_cond_64_names
[] =
135 ",*", ",*=", ",*<", ",*od", ",*tr", ",*<>", ",*>=", ",*ev"
137 static const char *const bb_cond_64_names
[] =
141 static const char *const index_compl_names
[] = {"", ",m", ",s", ",sm"};
142 static const char *const short_ldst_compl_names
[] = {"", ",ma", "", ",mb"};
143 static const char *const short_bytes_compl_names
[] =
145 "", ",b,m", ",e", ",e,m"
147 static const char *const float_format_names
[] = {",sgl", ",dbl", "", ",quad"};
148 static const char *const fcnv_fixed_names
[] = {",w", ",dw", "", ",qw"};
149 static const char *const fcnv_ufixed_names
[] = {",uw", ",udw", "", ",uqw"};
150 static const char *const float_comp_names
[] =
152 ",false?", ",false", ",?", ",!<=>", ",=", ",=t", ",?=", ",!<>",
153 ",!?>=", ",<", ",?<", ",!>=", ",!?>", ",<=", ",?<=", ",!>",
154 ",!?<=", ",>", ",?>", ",!<=", ",!?<", ",>=", ",?>=", ",!<",
155 ",!?=", ",<>", ",!=", ",!=t", ",!?", ",<=>", ",true?", ",true"
157 static const char *const signed_unsigned_names
[] = {",u", ",s"};
158 static const char *const mix_half_names
[] = {",l", ",r"};
159 static const char *const saturation_names
[] = {",us", ",ss", 0, ""};
160 static const char *const read_write_names
[] = {",r", ",w"};
161 static const char *const add_compl_names
[] = { 0, "", ",l", ",tsv" };
163 /* For a bunch of different instructions form an index into a
164 completer name table. */
165 #define GET_COMPL(insn) (GET_FIELD (insn, 26, 26) | \
166 GET_FIELD (insn, 18, 18) << 1)
168 #define GET_COND(insn) (GET_FIELD ((insn), 16, 18) + \
169 (GET_FIELD ((insn), 19, 19) ? 8 : 0))
171 /* Utility function to print registers. Put these first, so gcc's function
172 inlining can do its stuff. */
174 #define fputs_filtered(STR,F) (*info->fprintf_func) (info->stream, "%s", STR)
177 fput_reg (unsigned reg
, disassemble_info
*info
)
179 (*info
->fprintf_func
) (info
->stream
, reg
? reg_names
[reg
] : "r0");
183 fput_fp_reg (unsigned reg
, disassemble_info
*info
)
185 (*info
->fprintf_func
) (info
->stream
, reg
? fp_reg_names
[reg
] : "fr0");
189 fput_fp_reg_r (unsigned reg
, disassemble_info
*info
)
191 /* Special case floating point exception registers. */
193 (*info
->fprintf_func
) (info
->stream
, "fpe%d", reg
* 2 + 1);
195 (*info
->fprintf_func
) (info
->stream
, "%sR",
196 reg
? fp_reg_names
[reg
] : "fr0");
200 fput_creg (unsigned reg
, disassemble_info
*info
)
202 (*info
->fprintf_func
) (info
->stream
, control_reg
[reg
]);
205 /* Print constants with sign. */
208 fput_const (unsigned num
, disassemble_info
*info
)
211 (*info
->fprintf_func
) (info
->stream
, "-%x", - (int) num
);
213 (*info
->fprintf_func
) (info
->stream
, "%x", num
);
216 /* Routines to extract various sized constants out of hppa
219 /* Extract a 3-bit space register number from a be, ble, mtsp or mfsp. */
221 extract_3 (unsigned word
)
223 return GET_FIELD (word
, 18, 18) << 2 | GET_FIELD (word
, 16, 17);
227 extract_5_load (unsigned word
)
229 return low_sign_extend (word
>> 16 & MASK_5
, 5);
232 /* Extract the immediate field from a st{bhw}s instruction. */
235 extract_5_store (unsigned word
)
237 return low_sign_extend (word
& MASK_5
, 5);
240 /* Extract the immediate field from a break instruction. */
243 extract_5r_store (unsigned word
)
245 return (word
& MASK_5
);
248 /* Extract the immediate field from a {sr}sm instruction. */
251 extract_5R_store (unsigned word
)
253 return (word
>> 16 & MASK_5
);
256 /* Extract the 10 bit immediate field from a {sr}sm instruction. */
259 extract_10U_store (unsigned word
)
261 return (word
>> 16 & MASK_10
);
264 /* Extract the immediate field from a bb instruction. */
267 extract_5Q_store (unsigned word
)
269 return (word
>> 21 & MASK_5
);
272 /* Extract an 11 bit immediate field. */
275 extract_11 (unsigned word
)
277 return low_sign_extend (word
& MASK_11
, 11);
280 /* Extract a 14 bit immediate field. */
283 extract_14 (unsigned word
)
285 return low_sign_extend (word
& MASK_14
, 14);
288 /* Extract a 16 bit immediate field (PA2.0 wide only). */
291 extract_16 (unsigned word
)
295 m0
= GET_BIT (word
, 16);
296 m1
= GET_BIT (word
, 17);
297 m15
= GET_BIT (word
, 31);
298 word
= (word
>> 1) & 0x1fff;
299 word
= word
| (m15
<< 15) | ((m15
^ m0
) << 14) | ((m15
^ m1
) << 13);
300 return sign_extend (word
, 16);
303 /* Extract a 21 bit constant. */
306 extract_21 (unsigned word
)
312 val
= GET_FIELD (word
, 20, 20);
314 val
|= GET_FIELD (word
, 9, 19);
316 val
|= GET_FIELD (word
, 5, 6);
318 val
|= GET_FIELD (word
, 0, 4);
320 val
|= GET_FIELD (word
, 7, 8);
321 return sign_extend (val
, 21) << 11;
324 /* Extract a 12 bit constant from branch instructions. */
327 extract_12 (unsigned word
)
329 return sign_extend (GET_FIELD (word
, 19, 28)
330 | GET_FIELD (word
, 29, 29) << 10
331 | (word
& 0x1) << 11, 12) << 2;
334 /* Extract a 17 bit constant from branch instructions, returning the
335 19 bit signed value. */
338 extract_17 (unsigned word
)
340 return sign_extend (GET_FIELD (word
, 19, 28)
341 | GET_FIELD (word
, 29, 29) << 10
342 | GET_FIELD (word
, 11, 15) << 11
343 | (word
& 0x1) << 16, 17) << 2;
347 extract_22 (unsigned word
)
349 return sign_extend (GET_FIELD (word
, 19, 28)
350 | GET_FIELD (word
, 29, 29) << 10
351 | GET_FIELD (word
, 11, 15) << 11
352 | GET_FIELD (word
, 6, 10) << 16
353 | (word
& 0x1) << 21, 22) << 2;
356 /* Print one instruction. */
359 print_insn_hppa (bfd_vma memaddr
, disassemble_info
*info
)
362 unsigned int insn
, i
;
366 (*info
->read_memory_func
) (memaddr
, buffer
, sizeof (buffer
), info
);
369 (*info
->memory_error_func
) (status
, memaddr
, info
);
374 insn
= bfd_getb32 (buffer
);
376 for (i
= 0; i
< NUMOPCODES
; ++i
)
378 const struct pa_opcode
*opcode
= &pa_opcodes
[i
];
380 if ((insn
& opcode
->mask
) == opcode
->match
)
384 if (opcode
->arch
== pa20w
)
387 (*info
->fprintf_func
) (info
->stream
, "%s", opcode
->name
);
389 if (!strchr ("cfCY?-+nHNZFIuv{", opcode
->args
[0]))
390 (*info
->fprintf_func
) (info
->stream
, " ");
391 for (s
= opcode
->args
; *s
!= '\0'; ++s
)
396 fput_reg (GET_FIELD (insn
, 11, 15), info
);
400 fput_reg (GET_FIELD (insn
, 6, 10), info
);
403 fput_creg (GET_FIELD (insn
, 6, 10), info
);
406 fput_reg (GET_FIELD (insn
, 27, 31), info
);
409 /* Handle floating point registers. */
414 fput_fp_reg (GET_FIELD (insn
, 27, 31), info
);
417 if (GET_FIELD (insn
, 25, 25))
418 fput_fp_reg_r (GET_FIELD (insn
, 27, 31), info
);
420 fput_fp_reg (GET_FIELD (insn
, 27, 31), info
);
423 if (GET_FIELD (insn
, 25, 25))
424 fput_fp_reg_r (GET_FIELD (insn
, 6, 10), info
);
426 fput_fp_reg (GET_FIELD (insn
, 6, 10), info
);
429 /* 'fA' will not generate a space before the regsiter
430 name. Normally that is fine. Except that it
431 causes problems with xmpyu which has no FP format
434 fputs_filtered (" ", info
);
438 if (GET_FIELD (insn
, 24, 24))
439 fput_fp_reg_r (GET_FIELD (insn
, 6, 10), info
);
441 fput_fp_reg (GET_FIELD (insn
, 6, 10), info
);
444 if (GET_FIELD (insn
, 25, 25))
445 fput_fp_reg_r (GET_FIELD (insn
, 11, 15), info
);
447 fput_fp_reg (GET_FIELD (insn
, 11, 15), info
);
450 if (GET_FIELD (insn
, 19, 19))
451 fput_fp_reg_r (GET_FIELD (insn
, 11, 15), info
);
453 fput_fp_reg (GET_FIELD (insn
, 11, 15), info
);
457 int reg
= GET_FIELD (insn
, 21, 22);
458 reg
|= GET_FIELD (insn
, 16, 18) << 2;
459 if (GET_FIELD (insn
, 23, 23) != 0)
460 fput_fp_reg_r (reg
, info
);
462 fput_fp_reg (reg
, info
);
467 int reg
= GET_FIELD (insn
, 6, 10);
469 reg
|= (GET_FIELD (insn
, 26, 26) << 4);
470 fput_fp_reg (reg
, info
);
475 int reg
= GET_FIELD (insn
, 11, 15);
477 reg
|= (GET_FIELD (insn
, 26, 26) << 4);
478 fput_fp_reg (reg
, info
);
483 int reg
= GET_FIELD (insn
, 27, 31);
485 reg
|= (GET_FIELD (insn
, 26, 26) << 4);
486 fput_fp_reg (reg
, info
);
491 int reg
= GET_FIELD (insn
, 21, 25);
493 reg
|= (GET_FIELD (insn
, 26, 26) << 4);
494 fput_fp_reg (reg
, info
);
499 int reg
= GET_FIELD (insn
, 16, 20);
501 reg
|= (GET_FIELD (insn
, 26, 26) << 4);
502 fput_fp_reg (reg
, info
);
506 /* 'fe' will not generate a space before the register
507 name. Normally that is fine. Except that it
508 causes problems with fstw fe,y(b) which has no FP
511 fputs_filtered (" ", info
);
515 if (GET_FIELD (insn
, 30, 30))
516 fput_fp_reg_r (GET_FIELD (insn
, 11, 15), info
);
518 fput_fp_reg (GET_FIELD (insn
, 11, 15), info
);
521 fput_fp_reg (GET_FIELD (insn
, 11, 15), info
);
527 fput_const (extract_5_load (insn
), info
);
531 int space
= GET_FIELD (insn
, 16, 17);
532 /* Zero means implicit addressing, not use of sr0. */
534 (*info
->fprintf_func
) (info
->stream
, "sr%d", space
);
539 (*info
->fprintf_func
) (info
->stream
, "sr%d",
543 /* Handle completers. */
548 (*info
->fprintf_func
)
550 index_compl_names
[GET_COMPL (insn
)]);
553 (*info
->fprintf_func
)
554 (info
->stream
, "%s ",
555 index_compl_names
[GET_COMPL (insn
)]);
558 (*info
->fprintf_func
)
560 short_ldst_compl_names
[GET_COMPL (insn
)]);
563 (*info
->fprintf_func
)
564 (info
->stream
, "%s ",
565 short_ldst_compl_names
[GET_COMPL (insn
)]);
568 (*info
->fprintf_func
)
569 (info
->stream
, "%s ",
570 short_bytes_compl_names
[GET_COMPL (insn
)]);
573 (*info
->fprintf_func
)
575 short_bytes_compl_names
[GET_COMPL (insn
)]);
579 switch (GET_FIELD (insn
, 20, 21))
582 (*info
->fprintf_func
) (info
->stream
, ",bc ");
585 (*info
->fprintf_func
) (info
->stream
, ",sl ");
588 (*info
->fprintf_func
) (info
->stream
, " ");
592 switch (GET_FIELD (insn
, 20, 21))
595 (*info
->fprintf_func
) (info
->stream
, ",co ");
598 (*info
->fprintf_func
) (info
->stream
, " ");
602 (*info
->fprintf_func
) (info
->stream
, ",o");
605 (*info
->fprintf_func
) (info
->stream
, ",gate");
608 (*info
->fprintf_func
) (info
->stream
, ",l,push");
611 (*info
->fprintf_func
) (info
->stream
, ",pop");
615 (*info
->fprintf_func
) (info
->stream
, ",l");
618 (*info
->fprintf_func
)
619 (info
->stream
, "%s ",
620 read_write_names
[GET_FIELD (insn
, 25, 25)]);
623 (*info
->fprintf_func
) (info
->stream
, ",w ");
626 if (GET_FIELD (insn
, 23, 26) == 5)
627 (*info
->fprintf_func
) (info
->stream
, ",r");
630 if (GET_FIELD (insn
, 26, 26))
631 (*info
->fprintf_func
) (info
->stream
, ",m ");
633 (*info
->fprintf_func
) (info
->stream
, " ");
636 if (GET_FIELD (insn
, 25, 25))
637 (*info
->fprintf_func
) (info
->stream
, ",i");
640 if (!GET_FIELD (insn
, 21, 21))
641 (*info
->fprintf_func
) (info
->stream
, ",z");
644 (*info
->fprintf_func
)
646 add_compl_names
[GET_FIELD (insn
, 20, 21)]);
649 (*info
->fprintf_func
)
650 (info
->stream
, ",dc%s",
651 add_compl_names
[GET_FIELD (insn
, 20, 21)]);
654 (*info
->fprintf_func
)
655 (info
->stream
, ",c%s",
656 add_compl_names
[GET_FIELD (insn
, 20, 21)]);
659 if (GET_FIELD (insn
, 20, 20))
660 (*info
->fprintf_func
) (info
->stream
, ",tsv");
663 (*info
->fprintf_func
) (info
->stream
, ",tc");
664 if (GET_FIELD (insn
, 20, 20))
665 (*info
->fprintf_func
) (info
->stream
, ",tsv");
668 (*info
->fprintf_func
) (info
->stream
, ",db");
669 if (GET_FIELD (insn
, 20, 20))
670 (*info
->fprintf_func
) (info
->stream
, ",tsv");
673 (*info
->fprintf_func
) (info
->stream
, ",b");
674 if (GET_FIELD (insn
, 20, 20))
675 (*info
->fprintf_func
) (info
->stream
, ",tsv");
678 if (GET_FIELD (insn
, 25, 25))
679 (*info
->fprintf_func
) (info
->stream
, ",tc");
682 /* EXTRD/W has a following condition. */
684 (*info
->fprintf_func
)
686 signed_unsigned_names
[GET_FIELD (insn
, 21, 21)]);
688 (*info
->fprintf_func
)
689 (info
->stream
, "%s ",
690 signed_unsigned_names
[GET_FIELD (insn
, 21, 21)]);
693 (*info
->fprintf_func
)
695 mix_half_names
[GET_FIELD (insn
, 17, 17)]);
698 (*info
->fprintf_func
)
699 (info
->stream
, "%s ",
700 saturation_names
[GET_FIELD (insn
, 24, 25)]);
703 (*info
->fprintf_func
)
704 (info
->stream
, ",%d%d%d%d ",
705 GET_FIELD (insn
, 17, 18), GET_FIELD (insn
, 20, 21),
706 GET_FIELD (insn
, 22, 23), GET_FIELD (insn
, 24, 25));
713 m
= GET_FIELD (insn
, 28, 28);
714 a
= GET_FIELD (insn
, 29, 29);
717 fputs_filtered (",ma ", info
);
719 fputs_filtered (",mb ", info
);
721 fputs_filtered (" ", info
);
727 int opc
= GET_FIELD (insn
, 0, 5);
729 if (opc
== 0x16 || opc
== 0x1e)
731 if (GET_FIELD (insn
, 29, 29) == 0)
732 fputs_filtered (",ma ", info
);
734 fputs_filtered (",mb ", info
);
737 fputs_filtered (" ", info
);
743 int opc
= GET_FIELD (insn
, 0, 5);
745 if (opc
== 0x13 || opc
== 0x1b)
747 if (GET_FIELD (insn
, 18, 18) == 1)
748 fputs_filtered (",mb ", info
);
750 fputs_filtered (",ma ", info
);
752 else if (opc
== 0x17 || opc
== 0x1f)
754 if (GET_FIELD (insn
, 31, 31) == 1)
755 fputs_filtered (",ma ", info
);
757 fputs_filtered (",mb ", info
);
760 fputs_filtered (" ", info
);
767 /* Handle conditions. */
774 (*info
->fprintf_func
)
775 (info
->stream
, "%s ",
776 float_comp_names
[GET_FIELD (insn
, 27, 31)]);
779 /* These four conditions are for the set of instructions
780 which distinguish true/false conditions by opcode
781 rather than by the 'f' bit (sigh): comb, comib,
785 (compare_cond_names
[GET_FIELD (insn
, 16, 18)], info
);
789 (compare_cond_names
[GET_FIELD (insn
, 16, 18)
790 + GET_FIELD (insn
, 4, 4) * 8],
795 (compare_cond_64_names
[GET_FIELD (insn
, 16, 18)
796 + GET_FIELD (insn
, 2, 2) * 8],
801 (cmpib_cond_64_names
[GET_FIELD (insn
, 16, 18)],
806 (add_cond_names
[GET_FIELD (insn
, 16, 18)
807 + GET_FIELD (insn
, 4, 4) * 8],
811 (*info
->fprintf_func
)
812 (info
->stream
, "%s ",
813 compare_cond_names
[GET_COND (insn
)]);
816 (*info
->fprintf_func
)
817 (info
->stream
, "%s ",
818 compare_cond_64_names
[GET_COND (insn
)]);
821 (*info
->fprintf_func
)
822 (info
->stream
, "%s ",
823 add_cond_names
[GET_COND (insn
)]);
826 (*info
->fprintf_func
)
827 (info
->stream
, "%s ",
828 add_cond_64_names
[GET_COND (insn
)]);
831 (*info
->fprintf_func
)
833 add_cond_names
[GET_FIELD (insn
, 16, 18)]);
837 (*info
->fprintf_func
)
839 wide_add_cond_names
[GET_FIELD (insn
, 16, 18) +
840 GET_FIELD (insn
, 4, 4) * 8]);
844 (*info
->fprintf_func
)
845 (info
->stream
, "%s ",
846 logical_cond_names
[GET_COND (insn
)]);
849 (*info
->fprintf_func
)
850 (info
->stream
, "%s ",
851 logical_cond_64_names
[GET_COND (insn
)]);
854 (*info
->fprintf_func
)
855 (info
->stream
, "%s ",
856 unit_cond_names
[GET_COND (insn
)]);
859 (*info
->fprintf_func
)
860 (info
->stream
, "%s ",
861 unit_cond_64_names
[GET_COND (insn
)]);
866 (*info
->fprintf_func
)
868 shift_cond_names
[GET_FIELD (insn
, 16, 18)]);
870 /* If the next character in args is 'n', it will handle
871 putting out the space. */
873 (*info
->fprintf_func
) (info
->stream
, " ");
876 (*info
->fprintf_func
)
877 (info
->stream
, "%s ",
878 shift_cond_64_names
[GET_FIELD (insn
, 16, 18)]);
881 (*info
->fprintf_func
)
883 bb_cond_64_names
[GET_FIELD (insn
, 16, 16)]);
885 /* If the next character in args is 'n', it will handle
886 putting out the space. */
888 (*info
->fprintf_func
) (info
->stream
, " ");
895 fput_const (extract_5_store (insn
), info
);
898 fput_const (extract_5r_store (insn
), info
);
901 fput_const (extract_5R_store (insn
), info
);
904 fput_const (extract_10U_store (insn
), info
);
908 fput_const (extract_5Q_store (insn
), info
);
911 fput_const (extract_11 (insn
), info
);
914 fput_const (extract_14 (insn
), info
);
917 fputs_filtered ("L%", info
);
918 fput_const (extract_21 (insn
), info
);
922 /* 16-bit long disp., PA2.0 wide only. */
923 fput_const (extract_16 (insn
), info
);
927 (*info
->fprintf_func
) (info
->stream
, ",n ");
929 (*info
->fprintf_func
) (info
->stream
, " ");
932 if ((insn
& 0x20) && s
[1])
933 (*info
->fprintf_func
) (info
->stream
, ",n ");
934 else if (insn
& 0x20)
935 (*info
->fprintf_func
) (info
->stream
, ",n");
937 (*info
->fprintf_func
) (info
->stream
, " ");
940 (*info
->print_address_func
)
941 (memaddr
+ 8 + extract_12 (insn
), info
);
944 /* 17 bit PC-relative branch. */
945 (*info
->print_address_func
)
946 ((memaddr
+ 8 + extract_17 (insn
)), info
);
949 /* 17 bit displacement. This is an offset from a register
950 so it gets disasssembled as just a number, not any sort
952 fput_const (extract_17 (insn
), info
);
956 /* addil %r1 implicit output. */
957 fputs_filtered ("r1", info
);
961 /* be,l %sr0,%r31 implicit output. */
962 fputs_filtered ("sr0,r31", info
);
966 (*info
->fprintf_func
) (info
->stream
, "0");
970 (*info
->fprintf_func
) (info
->stream
, "%d",
971 GET_FIELD (insn
, 24, 25));
974 (*info
->fprintf_func
) (info
->stream
, "%d",
975 GET_FIELD (insn
, 22, 25));
978 fputs_filtered ("sar", info
);
981 (*info
->fprintf_func
) (info
->stream
, "%d",
982 31 - GET_FIELD (insn
, 22, 26));
987 num
= GET_FIELD (insn
, 20, 20) << 5;
988 num
|= GET_FIELD (insn
, 22, 26);
989 (*info
->fprintf_func
) (info
->stream
, "%d", 63 - num
);
993 (*info
->fprintf_func
) (info
->stream
, "%d",
994 GET_FIELD (insn
, 22, 26));
999 num
= GET_FIELD (insn
, 20, 20) << 5;
1000 num
|= GET_FIELD (insn
, 22, 26);
1001 (*info
->fprintf_func
) (info
->stream
, "%d", num
);
1005 (*info
->fprintf_func
) (info
->stream
, "%d",
1006 32 - GET_FIELD (insn
, 27, 31));
1011 num
= (GET_FIELD (insn
, 23, 23) + 1) * 32;
1012 num
-= GET_FIELD (insn
, 27, 31);
1013 (*info
->fprintf_func
) (info
->stream
, "%d", num
);
1019 num
= (GET_FIELD (insn
, 19, 19) + 1) * 32;
1020 num
-= GET_FIELD (insn
, 27, 31);
1021 (*info
->fprintf_func
) (info
->stream
, "%d", num
);
1025 fput_const (GET_FIELD (insn
, 20, 28), info
);
1028 fput_const (GET_FIELD (insn
, 6, 18), info
);
1031 fput_const (GET_FIELD (insn
, 6, 31), info
);
1034 (*info
->fprintf_func
) (info
->stream
, ",%d",
1035 GET_FIELD (insn
, 23, 25));
1038 fput_const ((GET_FIELD (insn
, 6,20) << 5 |
1039 GET_FIELD (insn
, 27, 31)), info
);
1042 fput_const (GET_FIELD (insn
, 6, 20), info
);
1045 fput_const ((GET_FIELD (insn
, 6, 22) << 5 |
1046 GET_FIELD (insn
, 27, 31)), info
);
1049 fput_const ((GET_FIELD (insn
, 11, 20) << 5 |
1050 GET_FIELD (insn
, 27, 31)), info
);
1053 fput_const ((GET_FIELD (insn
, 16, 20) << 5 |
1054 GET_FIELD (insn
, 27, 31)), info
);
1057 (*info
->fprintf_func
) (info
->stream
, ",%d",
1058 GET_FIELD (insn
, 23, 25));
1061 /* If no destination completer and not before a completer
1062 for fcmp, need a space here. */
1063 if (s
[1] == 'G' || s
[1] == '?')
1065 (float_format_names
[GET_FIELD (insn
, 19, 20)], info
);
1067 (*info
->fprintf_func
)
1068 (info
->stream
, "%s ",
1069 float_format_names
[GET_FIELD (insn
, 19, 20)]);
1072 (*info
->fprintf_func
)
1073 (info
->stream
, "%s ",
1074 float_format_names
[GET_FIELD (insn
, 17, 18)]);
1077 if (GET_FIELD (insn
, 26, 26) == 1)
1078 (*info
->fprintf_func
) (info
->stream
, "%s ",
1079 float_format_names
[0]);
1081 (*info
->fprintf_func
) (info
->stream
, "%s ",
1082 float_format_names
[1]);
1085 /* If no destination completer and not before a completer
1086 for fcmp, need a space here. */
1089 (float_format_names
[GET_FIELD (insn
, 20, 20)], info
);
1091 (*info
->fprintf_func
)
1092 (info
->stream
, "%s ",
1093 float_format_names
[GET_FIELD (insn
, 20, 20)]);
1097 fput_const (extract_14 (insn
), info
);
1102 int sign
= GET_FIELD (insn
, 31, 31);
1103 int imm10
= GET_FIELD (insn
, 18, 27);
1107 disp
= (-1 << 10) | imm10
;
1112 fput_const (disp
, info
);
1118 int sign
= GET_FIELD (insn
, 31, 31);
1119 int imm11
= GET_FIELD (insn
, 18, 28);
1123 disp
= (-1 << 11) | imm11
;
1128 fput_const (disp
, info
);
1135 /* 16-bit long disp., PA2.0 wide only. */
1136 int disp
= extract_16 (insn
);
1138 fput_const (disp
, info
);
1144 /* 16-bit long disp., PA2.0 wide only. */
1145 int disp
= extract_16 (insn
);
1147 fput_const (disp
, info
);
1152 break; /* Dealt with by '{' */
1156 int sub
= GET_FIELD (insn
, 14, 16);
1157 int df
= GET_FIELD (insn
, 17, 18);
1158 int sf
= GET_FIELD (insn
, 19, 20);
1159 const char * const * source
= float_format_names
;
1160 const char * const * dest
= float_format_names
;
1165 fputs_filtered (",UND ", info
);
1171 source
= sub
& 4 ? fcnv_ufixed_names
: fcnv_fixed_names
;
1173 dest
= sub
& 4 ? fcnv_ufixed_names
: fcnv_fixed_names
;
1175 (*info
->fprintf_func
) (info
->stream
, "%s%s%s ",
1176 t
, source
[sf
], dest
[df
]);
1182 int y
= GET_FIELD (insn
, 16, 18);
1185 fput_const ((y
^ 1) - 1, info
);
1193 cbit
= GET_FIELD (insn
, 16, 18);
1196 (*info
->fprintf_func
) (info
->stream
, ",%d", cbit
- 1);
1202 int cond
= GET_FIELD (insn
, 27, 31);
1206 case 0: fputs_filtered (" ", info
); break;
1207 case 1: fputs_filtered ("acc ", info
); break;
1208 case 2: fputs_filtered ("rej ", info
); break;
1209 case 5: fputs_filtered ("acc8 ", info
); break;
1210 case 6: fputs_filtered ("rej8 ", info
); break;
1211 case 9: fputs_filtered ("acc6 ", info
); break;
1212 case 13: fputs_filtered ("acc4 ", info
); break;
1213 case 17: fputs_filtered ("acc2 ", info
); break;
1220 (*info
->print_address_func
)
1221 (memaddr
+ 8 + extract_22 (insn
), info
);
1224 fputs_filtered (",rp", info
);
1227 (*info
->fprintf_func
) (info
->stream
, "%c", *s
);
1231 return sizeof (insn
);
1234 (*info
->fprintf_func
) (info
->stream
, "#%8x", insn
);
1235 return sizeof (insn
);