This is the mail archive of the cgen@sources.redhat.com mailing list for the CGEN project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

include/dis-asm.h patch for cgen disassemblers


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" ...]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]