public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "trippels at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/66002] paq8p benchmark 50% slower than clang on sandybridge
Date: Mon, 04 May 2015 14:11:00 -0000	[thread overview]
Message-ID: <bug-66002-4-PXc0Mti31l@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-66002-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66002

--- Comment #6 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #4)
>   prephitmp_61 = _53 <= 65535 ? pretmp_60 : -32768;
> 
> is
> 
>      unsigned int <= 65535 ? short int : short int;
> 
> pushing the condition to a separate stmt might get us to support this
> "narrowing" conversion.
> 
> Of course ifcvt does a pretty poor job on this as well...
> 
> We do vectorize
> 
>     for (int i=0; i<n; ++i) {
>         int wt=w[i]+((t[i]*err*2>>16)+1>>1);
>         if (wt<-32768) wt=-32768;
> //      if (wt>32767) wt=32767;
>         w[i]=wt;
>     }
> 
> as if (wt<-32768) wt=-32768; becomes a MAX_EXPR.  Also if I change it to
> 
>     for (int i=0; i<n; ++i) {
>         int wt=w[i]+((t[i]*err*2>>16)+1>>1);
>         if (wt<-32768) wt=-32768;
>         else if (wt>32767) wt=32767;
>         w[i]=wt;
>     }
> 
> we vectorize it as MIN/MAX_EXPRs.
> 
> Maybe you can perform this source change manually and see what it does
> to performance.

With the "else" added gcc beats clang:
./paq8p -4 file1.in  24.81s user 0.10s system 100% cpu 24.902 total


  parent reply	other threads:[~2015-05-04 14:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-04  7:20 [Bug tree-optimization/66002] New: " trippels at gcc dot gnu.org
2015-05-04 12:47 ` [Bug tree-optimization/66002] " rguenth at gcc dot gnu.org
2015-05-04 12:55 ` trippels at gcc dot gnu.org
2015-05-04 13:43 ` rguenth at gcc dot gnu.org
2015-05-04 13:57 ` rguenth at gcc dot gnu.org
2015-05-04 14:06 ` rguenth at gcc dot gnu.org
2015-05-04 14:11 ` trippels at gcc dot gnu.org [this message]
2015-05-06 11:51 ` rguenth at gcc dot gnu.org
2015-05-06 12:13 ` rguenth at gcc dot gnu.org
2015-05-07  9:53 ` rguenth at gcc dot gnu.org
2015-05-07  9:54 ` rguenth 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-66002-4-PXc0Mti31l@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).