Types and other issues with cgen
Doug Evans
dje@transmeta.com
Wed Aug 6 20:50:00 GMT 2003
Doug Evans writes:
> > Michael writes
> > 2) Cgen has a type mechanism (DI/SI/etc.) but it doesn't seem to be used in the
> > actual code for at least the assembler and disassembler
>
> Using the modes in the assembler/disassembler isn't the right way to go.
> These modes are for semantic operation, not assembly/disassembly.
> Imagine some instruction with an immediate operand that is a fixed
> set of constants that is encoded with special magic numbers.
> Register indices are another example.
> There's a disconnect between representation in the instruction
> and use during semantic evaluation.
Blech. I should have let my reply sit in my head awhile before
^c^c-ing.
Here's my proposal. We record in cgen_fields a type big enough
to hold the field (or some minor variant thereof) and have
inserters/extractors for each type in use.
More information about the Cgen
mailing list