public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* decrement_and_branch_until_zero pattern
@ 2018-06-08  9:42 Paul Koning
  2018-06-08 11:00 ` Andreas Schwab
  0 siblings, 1 reply; 7+ messages in thread
From: Paul Koning @ 2018-06-08  9:42 UTC (permalink / raw)
  To: GCC Development

I'm a bit puzzled by the decrement_and_branch_until_zero looping pattern.  The manual described it as a named pattern, through from the description it isn't clear that it's referenced by name.  I see those only in m68k and pa.  There are similar looking but anonymous patterns in pdp11 and vax, suggesting that those were meant to be recognized by their structure.

One puzzle is that the body of gcc doesn't reference that pattern name as far as I can see.

The other puzzle is that I see no sign that the pattern works.  I made up my own simple test file and I can't get pdp11, vax, or m68k to generate a loop using that pattern.  Stranger yet, there is a test case gcc.c-torture/execution/dbra-1.c -- a name that suggests it's meant to test this mechanism because dbra is the m68k name for the relevant instruction.  That test case doesn't generate these looping instructions either (I tried those also with m68k, vax, pdp11).  Finally, I tried that file with an old 4.8.0 build for pdp11 I happened to have lying around.

None of these seem to use that loop optimization, with -O2 or -Os.  Did I miss some magic switch to turn on something else that isn't on by default?  Or is this a feature that was broken long ago and not noticed?  If so, any hints where I might look for a reason?

	paul

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

end of thread, other threads:[~2018-07-05 16:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-08  9:42 decrement_and_branch_until_zero pattern Paul Koning
2018-06-08 11:00 ` Andreas Schwab
2018-06-08 13:22   ` Paul Koning
2018-06-08 20:12     ` Jim Wilson
2018-06-08 20:22       ` Paul Koning
2018-06-08 22:40         ` Jim Wilson
2018-07-05 16:50           ` Paul Koning

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