1 /* Disassembler for the PA-RISC. Somewhat derived from sparc-pinsn.c.
2 Copyright (C) 1989-2014 Free Software Foundation, Inc.
4 Contributed by the Center for Software Science at the
5 University of Utah (pa-gdb-bugs@cs.utah.edu).
7 This file is part of the GNU opcodes library.
9 This library is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
14 It is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
22 MA 02110-1301, USA. */
27 #include "opcode/hppa.h"
29 /* Integer register names, indexed by the numbers which appear in the
31 static const char *const reg_names
[] =
33 "flags", "r1", "rp", "r3", "r4", "r5", "r6", "r7", "r8", "r9",
34 "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19",
35 "r20", "r21", "r22", "r23", "r24", "r25", "r26", "dp", "ret0", "ret1",
39 /* Floating point register names, indexed by the numbers which appear in the
41 static const char *const fp_reg_names
[] =
43 "fpsr", "fpe2", "fpe4", "fpe6",
44 "fr4", "fr5", "fr6", "fr7", "fr8",
45 "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15",
46 "fr16", "fr17", "fr18", "fr19", "fr20", "fr21", "fr22", "fr23",
47 "fr24", "fr25", "fr26", "fr27", "fr28", "fr29", "fr30", "fr31"
50 typedef unsigned int CORE_ADDR
;
52 /* Get at various relevent fields of an instruction word. */
57 #define MASK_14 0x3fff
58 #define MASK_16 0xffff
59 #define MASK_21 0x1fffff
61 /* These macros get bit fields using HP's numbering (MSB = 0). */
63 #define GET_FIELD(X, FROM, TO) \
64 ((X) >> (31 - (TO)) & ((1 << ((TO) - (FROM) + 1)) - 1))
66 #define GET_BIT(X, WHICH) \
67 GET_FIELD (X, WHICH, WHICH)
69 /* Some of these have been converted to 2-d arrays because they
70 consume less storage this way. If the maintenance becomes a
71 problem, convert them back to const 1-d pointer arrays. */
72 static const char *const control_reg
[] =
74 "rctr", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7",
75 "pidr1", "pidr2", "ccr", "sar", "pidr3", "pidr4",
76 "iva", "eiem", "itmr", "pcsq", "pcoq", "iir", "isr",
77 "ior", "ipsw", "eirr", "tr0", "tr1", "tr2", "tr3",
78 "tr4", "tr5", "tr6", "tr7"
81 static const char *const compare_cond_names
[] =
83 "", ",=", ",<", ",<=", ",<<", ",<<=", ",sv", ",od",
84 ",tr", ",<>", ",>=", ",>", ",>>=", ",>>", ",nsv", ",ev"
86 static const char *const compare_cond_64_names
[] =
88 ",*", ",*=", ",*<", ",*<=", ",*<<", ",*<<=", ",*sv", ",*od",
89 ",*tr", ",*<>", ",*>=", ",*>", ",*>>=", ",*>>", ",*nsv", ",*ev"
91 static const char *const cmpib_cond_64_names
[] =
93 ",*<<", ",*=", ",*<", ",*<=", ",*>>=", ",*<>", ",*>=", ",*>"
95 static const char *const add_cond_names
[] =
97 "", ",=", ",<", ",<=", ",nuv", ",znv", ",sv", ",od",
98 ",tr", ",<>", ",>=", ",>", ",uv", ",vnz", ",nsv", ",ev"
100 static const char *const add_cond_64_names
[] =
102 ",*", ",*=", ",*<", ",*<=", ",*nuv", ",*znv", ",*sv", ",*od",
103 ",*tr", ",*<>", ",*>=", ",*>", ",*uv", ",*vnz", ",*nsv", ",*ev"
105 static const char *const wide_add_cond_names
[] =
107 "", ",=", ",<", ",<=", ",nuv", ",*=", ",*<", ",*<=",
108 ",tr", ",<>", ",>=", ",>", ",uv", ",*<>", ",*>=", ",*>"
110 static const char *const logical_cond_names
[] =
112 "", ",=", ",<", ",<=", 0, 0, 0, ",od",
113 ",tr", ",<>", ",>=", ",>", 0, 0, 0, ",ev"};
114 static const char *const logical_cond_64_names
[] =
116 ",*", ",*=", ",*<", ",*<=", 0, 0, 0, ",*od",
117 ",*tr", ",*<>", ",*>=", ",*>", 0, 0, 0, ",*ev"};
118 static const char *const unit_cond_names
[] =
120 "", ",swz", ",sbz", ",shz", ",sdc", ",swc", ",sbc", ",shc",
121 ",tr", ",nwz", ",nbz", ",nhz", ",ndc", ",nwc", ",nbc", ",nhc"
123 static const char *const unit_cond_64_names
[] =
125 ",*", ",*swz", ",*sbz", ",*shz", ",*sdc", ",*swc", ",*sbc", ",*shc",
126 ",*tr", ",*nwz", ",*nbz", ",*nhz", ",*ndc", ",*nwc", ",*nbc", ",*nhc"
128 static const char *const shift_cond_names
[] =
130 "", ",=", ",<", ",od", ",tr", ",<>", ",>=", ",ev"
132 static const char *const shift_cond_64_names
[] =
134 ",*", ",*=", ",*<", ",*od", ",*tr", ",*<>", ",*>=", ",*ev"
136 static const char *const bb_cond_64_names
[] =
140 static const char *const index_compl_names
[] = {"", ",m", ",s", ",sm"};
141 static const char *const short_ldst_compl_names
[] = {"", ",ma", "", ",mb"};
142 static const char *const short_bytes_compl_names
[] =
144 "", ",b,m", ",e", ",e,m"
146 static const char *const float_format_names
[] = {",sgl", ",dbl", "", ",quad"};
147 static const char *const fcnv_fixed_names
[] = {",w", ",dw", "", ",qw"};
148 static const char *const fcnv_ufixed_names
[] = {",uw", ",udw", "", ",uqw"};
149 static const char *const float_comp_names
[] =
151 ",false?", ",false", ",?", ",!<=>", ",=", ",=t", ",?=", ",!<>",
152 ",!?>=", ",<", ",?<", ",!>=", ",!?>", ",<=", ",?<=", ",!>",
153 ",!?<=", ",>", ",?>", ",!<=", ",!?<", ",>=", ",?>=", ",!<",
154 ",!?=", ",<>", ",!=", ",!=t", ",!?", ",<=>", ",true?", ",true"
156 static const char *const signed_unsigned_names
[] = {",u", ",s"};
157 static const char *const mix_half_names
[] = {",l", ",r"};
158 static const char *const saturation_names
[] = {",us", ",ss", 0, ""};
159 static const char *const read_write_names
[] = {",r", ",w"};
160 static const char *const add_compl_names
[] = { 0, "", ",l", ",tsv" };
162 /* For a bunch of different instructions form an index into a
163 completer name table. */
164 #define GET_COMPL(insn) (GET_FIELD (insn, 26, 26) | \
165 GET_FIELD (insn, 18, 18) << 1)
167 #define GET_COND(insn) (GET_FIELD ((insn), 16, 18) + \
168 (GET_FIELD ((insn), 19, 19) ? 8 : 0))
170 /* Utility function to print registers. Put these first, so gcc's function
171 inlining can do its stuff. */
173 #define fputs_filtered(STR,F) (*info->fprintf_func) (info->stream, "%s", STR)
176 fput_reg (unsigned reg
, disassemble_info
*info
)
178 (*info
->fprintf_func
) (info
->stream
, "%s", reg
? reg_names
[reg
] : "r0");
182 fput_fp_reg (unsigned reg
, disassemble_info
*info
)
184 (*info
->fprintf_func
) (info
->stream
, "%s", reg
? fp_reg_names
[reg
] : "fr0");
188 fput_fp_reg_r (unsigned reg
, disassemble_info
*info
)
190 /* Special case floating point exception registers. */
192 (*info
->fprintf_func
) (info
->stream
, "fpe%d", reg
* 2 + 1);
194 (*info
->fprintf_func
) (info
->stream
, "%sR",
195 reg
? fp_reg_names
[reg
] : "fr0");
199 fput_creg (unsigned reg
, disassemble_info
*info
)
201 (*info
->fprintf_func
) (info
->stream
, "%s", control_reg
[reg
]);
204 /* Print constants with sign. */
207 fput_const (unsigned num
, disassemble_info
*info
)
210 (*info
->fprintf_func
) (info
->stream
, "-%x", - (int) num
);
212 (*info
->fprintf_func
) (info
->stream
, "%x", num
);
215 /* Routines to extract various sized constants out of hppa
218 /* Extract a 3-bit space register number from a be, ble, mtsp or mfsp. */
220 extract_3 (unsigned word
)
222 return GET_FIELD (word
, 18, 18) << 2 | GET_FIELD (word
, 16, 17);
226 extract_5_load (unsigned word
)
228 return low_sign_extend (word
>> 16 & MASK_5
, 5);
231 /* Extract the immediate field from a st{bhw}s instruction. */
234 extract_5_store (unsigned word
)
236 return low_sign_extend (word
& MASK_5
, 5);
239 /* Extract the immediate field from a break instruction. */
242 extract_5r_store (unsigned word
)
244 return (word
& MASK_5
);
247 /* Extract the immediate field from a {sr}sm instruction. */
250 extract_5R_store (unsigned word
)
252 return (word
>> 16 & MASK_5
);
255 /* Extract the 10 bit immediate field from a {sr}sm instruction. */
258 extract_10U_store (unsigned word
)
260 return (word
>> 16 & MASK_10
);
263 /* Extract the immediate field from a bb instruction. */
266 extract_5Q_store (unsigned word
)
268 return (word
>> 21 & MASK_5
);
271 /* Extract an 11 bit immediate field. */
274 extract_11 (unsigned word
)
276 return low_sign_extend (word
& MASK_11
, 11);
279 /* Extract a 14 bit immediate field. */
282 extract_14 (unsigned word
)
284 return low_sign_extend (word
& MASK_14
, 14);
287 /* Extract a 16 bit immediate field (PA2.0 wide only). */
290 extract_16 (unsigned word
)
294 m0
= GET_BIT (word
, 16);
295 m1
= GET_BIT (word
, 17);
296 m15
= GET_BIT (word
, 31);
297 word
= (word
>> 1) & 0x1fff;
298 word
= word
| (m15
<< 15) | ((m15
^ m0
) << 14) | ((m15
^ m1
) << 13);
299 return sign_extend (word
, 16);
302 /* Extract a 21 bit constant. */
305 extract_21 (unsigned word
)
311 val
= GET_FIELD (word
, 20, 20);
313 val
|= GET_FIELD (word
, 9, 19);
315 val
|= GET_FIELD (word
, 5, 6);
317 val
|= GET_FIELD (word
, 0, 4);
319 val
|= GET_FIELD (word
, 7, 8);
320 return sign_extend (val
, 21) << 11;
323 /* Extract a 12 bit constant from branch instructions. */
326 extract_12 (unsigned word
)
328 return sign_extend (GET_FIELD (word
, 19, 28)
329 | GET_FIELD (word
, 29, 29) << 10
330 | (word
& 0x1) << 11, 12) << 2;
333 /* Extract a 17 bit constant from branch instructions, returning the
334 19 bit signed value. */
337 extract_17 (unsigned word
)
339 return sign_extend (GET_FIELD (word
, 19, 28)
340 | GET_FIELD (word
, 29, 29) << 10
341 | GET_FIELD (word
, 11, 15) << 11
342 | (word
& 0x1) << 16, 17) << 2;
346 extract_22 (unsigned word
)
348 return sign_extend (GET_FIELD (word
, 19, 28)
349 | GET_FIELD (word
, 29, 29) << 10
350 | GET_FIELD (word
, 11, 15) << 11
351 | GET_FIELD (word
, 6, 10) << 16
352 | (word
& 0x1) << 21, 22) << 2;
355 /* Print one instruction. */
358 print_insn_hppa (bfd_vma memaddr
, disassemble_info
*info
)
361 unsigned int insn
, i
;
365 (*info
->read_memory_func
) (memaddr
, buffer
, sizeof (buffer
), info
);
368 (*info
->memory_error_func
) (status
, memaddr
, info
);
373 insn
= bfd_getb32 (buffer
);
375 for (i
= 0; i
< NUMOPCODES
; ++i
)
377 const struct pa_opcode
*opcode
= &pa_opcodes
[i
];
379 if ((insn
& opcode
->mask
) == opcode
->match
)
383 if (opcode
->arch
== pa20w
)
386 (*info
->fprintf_func
) (info
->stream
, "%s", opcode
->name
);
388 if (!strchr ("cfCY?-+nHNZFIuv{", opcode
->args
[0]))
389 (*info
->fprintf_func
) (info
->stream
, " ");
390 for (s
= opcode
->args
; *s
!= '\0'; ++s
)
395 fput_reg (GET_FIELD (insn
, 11, 15), info
);
399 fput_reg (GET_FIELD (insn
, 6, 10), info
);
402 fput_creg (GET_FIELD (insn
, 6, 10), info
);
405 fput_reg (GET_FIELD (insn
, 27, 31), info
);
408 /* Handle floating point registers. */
413 fput_fp_reg (GET_FIELD (insn
, 27, 31), info
);
416 if (GET_FIELD (insn
, 25, 25))
417 fput_fp_reg_r (GET_FIELD (insn
, 27, 31), info
);
419 fput_fp_reg (GET_FIELD (insn
, 27, 31), info
);
422 if (GET_FIELD (insn
, 25, 25))
423 fput_fp_reg_r (GET_FIELD (insn
, 6, 10), info
);
425 fput_fp_reg (GET_FIELD (insn
, 6, 10), info
);
428 /* 'fA' will not generate a space before the regsiter
429 name. Normally that is fine. Except that it
430 causes problems with xmpyu which has no FP format
433 fputs_filtered (" ", info
);
437 if (GET_FIELD (insn
, 24, 24))
438 fput_fp_reg_r (GET_FIELD (insn
, 6, 10), info
);
440 fput_fp_reg (GET_FIELD (insn
, 6, 10), info
);
443 if (GET_FIELD (insn
, 25, 25))
444 fput_fp_reg_r (GET_FIELD (insn
, 11, 15), info
);
446 fput_fp_reg (GET_FIELD (insn
, 11, 15), info
);
449 if (GET_FIELD (insn
, 19, 19))
450 fput_fp_reg_r (GET_FIELD (insn
, 11, 15), info
);
452 fput_fp_reg (GET_FIELD (insn
, 11, 15), info
);
456 int reg
= GET_FIELD (insn
, 21, 22);
457 reg
|= GET_FIELD (insn
, 16, 18) << 2;
458 if (GET_FIELD (insn
, 23, 23) != 0)
459 fput_fp_reg_r (reg
, info
);
461 fput_fp_reg (reg
, info
);
466 int reg
= GET_FIELD (insn
, 6, 10);
468 reg
|= (GET_FIELD (insn
, 26, 26) << 4);
469 fput_fp_reg (reg
, info
);
474 int reg
= GET_FIELD (insn
, 11, 15);
476 reg
|= (GET_FIELD (insn
, 26, 26) << 4);
477 fput_fp_reg (reg
, info
);
482 int reg
= GET_FIELD (insn
, 27, 31);
484 reg
|= (GET_FIELD (insn
, 26, 26) << 4);
485 fput_fp_reg (reg
, info
);
490 int reg
= GET_FIELD (insn
, 21, 25);
492 reg
|= (GET_FIELD (insn
, 26, 26) << 4);
493 fput_fp_reg (reg
, info
);
498 int reg
= GET_FIELD (insn
, 16, 20);
500 reg
|= (GET_FIELD (insn
, 26, 26) << 4);
501 fput_fp_reg (reg
, info
);
505 /* 'fe' will not generate a space before the register
506 name. Normally that is fine. Except that it
507 causes problems with fstw fe,y(b) which has no FP
510 fputs_filtered (" ", info
);
514 if (GET_FIELD (insn
, 30, 30))
515 fput_fp_reg_r (GET_FIELD (insn
, 11, 15), info
);
517 fput_fp_reg (GET_FIELD (insn
, 11, 15), info
);
520 fput_fp_reg (GET_FIELD (insn
, 11, 15), info
);
526 fput_const (extract_5_load (insn
), info
);
530 int space
= GET_FIELD (insn
, 16, 17);
531 /* Zero means implicit addressing, not use of sr0. */
533 (*info
->fprintf_func
) (info
->stream
, "sr%d", space
);
538 (*info
->fprintf_func
) (info
->stream
, "sr%d",
542 /* Handle completers. */
547 (*info
->fprintf_func
)
549 index_compl_names
[GET_COMPL (insn
)]);
552 (*info
->fprintf_func
)
553 (info
->stream
, "%s ",
554 index_compl_names
[GET_COMPL (insn
)]);
557 (*info
->fprintf_func
)
559 short_ldst_compl_names
[GET_COMPL (insn
)]);
562 (*info
->fprintf_func
)
563 (info
->stream
, "%s ",
564 short_ldst_compl_names
[GET_COMPL (insn
)]);
567 (*info
->fprintf_func
)
568 (info
->stream
, "%s ",
569 short_bytes_compl_names
[GET_COMPL (insn
)]);
572 (*info
->fprintf_func
)
574 short_bytes_compl_names
[GET_COMPL (insn
)]);
578 switch (GET_FIELD (insn
, 20, 21))
581 (*info
->fprintf_func
) (info
->stream
, ",bc ");
584 (*info
->fprintf_func
) (info
->stream
, ",sl ");
587 (*info
->fprintf_func
) (info
->stream
, " ");
591 switch (GET_FIELD (insn
, 20, 21))
594 (*info
->fprintf_func
) (info
->stream
, ",co ");
597 (*info
->fprintf_func
) (info
->stream
, " ");
601 (*info
->fprintf_func
) (info
->stream
, ",o");
604 (*info
->fprintf_func
) (info
->stream
, ",gate");
607 (*info
->fprintf_func
) (info
->stream
, ",l,push");
610 (*info
->fprintf_func
) (info
->stream
, ",pop");
614 (*info
->fprintf_func
) (info
->stream
, ",l");
617 (*info
->fprintf_func
)
618 (info
->stream
, "%s ",
619 read_write_names
[GET_FIELD (insn
, 25, 25)]);
622 (*info
->fprintf_func
) (info
->stream
, ",w ");
625 if (GET_FIELD (insn
, 23, 26) == 5)
626 (*info
->fprintf_func
) (info
->stream
, ",r");
629 if (GET_FIELD (insn
, 26, 26))
630 (*info
->fprintf_func
) (info
->stream
, ",m ");
632 (*info
->fprintf_func
) (info
->stream
, " ");
635 if (GET_FIELD (insn
, 25, 25))
636 (*info
->fprintf_func
) (info
->stream
, ",i");
639 if (!GET_FIELD (insn
, 21, 21))
640 (*info
->fprintf_func
) (info
->stream
, ",z");
643 (*info
->fprintf_func
)
645 add_compl_names
[GET_FIELD (insn
, 20, 21)]);
648 (*info
->fprintf_func
)
649 (info
->stream
, ",dc%s",
650 add_compl_names
[GET_FIELD (insn
, 20, 21)]);
653 (*info
->fprintf_func
)
654 (info
->stream
, ",c%s",
655 add_compl_names
[GET_FIELD (insn
, 20, 21)]);
658 if (GET_FIELD (insn
, 20, 20))
659 (*info
->fprintf_func
) (info
->stream
, ",tsv");
662 (*info
->fprintf_func
) (info
->stream
, ",tc");
663 if (GET_FIELD (insn
, 20, 20))
664 (*info
->fprintf_func
) (info
->stream
, ",tsv");
667 (*info
->fprintf_func
) (info
->stream
, ",db");
668 if (GET_FIELD (insn
, 20, 20))
669 (*info
->fprintf_func
) (info
->stream
, ",tsv");
672 (*info
->fprintf_func
) (info
->stream
, ",b");
673 if (GET_FIELD (insn
, 20, 20))
674 (*info
->fprintf_func
) (info
->stream
, ",tsv");
677 if (GET_FIELD (insn
, 25, 25))
678 (*info
->fprintf_func
) (info
->stream
, ",tc");
681 /* EXTRD/W has a following condition. */
683 (*info
->fprintf_func
)
685 signed_unsigned_names
[GET_FIELD (insn
, 21, 21)]);
687 (*info
->fprintf_func
)
688 (info
->stream
, "%s ",
689 signed_unsigned_names
[GET_FIELD (insn
, 21, 21)]);
692 (*info
->fprintf_func
)
694 mix_half_names
[GET_FIELD (insn
, 17, 17)]);
697 (*info
->fprintf_func
)
698 (info
->stream
, "%s ",
699 saturation_names
[GET_FIELD (insn
, 24, 25)]);
702 (*info
->fprintf_func
)
703 (info
->stream
, ",%d%d%d%d ",
704 GET_FIELD (insn
, 17, 18), GET_FIELD (insn
, 20, 21),
705 GET_FIELD (insn
, 22, 23), GET_FIELD (insn
, 24, 25));
712 m
= GET_FIELD (insn
, 28, 28);
713 a
= GET_FIELD (insn
, 29, 29);
716 fputs_filtered (",ma ", info
);
718 fputs_filtered (",mb ", info
);
720 fputs_filtered (" ", info
);
726 int opc
= GET_FIELD (insn
, 0, 5);
728 if (opc
== 0x16 || opc
== 0x1e)
730 if (GET_FIELD (insn
, 29, 29) == 0)
731 fputs_filtered (",ma ", info
);
733 fputs_filtered (",mb ", info
);
736 fputs_filtered (" ", info
);
742 int opc
= GET_FIELD (insn
, 0, 5);
744 if (opc
== 0x13 || opc
== 0x1b)
746 if (GET_FIELD (insn
, 18, 18) == 1)
747 fputs_filtered (",mb ", info
);
749 fputs_filtered (",ma ", info
);
751 else if (opc
== 0x17 || opc
== 0x1f)
753 if (GET_FIELD (insn
, 31, 31) == 1)
754 fputs_filtered (",ma ", info
);
756 fputs_filtered (",mb ", info
);
759 fputs_filtered (" ", info
);
766 /* Handle conditions. */
773 (*info
->fprintf_func
)
774 (info
->stream
, "%s ",
775 float_comp_names
[GET_FIELD (insn
, 27, 31)]);
778 /* These four conditions are for the set of instructions
779 which distinguish true/false conditions by opcode
780 rather than by the 'f' bit (sigh): comb, comib,
784 (compare_cond_names
[GET_FIELD (insn
, 16, 18)], info
);
788 (compare_cond_names
[GET_FIELD (insn
, 16, 18)
789 + GET_FIELD (insn
, 4, 4) * 8],
794 (compare_cond_64_names
[GET_FIELD (insn
, 16, 18)
795 + GET_FIELD (insn
, 2, 2) * 8],
800 (cmpib_cond_64_names
[GET_FIELD (insn
, 16, 18)],
805 (add_cond_names
[GET_FIELD (insn
, 16, 18)
806 + GET_FIELD (insn
, 4, 4) * 8],
810 (*info
->fprintf_func
)
811 (info
->stream
, "%s ",
812 compare_cond_names
[GET_COND (insn
)]);
815 (*info
->fprintf_func
)
816 (info
->stream
, "%s ",
817 compare_cond_64_names
[GET_COND (insn
)]);
820 (*info
->fprintf_func
)
821 (info
->stream
, "%s ",
822 add_cond_names
[GET_COND (insn
)]);
825 (*info
->fprintf_func
)
826 (info
->stream
, "%s ",
827 add_cond_64_names
[GET_COND (insn
)]);
830 (*info
->fprintf_func
)
832 add_cond_names
[GET_FIELD (insn
, 16, 18)]);
836 (*info
->fprintf_func
)
838 wide_add_cond_names
[GET_FIELD (insn
, 16, 18) +
839 GET_FIELD (insn
, 4, 4) * 8]);
843 (*info
->fprintf_func
)
844 (info
->stream
, "%s ",
845 logical_cond_names
[GET_COND (insn
)]);
848 (*info
->fprintf_func
)
849 (info
->stream
, "%s ",
850 logical_cond_64_names
[GET_COND (insn
)]);
853 (*info
->fprintf_func
)
854 (info
->stream
, "%s ",
855 unit_cond_names
[GET_COND (insn
)]);
858 (*info
->fprintf_func
)
859 (info
->stream
, "%s ",
860 unit_cond_64_names
[GET_COND (insn
)]);
865 (*info
->fprintf_func
)
867 shift_cond_names
[GET_FIELD (insn
, 16, 18)]);
869 /* If the next character in args is 'n', it will handle
870 putting out the space. */
872 (*info
->fprintf_func
) (info
->stream
, " ");
875 (*info
->fprintf_func
)
876 (info
->stream
, "%s ",
877 shift_cond_64_names
[GET_FIELD (insn
, 16, 18)]);
880 (*info
->fprintf_func
)
882 bb_cond_64_names
[GET_FIELD (insn
, 16, 16)]);
884 /* If the next character in args is 'n', it will handle
885 putting out the space. */
887 (*info
->fprintf_func
) (info
->stream
, " ");
894 fput_const (extract_5_store (insn
), info
);
897 fput_const (extract_5r_store (insn
), info
);
900 fput_const (extract_5R_store (insn
), info
);
903 fput_const (extract_10U_store (insn
), info
);
907 fput_const (extract_5Q_store (insn
), info
);
910 fput_const (extract_11 (insn
), info
);
913 fput_const (extract_14 (insn
), info
);
916 fputs_filtered ("L%", info
);
917 fput_const (extract_21 (insn
), info
);
921 /* 16-bit long disp., PA2.0 wide only. */
922 fput_const (extract_16 (insn
), info
);
926 (*info
->fprintf_func
) (info
->stream
, ",n ");
928 (*info
->fprintf_func
) (info
->stream
, " ");
931 if ((insn
& 0x20) && s
[1])
932 (*info
->fprintf_func
) (info
->stream
, ",n ");
933 else if (insn
& 0x20)
934 (*info
->fprintf_func
) (info
->stream
, ",n");
936 (*info
->fprintf_func
) (info
->stream
, " ");
939 (*info
->print_address_func
)
940 (memaddr
+ 8 + extract_12 (insn
), info
);
943 /* 17 bit PC-relative branch. */
944 (*info
->print_address_func
)
945 ((memaddr
+ 8 + extract_17 (insn
)), info
);
948 /* 17 bit displacement. This is an offset from a register
949 so it gets disasssembled as just a number, not any sort
951 fput_const (extract_17 (insn
), info
);
955 /* addil %r1 implicit output. */
956 fputs_filtered ("r1", info
);
960 /* be,l %sr0,%r31 implicit output. */
961 fputs_filtered ("sr0,r31", info
);
965 (*info
->fprintf_func
) (info
->stream
, "0");
969 (*info
->fprintf_func
) (info
->stream
, "%d",
970 GET_FIELD (insn
, 24, 25));
973 (*info
->fprintf_func
) (info
->stream
, "%d",
974 GET_FIELD (insn
, 22, 25));
977 fputs_filtered ("sar", info
);
980 (*info
->fprintf_func
) (info
->stream
, "%d",
981 31 - GET_FIELD (insn
, 22, 26));
986 num
= GET_FIELD (insn
, 20, 20) << 5;
987 num
|= GET_FIELD (insn
, 22, 26);
988 (*info
->fprintf_func
) (info
->stream
, "%d", 63 - num
);
992 (*info
->fprintf_func
) (info
->stream
, "%d",
993 GET_FIELD (insn
, 22, 26));
998 num
= GET_FIELD (insn
, 20, 20) << 5;
999 num
|= GET_FIELD (insn
, 22, 26);
1000 (*info
->fprintf_func
) (info
->stream
, "%d", num
);
1004 (*info
->fprintf_func
) (info
->stream
, "%d",
1005 32 - GET_FIELD (insn
, 27, 31));
1010 num
= (GET_FIELD (insn
, 23, 23) + 1) * 32;
1011 num
-= GET_FIELD (insn
, 27, 31);
1012 (*info
->fprintf_func
) (info
->stream
, "%d", num
);
1018 num
= (GET_FIELD (insn
, 19, 19) + 1) * 32;
1019 num
-= GET_FIELD (insn
, 27, 31);
1020 (*info
->fprintf_func
) (info
->stream
, "%d", num
);
1024 fput_const (GET_FIELD (insn
, 20, 28), info
);
1027 fput_const (GET_FIELD (insn
, 6, 18), info
);
1030 fput_const (GET_FIELD (insn
, 6, 31), info
);
1033 (*info
->fprintf_func
) (info
->stream
, ",%d",
1034 GET_FIELD (insn
, 23, 25));
1037 fput_const ((GET_FIELD (insn
, 6,20) << 5 |
1038 GET_FIELD (insn
, 27, 31)), info
);
1041 fput_const (GET_FIELD (insn
, 6, 20), info
);
1044 fput_const ((GET_FIELD (insn
, 6, 22) << 5 |
1045 GET_FIELD (insn
, 27, 31)), info
);
1048 fput_const ((GET_FIELD (insn
, 11, 20) << 5 |
1049 GET_FIELD (insn
, 27, 31)), info
);
1052 fput_const ((GET_FIELD (insn
, 16, 20) << 5 |
1053 GET_FIELD (insn
, 27, 31)), info
);
1056 (*info
->fprintf_func
) (info
->stream
, ",%d",
1057 GET_FIELD (insn
, 23, 25));
1060 /* If no destination completer and not before a completer
1061 for fcmp, need a space here. */
1062 if (s
[1] == 'G' || s
[1] == '?')
1064 (float_format_names
[GET_FIELD (insn
, 19, 20)], info
);
1066 (*info
->fprintf_func
)
1067 (info
->stream
, "%s ",
1068 float_format_names
[GET_FIELD (insn
, 19, 20)]);
1071 (*info
->fprintf_func
)
1072 (info
->stream
, "%s ",
1073 float_format_names
[GET_FIELD (insn
, 17, 18)]);
1076 if (GET_FIELD (insn
, 26, 26) == 1)
1077 (*info
->fprintf_func
) (info
->stream
, "%s ",
1078 float_format_names
[0]);
1080 (*info
->fprintf_func
) (info
->stream
, "%s ",
1081 float_format_names
[1]);
1084 /* If no destination completer and not before a completer
1085 for fcmp, need a space here. */
1088 (float_format_names
[GET_FIELD (insn
, 20, 20)], info
);
1090 (*info
->fprintf_func
)
1091 (info
->stream
, "%s ",
1092 float_format_names
[GET_FIELD (insn
, 20, 20)]);
1096 fput_const (extract_14 (insn
), info
);
1101 int sign
= GET_FIELD (insn
, 31, 31);
1102 int imm10
= GET_FIELD (insn
, 18, 27);
1106 disp
= (-1 << 10) | imm10
;
1111 fput_const (disp
, info
);
1117 int sign
= GET_FIELD (insn
, 31, 31);
1118 int imm11
= GET_FIELD (insn
, 18, 28);
1122 disp
= (-1 << 11) | imm11
;
1127 fput_const (disp
, info
);
1134 /* 16-bit long disp., PA2.0 wide only. */
1135 int disp
= extract_16 (insn
);
1137 fput_const (disp
, info
);
1143 /* 16-bit long disp., PA2.0 wide only. */
1144 int disp
= extract_16 (insn
);
1146 fput_const (disp
, info
);
1151 break; /* Dealt with by '{' */
1155 int sub
= GET_FIELD (insn
, 14, 16);
1156 int df
= GET_FIELD (insn
, 17, 18);
1157 int sf
= GET_FIELD (insn
, 19, 20);
1158 const char * const * source
= float_format_names
;
1159 const char * const * dest
= float_format_names
;
1164 fputs_filtered (",UND ", info
);
1170 source
= sub
& 4 ? fcnv_ufixed_names
: fcnv_fixed_names
;
1172 dest
= sub
& 4 ? fcnv_ufixed_names
: fcnv_fixed_names
;
1174 (*info
->fprintf_func
) (info
->stream
, "%s%s%s ",
1175 t
, source
[sf
], dest
[df
]);
1181 int y
= GET_FIELD (insn
, 16, 18);
1184 fput_const ((y
^ 1) - 1, info
);
1192 cbit
= GET_FIELD (insn
, 16, 18);
1195 (*info
->fprintf_func
) (info
->stream
, ",%d", cbit
- 1);
1201 int cond
= GET_FIELD (insn
, 27, 31);
1205 case 0: fputs_filtered (" ", info
); break;
1206 case 1: fputs_filtered ("acc ", info
); break;
1207 case 2: fputs_filtered ("rej ", info
); break;
1208 case 5: fputs_filtered ("acc8 ", info
); break;
1209 case 6: fputs_filtered ("rej8 ", info
); break;
1210 case 9: fputs_filtered ("acc6 ", info
); break;
1211 case 13: fputs_filtered ("acc4 ", info
); break;
1212 case 17: fputs_filtered ("acc2 ", info
); break;
1219 (*info
->print_address_func
)
1220 (memaddr
+ 8 + extract_22 (insn
), info
);
1223 fputs_filtered (",rp", info
);
1226 (*info
->fprintf_func
) (info
->stream
, "%c", *s
);
1230 return sizeof (insn
);
1233 (*info
->fprintf_func
) (info
->stream
, "#%8x", insn
);
1234 return sizeof (insn
);
This page took 0.056995 seconds and 4 git commands to generate.