* vax-dis.c (entry_mask_bit): New array.
authorAlan Modra <amodra@gmail.com>
Wed, 9 Mar 2005 13:08:26 +0000 (13:08 +0000)
committerAlan Modra <amodra@gmail.com>
Wed, 9 Mar 2005 13:08:26 +0000 (13:08 +0000)
(print_insn_vax): Decode function entry mask.

opcodes/ChangeLog
opcodes/vax-dis.c

index ff232f5e467bd226d857cfe84b1aeed74d1e1894..405937f254a69a373331963ab968deb2b9ac868d 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-09  Jan-Benedict Glaw  <jbglaw@lug-owl.de>
+
+       * vax-dis.c (entry_mask_bit): New array.
+       (print_insn_vax): Decode function entry mask.
+
 2005-03-07  Aldy Hernandez  <aldyh@redhat.com>
 
        * ppc-opc.c (powerpc_opcodes): Fix encoding of efscfd.
@@ -8,7 +13,7 @@
 
 2005-03-03  Ramana Radhakrishnan  <ramana.radhakrishnan@codito.com>
 
-       * opcodes/arc-dis.c: Add enum a4_decoding_class.
+       * arc-dis.c (a4_decoding_class): New enum.
        (dsmOneArcInst): Use the enum values for the decoding class.
        Remove redundant case in the switch for decodingClass value 11.
 
index a97d4cd25785de13b888164845f70897897eeb84..bac6291baf95d5ec45d426a329790f4e37432554 100644 (file)
@@ -1,5 +1,6 @@
 /* Print VAX instructions.
-   Copyright 1995, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 1995, 1998, 2000, 2001, 2002, 2005
+   Free Software Foundation, Inc.
    Contributed by Pauline Middelink <middelin@polyware.iaf.nl>
 
 This program is free software; you can redistribute it and/or modify
@@ -34,6 +35,21 @@ static char *reg_names[] =
   "r8", "r9", "r10", "r11", "ap", "fp", "sp", "pc"
 };
 
+/* Definitions for the function entry mask bits.  */
+static char *entry_mask_bit[] =
+{
+  /* Registers 0 and 1 shall not be saved, since they're used to pass back
+     a function's result to it's caller...  */
+  "~r0~", "~r1~",
+  /* Registers 2 .. 11 are normal registers.  */
+  "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11",
+  /* Registers 12 and 13 are argument and frame pointer and must not
+     be saved by using the entry mask.  */
+  "~ap~", "~fp~",
+  /* Bits 14 and 15 control integer and decimal overflow.  */
+  "IntOvfl", "DecOvfl",
+};
+
 /* Sign-extend an (unsigned char). */
 #if __STDC__ == 1
 #define COERCE_SIGNED_CHAR(ch) ((signed char)(ch))
@@ -140,6 +156,27 @@ print_insn_vax (memaddr, info)
       buffer[1] = 0;
     }
 
+  /* Decode function entry mask.  */
+  if (info->symbols
+      && info->symbols[0]
+      && (info->symbols[0]->flags & BSF_FUNCTION)
+      && memaddr == bfd_asymbol_value (info->symbols[0]))
+    {
+      int i = 0;
+      int register_mask = buffer[1] << 8 | buffer[0];
+
+      (*info->fprintf_func) (info->stream, "Entry mask 0x%04x = <",
+                            register_mask);
+
+      for (i = 15; i >= 0; i--)
+       if (register_mask & (1 << i))
+          (*info->fprintf_func) (info->stream, " %s", entry_mask_bit[i]);
+
+      (*info->fprintf_func) (info->stream, " >");
+
+      return 2;
+    }
+
   for (votp = &votstrs[0]; votp->name[0]; votp++)
     {
       register vax_opcodeT opcode = votp->detail.code;
This page took 0.036832 seconds and 4 git commands to generate.