public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paul Koning <paulkoning@comcast.net>
To: GCC Development <gcc@gcc.gnu.org>
Subject: decrement_and_branch_until_zero pattern
Date: Fri, 08 Jun 2018 09:42:00 -0000	[thread overview]
Message-ID: <40F210CF-1193-48F5-AA77-1AB93E6CA642@comcast.net> (raw)

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

             reply	other threads:[~2018-06-08  0:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-08  9:42 Paul Koning [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40F210CF-1193-48F5-AA77-1AB93E6CA642@comcast.net \
    --to=paulkoning@comcast.net \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).