This is the mail archive of the
cgen@sources.redhat.com
mailing list for the CGEN project.
include/dis-asm.h patch for cgen disassemblers
- From: Doug Evans <dje at transmeta dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: binutils at sources dot redhat dot com, cgen at sources dot redhat dot com
- Date: Thu, 31 Jan 2002 12:22:48 -0800 (PST)
- Subject: include/dis-asm.h patch for cgen disassemblers
- References: <20020131124350.C19966@redhat.com>
Frank Ch. Eigler writes:
> 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?
Blech.
Down the road: "Oh. This is a cgen port. Maybe `mach' means `mach',
maybe it doesn't. :-("
methinks `mach' is too well established to overload.
I'd go with the first possibility, and not overload `mach'.
Instead of arch/mach in disassemble_info, have arch/mach/mumble
where mumble is up to each port.
[by "mumble" I mean "you pick the name", not "each port gets
to pick the name" ...]