From mboxrd@z Thu Jan 1 00:00:00 1970 From: Doug Evans To: Ben Elliston Cc: cgen@sources.redhat.com Subject: operating on individual register bits Date: Fri, 18 May 2001 07:54:00 -0000 Message-id: <15109.14229.904787.96141@casey.transmeta.com> References: <15108.51009.551848.162882@scooby.apac.redhat.com> X-SW-Source: 2001-q2/msg00072.html Ben Elliston writes: > 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? There's comments regarding this in the code and/or docs. I wasn't sure how I wanted to go (e.g. follow gcc's rtl support for this or not) so I punted until there was a need and more thought could be put in. It's a reasonable thing to add but it needs to be thought about (try to find lots of architectures with such support and see what works best to describe them).