This is the mail archive of the
cgen@sources.redhat.com
mailing list for the CGEN project.
variable length insns
- To: Ben Elliston <bje at redhat dot com>
- Subject: variable length insns
- From: Doug Evans <dje at transmeta dot com>
- Date: Thu, 29 Mar 2001 23:30:11 -0800 (PST)
- Cc: cgen at sources dot redhat dot com
- References: <15041.7535.134168.721180@scooby.apac.redhat.com>
Ben Elliston writes:
> Despite fche's "Eureka!" the other day, things still don't quite work
> with respect to variable length instructions. I currently have my
> 16/32 bit ISA split thusly (insn-lsb0? #t):
>
> 16 0 31 15
> +-----------+ +----------+
> | base-insn | | optional |
> +-----------+ +----------+
>
> In its internal representation (an int), should I expect the
> instruction to be represented as (base_insn << 16) | optional? Or
> will it assume the correct bit order of 31 .. 0? That's my first
> question.
Trying to keep such insns in an int is problematic.
Dunno what the "correct" bit order should be in this context.
What would you want for a little vs big endian host?
For ISA's like these, just think of insns as a byte stream.
> I realise this aspect of cgen is frought with danger, but I'd
> appreciate any guidance in order to make the necessary enhancements.
I dunno about danger.
Suppose you take the route of not trying to keep a 32 bit insn
in an int (maybe ditto for 16 bit insns).