public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* include/dis-asm.h patch for cgen disassemblers
@ 2002-01-31  9:43 Frank Ch. Eigler
  2002-01-31 12:22 ` Doug Evans
  0 siblings, 1 reply; 24+ messages in thread
From: Frank Ch. Eigler @ 2002-01-31  9:43 UTC (permalink / raw)
  To: binutils, cgen

Hi -

I have a scenario where I need a (cgen-based) disassembler to select
a given list of instruction sets of a multi-ISA processor, based on
a run-time condition.  This is something like the arm/thumb or
mips/mips16 split (odd PC), except that there is no trivial way to
encode the run-time condition.  The raw arch/mach parameters are
fixed, and there is no object file for the disassembler to look
into to guess from (based on PC).  So, I can either expand the
disassemble_info structure, or overload an existing field.  

I went with the latter for this patch.  It adds a new .flags option,
which tells cgen-based disassemblers to pull out the ISA bitmask out
of the .mach field.  This is no great loss, since the mach field is
not normally used for such purposes in cgen ports, and can be
overridden on a per-target basis for exceptions.

Any comments / objections?

- FChE


Index: opcodes/ChangeLog
===================================================================
@@ -1,3 +1,8 @@
+2002-01-25  Frank Ch. Eigler  <fche@redhat.com>
+
+	* cgen-dis.in (print_insn_@arch@): Support HAVE_CGEN_ISA_NOT_MACH
+	disassemble_info flag.
+

Index: opcodes/cgen-dis.in
===================================================================
@@ -380,13 +380,19 @@
 #ifdef CGEN_COMPUTE_MACH
   mach = CGEN_COMPUTE_MACH (info);
 #else
-  mach = info->mach;
+  if (info->flags & HAVE_CGEN_ISA_NOT_MACH)
+    mach = 0;
+  else
+    mach = info->mach;
 #endif
 
 #ifdef CGEN_COMPUTE_ISA
   isa = CGEN_COMPUTE_ISA (info);
 #else
-  isa = 0;
+  if (info->flags & HAVE_CGEN_ISA_NOT_MACH)
+    isa = info->mach;
+  else
+    isa = 0;
 #endif
 
   /* If we've switched cpu's, close the current table and open a new one.  */

Index: include/ChangeLog
===================================================================
@@ -1,3 +1,8 @@
+2002-01-25  Frank Ch. Eigler  <fche@redhat.com>
+
+	* dis-asm.h (HAVE_CGEN_ISA_NOT_MACH): New possible bitmask for
+	disassemble_info flags.
+

Index: include/dis-asm.h
===================================================================
@@ -93,6 +93,7 @@
      The bottom 16 bits are for the internal use of the disassembler.  */
   unsigned long flags;
 #define INSN_HAS_RELOC	0x80000000
+#define HAVE_CGEN_ISA_NOT_MACH 0x40000000 /* .mach is really a cgen isa bitmask.  */
   PTR private_data;
 
   /* Function used to get bytes to disassemble.  MEMADDR is the



^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2002-02-05 20:42 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-31  9:43 include/dis-asm.h patch for cgen disassemblers Frank Ch. Eigler
2002-01-31 12:22 ` Doug Evans
2002-01-31 13:21   ` Frank Ch. Eigler
2002-01-31 13:41     ` Doug Evans
2002-02-01 10:13       ` Frank Ch. Eigler
2002-02-01 10:22         ` Doug Evans
2002-02-01 10:28         ` Andrew Cagney
2002-02-01 10:36           ` Frank Ch. Eigler
2002-02-01 11:00             ` Andrew Cagney
2002-01-31 13:55     ` Andrew Cagney
2002-01-31 15:42       ` Frank Ch. Eigler
2002-01-31 16:03         ` Andrew Cagney
2002-01-31 16:57           ` Frank Ch. Eigler
2002-01-31 22:33             ` Andrew Cagney
     [not found]               ` <20020201092827.H6166@redhat.com>
     [not found]                 ` <3C5AE910.4090009@cygnus.com>
2002-02-01 11:56                   ` Frank Ch. Eigler
2002-02-01 12:02                     ` Andrew Cagney
2002-02-01 12:10                       ` Frank Ch. Eigler
2002-02-01 12:44                         ` Andrew Cagney
2002-02-01 12:56                           ` Andrew Cagney
2002-02-01 13:23                             ` Frank Ch. Eigler
     [not found]                               ` <3C5B1E19.8030405@cygnus.com>
2002-02-04  8:32                                 ` Frank Ch. Eigler
     [not found]                                   ` <3C601DB8.7080700@cygnus.com>
2002-02-05 11:29                                     ` Frank Ch. Eigler
2002-02-05 12:42                                       ` Doug Evans
     [not found]                     ` <3C5AF9D1.8070607@cygnus.com>
2002-02-01 12:39                       ` Frank Ch. Eigler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).