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 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 program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
25 #include "opcode/hppa.h"
27 /* Integer register names, indexed by the numbers which appear in the
29 static const char *const reg_names[] =
30 {"flags", "r1", "rp", "r3", "r4", "r5", "r6", "r7", "r8", "r9",
31 "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19",
32 "r20", "r21", "r22", "r23", "r24", "r25", "r26", "dp", "ret0", "ret1",
35 /* Floating point register names, indexed by the numbers which appear in the
37 static const char *const fp_reg_names[] =
38 {"fpsr", "fpe2", "fpe4", "fpe6",
39 "fr4", "fr5", "fr6", "fr7", "fr8",
40 "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15",
41 "fr16", "fr17", "fr18", "fr19", "fr20", "fr21", "fr22", "fr23",
42 "fr24", "fr25", "fr26", "fr27", "fr28", "fr29", "fr30", "fr31"};
44 typedef unsigned int CORE_ADDR;
46 /* Get at various relevent fields of an instruction word. */
51 #define MASK_14 0x3fff
52 #define MASK_16 0xffff
53 #define MASK_21 0x1fffff
55 /* These macros get bit fields using HP's numbering (MSB = 0) */
57 #define GET_FIELD(X, FROM, TO) \
58 ((X) >> (31 - (TO)) & ((1 << ((TO) - (FROM) + 1)) - 1))
60 #define GET_BIT(X, WHICH) \
61 GET_FIELD (X, WHICH, WHICH)
63 /* Some of these have been converted to 2-d arrays because they
64 consume less storage this way. If the maintenance becomes a
65 problem, convert them back to const 1-d pointer arrays. */
66 static const char *const control_reg[] = {
67 "rctr", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7",
68 "pidr1", "pidr2", "ccr", "sar", "pidr3", "pidr4",
69 "iva", "eiem", "itmr", "pcsq", "pcoq", "iir", "isr",
70 "ior", "ipsw", "eirr", "tr0", "tr1", "tr2", "tr3",
71 "tr4", "tr5", "tr6", "tr7"
74 static const char *const compare_cond_names[] = {
75 "", ",=", ",<", ",<=", ",<<", ",<<=", ",sv", ",od",
76 ",tr", ",<>", ",>=", ",>", ",>>=", ",>>", ",nsv", ",ev"
78 static const char *const compare_cond_64_names[] = {
79 "", ",*=", ",*<", ",*<=", ",*<<", ",*<<=", ",*sv", ",*od",
80 ",*tr", ",*<>", ",*>=", ",*>", ",*>>=", ",*>>", ",*nsv", ",*ev"
82 static const char *const cmpib_cond_64_names[] = {
83 ",*<<", ",*=", ",*<", ",*<=", ",*>>=", ",*<>", ",*>=", ",*>"
85 static const char *const add_cond_names[] = {
86 "", ",=", ",<", ",<=", ",nuv", ",znv", ",sv", ",od",
87 ",tr", ",<>", ",>=", ",>", ",uv", ",vnz", ",nsv", ",ev"
89 static const char *const add_cond_64_names[] = {
90 "", ",*=", ",*<", ",*<=", ",*nuv", ",*znv", ",*sv", ",*od",
91 ",*tr", ",*<>", ",*>=", ",*>", ",*uv", ",*vnz", ",*nsv", ",*ev"
93 static const char *const wide_add_cond_names[] = {
94 "", ",=", ",<", ",<=", ",nuv", ",*=", ",*<", ",*<=",
95 ",tr", ",<>", ",>=", ",>", ",uv", ",*<>", ",*>=", ",*>"
97 static const char *const logical_cond_names[] = {
98 "", ",=", ",<", ",<=", 0, 0, 0, ",od",
99 ",tr", ",<>", ",>=", ",>", 0, 0, 0, ",ev"};
100 static const char *const logical_cond_64_names[] = {
101 "", ",*=", ",*<", ",*<=", 0, 0, 0, ",*od",
102 ",*tr", ",*<>", ",*>=", ",*>", 0, 0, 0, ",*ev"};
103 static const char *const unit_cond_names[] = {
104 "", ",swz", ",sbz", ",shz", ",sdc", ",swc", ",sbc", ",shc",
105 ",tr", ",nwz", ",nbz", ",nhz", ",ndc", ",nwc", ",nbc", ",nhc"
107 static const char *const unit_cond_64_names[] = {
108 "", ",*swz", ",*sbz", ",*shz", ",*sdc", ",*swc", ",*sbc", ",*shc",
109 ",*tr", ",*nwz", ",*nbz", ",*nhz", ",*ndc", ",*nwc", ",*nbc", ",*nhc"
111 static const char *const shift_cond_names[] = {
112 "", ",=", ",<", ",od", ",tr", ",<>", ",>=", ",ev"
114 static const char *const shift_cond_64_names[] = {
115 "", ",*=", ",*<", ",*od", ",*tr", ",*<>", ",*>=", ",*ev"
117 static const char *const bb_cond_64_names[] = {
120 static const char *const index_compl_names[] = {"", ",m", ",s", ",sm"};
121 static const char *const short_ldst_compl_names[] = {"", ",ma", "", ",mb"};
122 static const char *const short_bytes_compl_names[] = {
123 "", ",b,m", ",e", ",e,m"
125 static const char *const float_format_names[] = {",sgl", ",dbl", "", ",quad"};
126 static const char *const fcnv_fixed_names[] = {",w", ",dw", "", ",qw"};
127 static const char *const fcnv_ufixed_names[] = {",uw", ",udw", "", ",uqw"};
128 static const char *const float_comp_names[] =
130 ",false?", ",false", ",?", ",!<=>", ",=", ",=t", ",?=", ",!<>",
131 ",!?>=", ",<", ",?<", ",!>=", ",!?>", ",<=", ",?<=", ",!>",
132 ",!?<=", ",>", ",?>", ",!<=", ",!?<", ",>=", ",?>=", ",!<",
133 ",!?=", ",<>", ",!=", ",!=t", ",!?", ",<=>", ",true?", ",true"
135 static const char *const signed_unsigned_names[] = {",u", ",s"};
136 static const char *const mix_half_names[] = {",l", ",r"};
137 static const char *const saturation_names[] = {",us", ",ss", 0, ""};
138 static const char *const read_write_names[] = {",r", ",w"};
139 static const char *const add_compl_names[] = { 0, "", ",l", ",tsv" };
141 /* For a bunch of different instructions form an index into a
142 completer name table. */
143 #define GET_COMPL(insn) (GET_FIELD (insn, 26, 26) | \
144 GET_FIELD (insn, 18, 18) << 1)
146 #define GET_COND(insn) (GET_FIELD ((insn), 16, 18) + \
147 (GET_FIELD ((insn), 19, 19) ? 8 : 0))
149 static void fput_reg PARAMS ((unsigned int, disassemble_info *));
150 static void fput_fp_reg PARAMS ((unsigned int, disassemble_info *));
151 static void fput_fp_reg_r PARAMS ((unsigned int, disassemble_info *));
152 static void fput_creg PARAMS ((unsigned int, disassemble_info *));
153 static void fput_const PARAMS ((unsigned int, disassemble_info *));
154 static int extract_3 PARAMS ((unsigned int));
155 static int extract_5_load PARAMS ((unsigned int));
156 static int extract_5_store PARAMS ((unsigned int));
157 static unsigned extract_5r_store PARAMS ((unsigned int));
158 static unsigned extract_5R_store PARAMS ((unsigned int));
159 static unsigned extract_10U_store PARAMS ((unsigned int));
160 static unsigned extract_5Q_store PARAMS ((unsigned int));
161 static int extract_11 PARAMS ((unsigned int));
162 static int extract_14 PARAMS ((unsigned int));
163 static int extract_16 PARAMS ((unsigned int));
164 static int extract_21 PARAMS ((unsigned int));
165 static int extract_12 PARAMS ((unsigned int));
166 static int extract_17 PARAMS ((unsigned int));
167 static int extract_22 PARAMS ((unsigned int));
169 /* Utility function to print registers. Put these first, so gcc's function
170 inlining can do its stuff. */
172 #define fputs_filtered(STR,F) (*info->fprintf_func) (info->stream, "%s", STR)
177 disassemble_info *info;
179 (*info->fprintf_func) (info->stream, reg ? reg_names[reg] : "r0");
183 fput_fp_reg (reg, info)
185 disassemble_info *info;
187 (*info->fprintf_func) (info->stream, reg ? fp_reg_names[reg] : "fr0");
191 fput_fp_reg_r (reg, info)
193 disassemble_info *info;
195 /* Special case floating point exception registers. */
197 (*info->fprintf_func) (info->stream, "fpe%d", reg * 2 + 1);
199 (*info->fprintf_func) (info->stream, "%sR",
200 reg ? fp_reg_names[reg] : "fr0");
204 fput_creg (reg, info)
206 disassemble_info *info;
208 (*info->fprintf_func) (info->stream, control_reg[reg]);
211 /* Print constants with sign. */
214 fput_const (num, info)
216 disassemble_info *info;
219 (*info->fprintf_func) (info->stream, "-%x", -(int)num);
221 (*info->fprintf_func) (info->stream, "%x", num);
224 /* Routines to extract various sized constants out of hppa
227 /* Extract a 3-bit space register number from a be, ble, mtsp or mfsp. */
232 return GET_FIELD (word, 18, 18) << 2 | GET_FIELD (word, 16, 17);
236 extract_5_load (word)
239 return low_sign_extend (word >> 16 & MASK_5, 5);
242 /* Extract the immediate field from a st{bhw}s instruction. */
244 extract_5_store (word)
247 return low_sign_extend (word & MASK_5, 5);
250 /* Extract the immediate field from a break instruction. */
252 extract_5r_store (word)
255 return (word & MASK_5);
258 /* Extract the immediate field from a {sr}sm instruction. */
260 extract_5R_store (word)
263 return (word >> 16 & MASK_5);
266 /* Extract the 10 bit immediate field from a {sr}sm instruction. */
268 extract_10U_store (word)
271 return (word >> 16 & MASK_10);
274 /* Extract the immediate field from a bb instruction. */
276 extract_5Q_store (word)
279 return (word >> 21 & MASK_5);
282 /* Extract an 11 bit immediate field. */
287 return low_sign_extend (word & MASK_11, 11);
290 /* Extract a 14 bit immediate field. */
295 return low_sign_extend (word & MASK_14, 14);
298 /* Extract a 16 bit immediate field (PA2.0 wide only). */
304 m0 = GET_BIT (word, 16);
305 m1 = GET_BIT (word, 17);
306 m15 = GET_BIT (word, 31);
307 word = (word >> 1) & 0x1fff;
308 word = word | (m15 << 15) | ((m15 ^ m0) << 14) | ((m15 ^ m1) << 13);
309 return sign_extend (word, 16);
312 /* Extract a 21 bit constant. */
322 val = GET_FIELD (word, 20, 20);
324 val |= GET_FIELD (word, 9, 19);
326 val |= GET_FIELD (word, 5, 6);
328 val |= GET_FIELD (word, 0, 4);
330 val |= GET_FIELD (word, 7, 8);
331 return sign_extend (val, 21) << 11;
334 /* Extract a 12 bit constant from branch instructions. */
340 return sign_extend (GET_FIELD (word, 19, 28) |
341 GET_FIELD (word, 29, 29) << 10 |
342 (word & 0x1) << 11, 12) << 2;
345 /* Extract a 17 bit constant from branch instructions, returning the
346 19 bit signed value. */
352 return sign_extend (GET_FIELD (word, 19, 28) |
353 GET_FIELD (word, 29, 29) << 10 |
354 GET_FIELD (word, 11, 15) << 11 |
355 (word & 0x1) << 16, 17) << 2;
362 return sign_extend (GET_FIELD (word, 19, 28) |
363 GET_FIELD (word, 29, 29) << 10 |
364 GET_FIELD (word, 11, 15) << 11 |
365 GET_FIELD (word, 6, 10) << 16 |
366 (word & 0x1) << 21, 22) << 2;
369 /* Print one instruction. */
371 print_insn_hppa (memaddr, info)
373 disassemble_info *info;
376 unsigned int insn, i;
380 (*info->read_memory_func) (memaddr, buffer, sizeof (buffer), info);
383 (*info->memory_error_func) (status, memaddr, info);
388 insn = bfd_getb32 (buffer);
390 for (i = 0; i < NUMOPCODES; ++i)
392 const struct pa_opcode *opcode = &pa_opcodes[i];
393 if ((insn & opcode->mask) == opcode->match)
395 register const char *s;
397 if (opcode->arch == pa20w)
400 (*info->fprintf_func) (info->stream, "%s", opcode->name);
402 if (!strchr ("cfCY?-+nHNZFIuv{", opcode->args[0]))
403 (*info->fprintf_func) (info->stream, " ");
404 for (s = opcode->args; *s != '\0'; ++s)
409 fput_reg (GET_FIELD (insn, 11, 15), info);
413 fput_reg (GET_FIELD (insn, 6, 10), info);
416 fput_creg (GET_FIELD (insn, 6, 10), info);
419 fput_reg (GET_FIELD (insn, 27, 31), info);
422 /* Handle floating point registers. */
427 fput_fp_reg (GET_FIELD (insn, 27, 31), info);
430 if (GET_FIELD (insn, 25, 25))
431 fput_fp_reg_r (GET_FIELD (insn, 27, 31), info);
433 fput_fp_reg (GET_FIELD (insn, 27, 31), info);
436 if (GET_FIELD (insn, 25, 25))
437 fput_fp_reg_r (GET_FIELD (insn, 6, 10), info);
439 fput_fp_reg (GET_FIELD (insn, 6, 10), info);
442 /* 'fA' will not generate a space before the regsiter
443 name. Normally that is fine. Except that it
444 causes problems with xmpyu which has no FP format
447 fputs_filtered (" ", info);
451 if (GET_FIELD (insn, 24, 24))
452 fput_fp_reg_r (GET_FIELD (insn, 6, 10), info);
454 fput_fp_reg (GET_FIELD (insn, 6, 10), info);
457 if (GET_FIELD (insn, 25, 25))
458 fput_fp_reg_r (GET_FIELD (insn, 11, 15), info);
460 fput_fp_reg (GET_FIELD (insn, 11, 15), info);
463 if (GET_FIELD (insn, 19, 19))
464 fput_fp_reg_r (GET_FIELD (insn, 11, 15), info);
466 fput_fp_reg (GET_FIELD (insn, 11, 15), info);
470 int reg = GET_FIELD (insn, 21, 22);
471 reg |= GET_FIELD (insn, 16, 18) << 2;
472 if (GET_FIELD (insn, 23, 23) != 0)
473 fput_fp_reg_r (reg, info);
475 fput_fp_reg (reg, info);
480 int reg = GET_FIELD (insn, 6, 10);
482 reg |= (GET_FIELD (insn, 26, 26) << 4);
483 fput_fp_reg (reg, info);
488 int reg = GET_FIELD (insn, 11, 15);
490 reg |= (GET_FIELD (insn, 26, 26) << 4);
491 fput_fp_reg (reg, info);
496 int reg = GET_FIELD (insn, 27, 31);
498 reg |= (GET_FIELD (insn, 26, 26) << 4);
499 fput_fp_reg (reg, info);
504 int reg = GET_FIELD (insn, 21, 25);
506 reg |= (GET_FIELD (insn, 26, 26) << 4);
507 fput_fp_reg (reg, info);
512 int reg = GET_FIELD (insn, 16, 20);
514 reg |= (GET_FIELD (insn, 26, 26) << 4);
515 fput_fp_reg (reg, info);
519 /* 'fe' will not generate a space before the register
520 name. Normally that is fine. Except that it
521 causes problems with fstw fe,y(b) which has no FP
524 fputs_filtered (" ", info);
528 if (GET_FIELD (insn, 30, 30))
529 fput_fp_reg_r (GET_FIELD (insn, 11, 15), info);
531 fput_fp_reg (GET_FIELD (insn, 11, 15), info);
534 fput_fp_reg (GET_FIELD (insn, 11, 15), info);
540 fput_const (extract_5_load (insn), info);
544 int space = GET_FIELD (insn, 16, 17);
545 /* Zero means implicit addressing, not use of sr0. */
547 (*info->fprintf_func) (info->stream, "sr%d", space);
552 (*info->fprintf_func) (info->stream, "sr%d",
556 /* Handle completers. */
561 (*info->fprintf_func)
563 index_compl_names[GET_COMPL (insn)]);
566 (*info->fprintf_func)
567 (info->stream, "%s ",
568 index_compl_names[GET_COMPL (insn)]);
571 (*info->fprintf_func)
573 short_ldst_compl_names[GET_COMPL (insn)]);
576 (*info->fprintf_func)
577 (info->stream, "%s ",
578 short_ldst_compl_names[GET_COMPL (insn)]);
581 (*info->fprintf_func)
582 (info->stream, "%s ",
583 short_bytes_compl_names[GET_COMPL (insn)]);
586 (*info->fprintf_func)
588 short_bytes_compl_names[GET_COMPL (insn)]);
592 switch (GET_FIELD (insn, 20, 21))
595 (*info->fprintf_func) (info->stream, ",bc ");
598 (*info->fprintf_func) (info->stream, ",sl ");
601 (*info->fprintf_func) (info->stream, " ");
605 switch (GET_FIELD (insn, 20, 21))
608 (*info->fprintf_func) (info->stream, ",co ");
611 (*info->fprintf_func) (info->stream, " ");
615 (*info->fprintf_func) (info->stream, ",o");
618 (*info->fprintf_func) (info->stream, ",gate");
621 (*info->fprintf_func) (info->stream, ",l,push");
624 (*info->fprintf_func) (info->stream, ",pop");
628 (*info->fprintf_func) (info->stream, ",l");
631 (*info->fprintf_func)
632 (info->stream, "%s ",
633 read_write_names[GET_FIELD (insn, 25, 25)]);
636 (*info->fprintf_func) (info->stream, ",w");
639 if (GET_FIELD (insn, 23, 26) == 5)
640 (*info->fprintf_func) (info->stream, ",r");
643 if (GET_FIELD (insn, 26, 26))
644 (*info->fprintf_func) (info->stream, ",m ");
646 (*info->fprintf_func) (info->stream, " ");
649 if (GET_FIELD (insn, 25, 25))
650 (*info->fprintf_func) (info->stream, ",i");
653 if (!GET_FIELD (insn, 21, 21))
654 (*info->fprintf_func) (info->stream, ",z");
657 (*info->fprintf_func)
659 add_compl_names[GET_FIELD (insn, 20, 21)]);
662 (*info->fprintf_func)
663 (info->stream, ",dc%s",
664 add_compl_names[GET_FIELD (insn, 20, 21)]);
667 (*info->fprintf_func)
668 (info->stream, ",c%s",
669 add_compl_names[GET_FIELD (insn, 20, 21)]);
672 if (GET_FIELD (insn, 20, 20))
673 (*info->fprintf_func) (info->stream, ",tsv");
676 (*info->fprintf_func) (info->stream, ",tc");
677 if (GET_FIELD (insn, 20, 20))
678 (*info->fprintf_func) (info->stream, ",tsv");
681 (*info->fprintf_func) (info->stream, ",db");
682 if (GET_FIELD (insn, 20, 20))
683 (*info->fprintf_func) (info->stream, ",tsv");
686 (*info->fprintf_func) (info->stream, ",b");
687 if (GET_FIELD (insn, 20, 20))
688 (*info->fprintf_func) (info->stream, ",tsv");
691 if (GET_FIELD (insn, 25, 25))
692 (*info->fprintf_func) (info->stream, ",tc");
695 /* EXTRD/W has a following condition. */
697 (*info->fprintf_func)
699 signed_unsigned_names[GET_FIELD (insn, 21, 21)]);
701 (*info->fprintf_func)
702 (info->stream, "%s ",
703 signed_unsigned_names[GET_FIELD (insn, 21, 21)]);
706 (*info->fprintf_func)
708 mix_half_names[GET_FIELD (insn, 17, 17)]);
711 (*info->fprintf_func)
712 (info->stream, "%s ",
713 saturation_names[GET_FIELD (insn, 24, 25)]);
716 (*info->fprintf_func)
717 (info->stream, ",%d%d%d%d ",
718 GET_FIELD (insn, 17, 18), GET_FIELD (insn, 20, 21),
719 GET_FIELD (insn, 22, 23), GET_FIELD (insn, 24, 25));
726 m = GET_FIELD (insn, 28, 28);
727 a = GET_FIELD (insn, 29, 29);
730 fputs_filtered (",ma ", info);
732 fputs_filtered (",mb ", info);
734 fputs_filtered (" ", info);
740 int opc = GET_FIELD (insn, 0, 5);
742 if (opc == 0x16 || opc == 0x1e)
744 if (GET_FIELD (insn, 29, 29) == 0)
745 fputs_filtered (",ma ", info);
747 fputs_filtered (",mb ", info);
750 fputs_filtered (" ", info);
756 int opc = GET_FIELD (insn, 0, 5);
758 if (opc == 0x13 || opc == 0x1b)
760 if (GET_FIELD (insn, 18, 18) == 1)
761 fputs_filtered (",mb ", info);
763 fputs_filtered (",ma ", info);
765 else if (opc == 0x17 || opc == 0x1f)
767 if (GET_FIELD (insn, 31, 31) == 1)
768 fputs_filtered (",ma ", info);
770 fputs_filtered (",mb ", info);
773 fputs_filtered (" ", info);
780 /* Handle conditions. */
787 (*info->fprintf_func)
788 (info->stream, "%s ",
789 float_comp_names[GET_FIELD (insn, 27, 31)]);
792 /* these four conditions are for the set of instructions
793 which distinguish true/false conditions by opcode
794 rather than by the 'f' bit (sigh): comb, comib,
798 (compare_cond_names[GET_FIELD (insn, 16, 18)], info);
802 (compare_cond_names[GET_FIELD (insn, 16, 18)
803 + GET_FIELD (insn, 4, 4) * 8],
808 (compare_cond_64_names[GET_FIELD (insn, 16, 18)
809 + GET_FIELD (insn, 2, 2) * 8],
814 (cmpib_cond_64_names[GET_FIELD (insn, 16, 18)],
819 (add_cond_names[GET_FIELD (insn, 16, 18)
820 + GET_FIELD (insn, 4, 4) * 8],
824 (*info->fprintf_func)
825 (info->stream, "%s ",
826 compare_cond_names[GET_COND (insn)]);
829 (*info->fprintf_func)
830 (info->stream, "%s ",
831 compare_cond_64_names[GET_COND (insn)]);
834 (*info->fprintf_func)
835 (info->stream, "%s ",
836 add_cond_names[GET_COND (insn)]);
839 (*info->fprintf_func)
840 (info->stream, "%s ",
841 add_cond_64_names[GET_COND (insn)]);
844 (*info->fprintf_func)
846 add_cond_names[GET_FIELD (insn, 16, 18)]);
850 (*info->fprintf_func)
852 wide_add_cond_names[GET_FIELD (insn, 16, 18) +
853 GET_FIELD (insn, 4, 4) * 8]);
857 (*info->fprintf_func)
858 (info->stream, "%s ",
859 logical_cond_names[GET_COND (insn)]);
862 (*info->fprintf_func)
863 (info->stream, "%s ",
864 logical_cond_64_names[GET_COND (insn)]);
867 (*info->fprintf_func)
868 (info->stream, "%s ",
869 unit_cond_names[GET_COND (insn)]);
872 (*info->fprintf_func)
873 (info->stream, "%s ",
874 unit_cond_64_names[GET_COND (insn)]);
879 (*info->fprintf_func)
881 shift_cond_names[GET_FIELD (insn, 16, 18)]);
883 /* If the next character in args is 'n', it will handle
884 putting out the space. */
886 (*info->fprintf_func) (info->stream, " ");
889 (*info->fprintf_func)
890 (info->stream, "%s ",
891 shift_cond_64_names[GET_FIELD (insn, 16, 18)]);
894 (*info->fprintf_func)
896 bb_cond_64_names[GET_FIELD (insn, 16, 16)]);
898 /* If the next character in args is 'n', it will handle
899 putting out the space. */
901 (*info->fprintf_func) (info->stream, " ");
908 fput_const (extract_5_store (insn), info);
911 fput_const (extract_5r_store (insn), info);
914 fput_const (extract_5R_store (insn), info);
917 fput_const (extract_10U_store (insn), info);
921 fput_const (extract_5Q_store (insn), info);
924 fput_const (extract_11 (insn), info);
927 fput_const (extract_14 (insn), info);
930 fput_const (extract_21 (insn), info);
934 /* 16-bit long disp., PA2.0 wide only. */
935 fput_const (extract_16 (insn), info);
939 (*info->fprintf_func) (info->stream, ",n ");
941 (*info->fprintf_func) (info->stream, " ");
944 if ((insn & 0x20) && s[1])
945 (*info->fprintf_func) (info->stream, ",n ");
946 else if (insn & 0x20)
947 (*info->fprintf_func) (info->stream, ",n");
949 (*info->fprintf_func) (info->stream, " ");
952 (*info->print_address_func)
953 (memaddr + 8 + extract_12 (insn), info);
956 /* 17 bit PC-relative branch. */
957 (*info->print_address_func)
958 ((memaddr + 8 + extract_17 (insn)), info);
961 /* 17 bit displacement. This is an offset from a register
962 so it gets disasssembled as just a number, not any sort
964 fput_const (extract_17 (insn), info);
968 /* addil %r1 implicit output. */
969 (*info->fprintf_func) (info->stream, "%%r1");
973 /* be,l %sr0,%r31 implicit output. */
974 (*info->fprintf_func) (info->stream, "%%sr0,%%r31");
978 (*info->fprintf_func) (info->stream, "0");
982 (*info->fprintf_func) (info->stream, "%d",
983 GET_FIELD (insn, 24, 25));
986 (*info->fprintf_func) (info->stream, "%d",
987 GET_FIELD (insn, 22, 25));
990 (*info->fprintf_func) (info->stream, "%%sar");
993 (*info->fprintf_func) (info->stream, "%d",
994 31 - 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", 63 - num);
1005 (*info->fprintf_func) (info->stream, "%d",
1006 GET_FIELD (insn, 22, 26));
1011 num = GET_FIELD (insn, 20, 20) << 5;
1012 num |= GET_FIELD (insn, 22, 26);
1013 (*info->fprintf_func) (info->stream, "%d", num);
1017 (*info->fprintf_func) (info->stream, "%d",
1018 32 - GET_FIELD (insn, 27, 31));
1023 num = (GET_FIELD (insn, 23, 23) + 1) * 32;
1024 num -= GET_FIELD (insn, 27, 31);
1025 (*info->fprintf_func) (info->stream, "%d", num);
1031 num = (GET_FIELD (insn, 19, 19) + 1) * 32;
1032 num -= GET_FIELD (insn, 27, 31);
1033 (*info->fprintf_func) (info->stream, "%d", num);
1037 fput_const (GET_FIELD (insn, 20, 28), info);
1040 fput_const (GET_FIELD (insn, 6, 18), info);
1043 fput_const (GET_FIELD (insn, 6, 31), info);
1046 (*info->fprintf_func) (info->stream, ",%d",
1047 GET_FIELD (insn, 23, 25));
1050 fput_const ((GET_FIELD (insn, 6,20) << 5 |
1051 GET_FIELD (insn, 27, 31)), info);
1054 fput_const (GET_FIELD (insn, 6, 20), info);
1057 fput_const ((GET_FIELD (insn, 6, 22) << 5 |
1058 GET_FIELD (insn, 27, 31)), info);
1061 fput_const ((GET_FIELD (insn, 11, 20) << 5 |
1062 GET_FIELD (insn, 27, 31)), info);
1065 fput_const ((GET_FIELD (insn, 16, 20) << 5 |
1066 GET_FIELD (insn, 27, 31)), info);
1069 (*info->fprintf_func) (info->stream, ",%d",
1070 GET_FIELD (insn, 23, 25));
1073 /* if no destination completer and not before a completer
1074 for fcmp, need a space here */
1075 if (s[1] == 'G' || s[1] == '?')
1077 (float_format_names[GET_FIELD (insn, 19, 20)], info);
1079 (*info->fprintf_func)
1080 (info->stream, "%s ",
1081 float_format_names[GET_FIELD (insn, 19, 20)]);
1084 (*info->fprintf_func)
1085 (info->stream, "%s ",
1086 float_format_names[GET_FIELD (insn, 17, 18)]);
1089 if (GET_FIELD (insn, 26, 26) == 1)
1090 (*info->fprintf_func) (info->stream, "%s ",
1091 float_format_names[0]);
1093 (*info->fprintf_func) (info->stream, "%s ",
1094 float_format_names[1]);
1097 /* if no destination completer and not before a completer
1098 for fcmp, need a space here */
1101 (float_format_names[GET_FIELD (insn, 20, 20)], info);
1103 (*info->fprintf_func)
1104 (info->stream, "%s ",
1105 float_format_names[GET_FIELD (insn, 20, 20)]);
1109 fput_const (extract_14 (insn), info);
1114 int sign = GET_FIELD (insn, 31, 31);
1115 int imm10 = GET_FIELD (insn, 18, 27);
1119 disp = (-1 << 10) | imm10;
1124 fput_const (disp, info);
1130 int sign = GET_FIELD (insn, 31, 31);
1131 int imm11 = GET_FIELD (insn, 18, 28);
1135 disp = (-1 << 11) | imm11;
1140 fput_const (disp, info);
1147 /* 16-bit long disp., PA2.0 wide only. */
1148 int disp = extract_16 (insn);
1150 fput_const (disp, info);
1156 /* 16-bit long disp., PA2.0 wide only. */
1157 int disp = extract_16 (insn);
1159 fput_const (disp, info);
1164 break; /* Dealt with by '{' */
1168 int sub = GET_FIELD (insn, 14, 16);
1169 int df = GET_FIELD (insn, 17, 18);
1170 int sf = GET_FIELD (insn, 19, 20);
1171 const char * const * source = float_format_names;
1172 const char * const * dest = float_format_names;
1176 fputs_filtered (",UND ", info);
1182 source = sub & 4 ? fcnv_ufixed_names : fcnv_fixed_names;
1184 dest = sub & 4 ? fcnv_ufixed_names : fcnv_fixed_names;
1186 (*info->fprintf_func) (info->stream, "%s%s%s ",
1187 t, source[sf], dest[df]);
1193 int y = GET_FIELD (insn, 16, 18);
1196 fput_const ((y ^ 1) - 1, info);
1204 cbit = GET_FIELD (insn, 16, 18);
1207 (*info->fprintf_func) (info->stream, ",%d", cbit - 1);
1213 int cond = GET_FIELD (insn, 27, 31);
1216 fputs_filtered (" ", info);
1218 fputs_filtered ("acc ", info);
1220 fputs_filtered ("rej ", info);
1222 fputs_filtered ("acc8 ", info);
1224 fputs_filtered ("rej8 ", info);
1226 fputs_filtered ("acc6 ", info);
1227 else if (cond == 13)
1228 fputs_filtered ("acc4 ", info);
1229 else if (cond == 17)
1230 fputs_filtered ("acc2 ", info);
1235 (*info->print_address_func)
1236 (memaddr + 8 + extract_22 (insn), info);
1239 fputs_filtered (",%r2", info);
1242 (*info->fprintf_func) (info->stream, "%c", *s);
1246 return sizeof(insn);
1249 (*info->fprintf_func) (info->stream, "#%8x", insn);
1250 return sizeof(insn);