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]

bits in registers


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.

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