operating on individual register bits

Ben Elliston bje@redhat.com
Thu May 17 23:55:00 GMT 2001


Frequently, I find myself wanting to set and clear individual bits of
hardware registers in rtl.  Perhaps such a mechanism already exists.
If it does, I'm not aware of it.  Here is the canonical example:

	 (set cc.z 1)

versus:

	(set cc (or cc (sll SI 1 10))),

which makes much less sense to the reader.

Is it sensible to extend cgen to give names to individual bits of a
register such that operands on registers can adopt this C/Pascal-style
syntax for accessing individual bits?

Ben



More information about the Cgen mailing list