This is the mail archive of the
cgen@sources.redhat.com
mailing list for the CGEN project.
bits in registers
- To: Johan Rydberg <johan dot rydberg at netinsight dot se>
- Subject: bits in registers
- From: Doug Evans <dje at transmeta dot com>
- Date: Fri, 12 Jan 2001 18:37:54 -0800 (PST)
- Cc: cgen at sources dot redhat dot com
- References: <3A5FB82F.E7B7B2F4@netinsight.se>
Johan Rydberg writes:
> As you all know (or not) the PowerPC has a condition register (32 bits
> wide) that is split into eight "sub-registers", CR0-CR7. These registers
> can be altered, moved, anded and compared. The whole register can be
> accessed aswell.
>
> Since CGEN don't have a 4-bit quantity I have defined the sub-registers
> as bytes (QI):
>
> (define-hardware
> (name h-cr) (comment "condition register") (attrs PROFILE)
> (type register QI (8))
> )
>
> Is there a simple way to, for example, modify bit 2 in (reg h-cr 2),
> or do I have to mask and or it into place?
The appropriate rtx fns need only be created ...
> I really don't want to escape into C just for doing this !
You shouldn't have to, nor should you.