* opcodes/mips-dis.c (mips16_to_32_reg_map, mips16_reg_names):
authorThiemo Seufer <ths@networkno.de>
Fri, 28 Apr 2006 11:42:28 +0000 (11:42 +0000)
committerThiemo Seufer <ths@networkno.de>
Fri, 28 Apr 2006 11:42:28 +0000 (11:42 +0000)
Map MIPS16 registers to O32 names.
(print_mips16_insn_arg): Use mips16_reg_names.

opcodes/ChangeLog
opcodes/mips-dis.c

index 23e030435d7b9349bc9aebfbd6c57b130abea10c..35d9a3d1434904ea72a44e98658d1f8937294532 100644 (file)
@@ -1,3 +1,10 @@
+2006-04-28  Thiemo Seufer  <ths@mips.com>
+            Nigel Stevens  <nigel@mips.com>
+
+       * opcodes/mips-dis.c (mips16_to_32_reg_map, mips16_reg_names):
+       Map MIPS16 registers to O32 names.
+       (print_mips16_insn_arg): Use mips16_reg_names.
+
 2006-04-26  Julian Brown  <julian@codesourcery.com>
 
        * arm-dis.c (print_insn_neon): Disassemble floating-point constant
index 9a48d86d2d10888362b6615f02f96d252b6914e1..5001f06ac407621f53e4b8a845befdaaa9f595dc 100644 (file)
@@ -51,12 +51,15 @@ struct mips_cp0sel_name
   const char * const name;
 };
 
-/* The mips16 register names.  */
-static const char * const mips16_reg_names[] =
+/* The mips16 registers.  */
+static const unsigned int mips16_to_32_reg_map[] =
 {
-  "s0", "s1", "v0", "v1", "a0", "a1", "a2", "a3"
+  16, 17, 2, 3, 4, 5, 6, 7
 };
 
+#define mips16_reg_names(rn)   mips_gpr_names[mips16_to_32_reg_map[rn]]
+
+
 static const char * const mips_gpr_names_numeric[32] =
 {
   "$0",   "$1",   "$2",   "$3",   "$4",   "$5",   "$6",   "$7",
@@ -1283,27 +1286,27 @@ print_mips16_insn_arg (char type,
     case 'y':
     case 'w':
       (*info->fprintf_func) (info->stream, "%s",
-                            mips16_reg_names[((l >> MIPS16OP_SH_RY)
-                                              & MIPS16OP_MASK_RY)]);
+                            mips16_reg_names(((l >> MIPS16OP_SH_RY)
+                                              & MIPS16OP_MASK_RY)));
       break;
 
     case 'x':
     case 'v':
       (*info->fprintf_func) (info->stream, "%s",
-                            mips16_reg_names[((l >> MIPS16OP_SH_RX)
-                                              & MIPS16OP_MASK_RX)]);
+                            mips16_reg_names(((l >> MIPS16OP_SH_RX)
+                                              & MIPS16OP_MASK_RX)));
       break;
 
     case 'z':
       (*info->fprintf_func) (info->stream, "%s",
-                            mips16_reg_names[((l >> MIPS16OP_SH_RZ)
-                                              & MIPS16OP_MASK_RZ)]);
+                            mips16_reg_names(((l >> MIPS16OP_SH_RZ)
+                                              & MIPS16OP_MASK_RZ)));
       break;
 
     case 'Z':
       (*info->fprintf_func) (info->stream, "%s",
-                            mips16_reg_names[((l >> MIPS16OP_SH_MOVE32Z)
-                                              & MIPS16OP_MASK_MOVE32Z)]);
+                            mips16_reg_names(((l >> MIPS16OP_SH_MOVE32Z)
+                                              & MIPS16OP_MASK_MOVE32Z)));
       break;
 
     case '0':