This is the mail archive of the
cgen@sources.redhat.com
mailing list for the CGEN project.
how to test which register is being used?
- To: matthew green <mrg at cygnus dot com>
- Subject: how to test which register is being used?
- From: Doug Evans <dje at transmeta dot com>
- Date: Tue, 5 Sep 2000 12:42:35 -0700 (PDT)
- Cc: cgen at sources dot redhat dot com
- References: <301.968181140@cygnus.com>
matthew green writes:
> how can one determine which register is being used, rather than
> the value of the register? i need to determine (in several
> instructions) whether r6 or r7 are being used, and if so, set
> a status bit (one for r6, one for r7). the only solution i can
> think of (that bje also suggested) was to have something in the
> getter/setter to allow this, but as not every time these registers
> are used are the status bits set, so this would not be correct.
I'll review this more thoroughly tomorrow (visiting sunny (cough!)
Edmonton). IIRC, if the register number is taken from an insn field,
just refer to the ifield. I think there are existing examples of
this.
e.g. look at the ldr15gr pattern in fr30.cpu. maybe that is what you want.