public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "olegendo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/59239] [SH] Improve decrement-and-test insn
Date: Thu, 21 Nov 2013 22:36:00 -0000	[thread overview]
Message-ID: <bug-59239-4-8YGZFfExbn@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-59239-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59239

--- Comment #2 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Oleg Endo from comment #0)
> Created attachment 31264 [details]
> Possible cleanup patch

After applying the patch and replacing the "doloop_end" expander with

(define_expand "doloop_end"
  [(use (match_operand:SI 0 "arith_reg_dest"))  ; loop count pseudo
   (use (match_operand 1))]                     ; label
  "TARGET_SH2"
{
  emit_insn (gen_dect (operands[0], operands[0]));
  emit_jump_insn (gen_branch_false (operands[1]));
  DONE;
})

will expose the individual decrement-and-test and cbranch insns early.  This
shows quite some changes in the CSiBE set.  The decrement-and-test insn will be
used less frequently and there are some code size increases with the worst case
being

src/nrrd/convertNrrd         4868 -> 5240        +372 / +7.641742 %

On the other hand, it causes an overall code size decrease of -3944 bytes on
the whole CSiBE set with some of the highlights being

teem-1.6.0-src  src/nrrd/tmfKernel  132652 -> 131520  -1132 / -0.853361 %
mpeg2dec-0.3.1  libmpeg2/decode     2820 -> 2620      -200 / -7.092199 %

it looks like fewer registers are used and some loop counter setup calculations
are smaller.


  parent reply	other threads:[~2013-11-21 22:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-21 22:00 [Bug target/59239] New: " olegendo at gcc dot gnu.org
2013-11-21 22:08 ` [Bug target/59239] " olegendo at gcc dot gnu.org
2013-11-21 22:36 ` olegendo at gcc dot gnu.org [this message]
2014-05-10 13:03 ` olegendo at gcc dot gnu.org

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=bug-59239-4-8YGZFfExbn@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).