public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* operating on individual register bits
@ 2001-05-17 23:55 Ben Elliston
  2001-05-18  5:00 ` Johan Rydberg
  2001-05-18  7:54 ` Doug Evans
  0 siblings, 2 replies; 3+ messages in thread
From: Ben Elliston @ 2001-05-17 23:55 UTC (permalink / raw)
  To: cgen

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: operating on individual register bits
  2001-05-17 23:55 operating on individual register bits Ben Elliston
@ 2001-05-18  5:00 ` Johan Rydberg
  2001-05-18  7:54 ` Doug Evans
  1 sibling, 0 replies; 3+ messages in thread
From: Johan Rydberg @ 2001-05-18  5:00 UTC (permalink / raw)
  To: Ben Elliston; +Cc: cgen

Ben Elliston wrote:
> 
> 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.

To my knowledge there is no such rtx fns.  Looking at your reply to
the same question asked by me some time ago:

 http://sources.redhat.com/ml/cgen/2001-q1/msg00062.html
 
> 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?

That would be great!

regards,
johan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* operating on individual register bits
  2001-05-17 23:55 operating on individual register bits Ben Elliston
  2001-05-18  5:00 ` Johan Rydberg
@ 2001-05-18  7:54 ` Doug Evans
  1 sibling, 0 replies; 3+ messages in thread
From: Doug Evans @ 2001-05-18  7:54 UTC (permalink / raw)
  To: Ben Elliston; +Cc: cgen

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).

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-05-18  7:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-17 23:55 operating on individual register bits Ben Elliston
2001-05-18  5:00 ` Johan Rydberg
2001-05-18  7:54 ` Doug Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).