Add ud1 to x86.
[deliverable/binutils-gdb.git] / opcodes / sparc-dis.c
index 1b1748ce0f4e9bd870145960a04f989bb2c0f3e6..8dec272fb2b4c9e661f25f7412dea2c49a0ebc7c 100644 (file)
@@ -1,16 +1,19 @@
 /* Print SPARC instructions.
    Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010
+   Free Software Foundation, Inc.
 
-   This program is free software; you can redistribute it and/or modify
+   This file is part of the GNU opcodes library.
+
+   This library is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
 
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   It is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
@@ -85,16 +88,27 @@ static char *v9_priv_reg_names[] =
 {
   "tpc", "tnpc", "tstate", "tt", "tick", "tba", "pstate", "tl",
   "pil", "cwp", "cansave", "canrestore", "cleanwin", "otherwin",
-  "wstate", "fq"
+  "wstate", "fq", "gl"
   /* "ver" - special cased */
 };
 
+/* These are ordered according to there register number in
+   rdhpr and wrhpr insns.  */
+static char *v9_hpriv_reg_names[] =
+{
+  "hpstate", "htstate", "resv2", "hintp", "resv4", "htba", "hver",
+  "resv7", "resv8", "resv9", "resv10", "resv11", "resv12", "resv13", 
+  "resv14", "resv15", "resv16", "resv17", "resv18", "resv19", "resv20",
+  "resv21", "resv22", "resv23", "resv24", "resv25", "resv26", "resv27",
+  "resv28", "resv29", "resv30", "hstick_cmpr"
+};
+
 /* These are ordered according to there register number in
    rd and wr insns (-16).  */
 static char *v9a_asr_reg_names[] =
 {
   "pcr", "pic", "dcr", "gsr", "set_softint", "clear_softint",
-  "softint", "tick_cmpr", "sys_tick", "sys_tick_cmpr"
+  "softint", "tick_cmpr", "stick", "stick_cmpr"
 };
 
 /* Macros used to extract instruction fields.  Not all fields have
@@ -693,7 +707,7 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
                    break;
 
                  case '3':
-                   (info->fprintf_func) (stream, "%d", X_IMM (insn, 3));
+                   (info->fprintf_func) (stream, "%ld", X_IMM (insn, 3));
                    break;
 
                  case 'K':
@@ -768,7 +782,7 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
                  case '?':
                    if (X_RS1 (insn) == 31)
                      (*info->fprintf_func) (stream, "%%ver");
-                   else if ((unsigned) X_RS1 (insn) < 16)
+                   else if ((unsigned) X_RS1 (insn) < 17)
                      (*info->fprintf_func) (stream, "%%%s",
                                             v9_priv_reg_names[X_RS1 (insn)]);
                    else
@@ -776,13 +790,29 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
                    break;
 
                  case '!':
-                   if ((unsigned) X_RD (insn) < 15)
+                   if ((unsigned) X_RD (insn) < 17)
                      (*info->fprintf_func) (stream, "%%%s",
                                             v9_priv_reg_names[X_RD (insn)]);
                    else
                      (*info->fprintf_func) (stream, "%%reserved");
                    break;
 
+                 case '$':
+                   if ((unsigned) X_RS1 (insn) < 32)
+                     (*info->fprintf_func) (stream, "%%%s",
+                                            v9_hpriv_reg_names[X_RS1 (insn)]);
+                   else
+                     (*info->fprintf_func) (stream, "%%reserved");
+                   break;
+
+                 case '%':
+                   if ((unsigned) X_RD (insn) < 32)
+                     (*info->fprintf_func) (stream, "%%%s",
+                                            v9_hpriv_reg_names[X_RD (insn)]);
+                   else
+                     (*info->fprintf_func) (stream, "%%reserved");
+                   break;
+
                  case '/':
                    if (X_RS1 (insn) < 16 || X_RS1 (insn) > 25)
                      (*info->fprintf_func) (stream, "%%reserved");
@@ -806,16 +836,16 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
                      if (name)
                        (*info->fprintf_func) (stream, "%s", name);
                      else
-                       (*info->fprintf_func) (stream, "%d", X_RD (insn));
+                       (*info->fprintf_func) (stream, "%ld", X_RD (insn));
                      break;
                    }
 
                  case 'M':
-                   (*info->fprintf_func) (stream, "%%asr%d", X_RS1 (insn));
+                   (*info->fprintf_func) (stream, "%%asr%ld", X_RS1 (insn));
                    break;
 
                  case 'm':
-                   (*info->fprintf_func) (stream, "%%asr%d", X_RD (insn));
+                   (*info->fprintf_func) (stream, "%%asr%ld", X_RD (insn));
                    break;
 
                  case 'L':
@@ -840,7 +870,7 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
                      if (name)
                        (*info->fprintf_func) (stream, "%s", name);
                      else
-                       (*info->fprintf_func) (stream, "(%d)", X_ASI (insn));
+                       (*info->fprintf_func) (stream, "(%ld)", X_ASI (insn));
                      break;
                    }
 
@@ -873,7 +903,7 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
                    break;
 
                  case 'x':
-                   (*info->fprintf_func) (stream, "%d",
+                   (*info->fprintf_func) (stream, "%ld",
                                           ((X_LDST_I (insn) << 8)
                                            + X_ASI (insn)));
                    break;
@@ -965,7 +995,8 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
 
          if (opcode->flags & (F_UNBR|F_CONDBR|F_JSR))
            {
-               /* FIXME -- check is_annulled flag.  */
+             /* FIXME -- check is_annulled flag.  */
+             (void) is_annulled;
              if (opcode->flags & F_UNBR)
                info->insn_type = dis_branch;
              if (opcode->flags & F_CONDBR)
This page took 0.026069 seconds and 4 git commands to generate.