public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/31485] C complex numbers, amd64 SSE, missed optimization opportunity
Date: Tue, 21 Apr 2020 07:07:18 +0000	[thread overview]
Message-ID: <bug-31485-4-MWyu0ort20@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-31485-4@http.gcc.gnu.org/bugzilla/>

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |53947
                 CC|                            |uros at gcc dot gnu.org

--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Joel Yliluoma from comment #11)
> Looks like this issue has taken a step or two *backwards* in the past years.
> 
> Where as the second function used to be vectorized properly, today it seems
> neither of them are.

Which version do you see vectorizing the second (add2) function?

> Contrast this with Clang, which compiles *both* functions into a single
> instruction:
> 
>   vaddps xmm0, xmm1, xmm0
> 
> or some variant thereof depending on the -m options.
> 
> Compiler Explorer link: https://godbolt.org/z/2AKhnt

The main issues on the GCC side are
  a) ABI details not exposed at the point of vectorization (several PRs about
     this exist)
  b) "Poor" support for two-element float vectors (an understatement, we have
     some support for MMX but that's integer only, but I'm not sure we've
     enabled the 3dnow part to be emulated with SSE)

oddly enough even with -mmmx -m3dnow I see add2 lowered by veclower so
the vector type or the vector add must be unsupported(?).

llvm is known to support emulating smaller vectors just fine (and by
design is also aware of ABI details).


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947
[Bug 53947] [meta-bug] vectorizer missed-optimizations

  parent reply	other threads:[~2020-04-21  7:07 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-31485-4@http.gcc.gnu.org/bugzilla/>
2020-04-21  6:43 ` bisqwit at iki dot fi
2020-04-21  7:07 ` rguenth at gcc dot gnu.org [this message]
2020-04-21  7:17 ` bisqwit at iki dot fi
2020-04-21  7:37 ` rguenth at gcc dot gnu.org
2020-04-21  8:18 ` bisqwit at iki dot fi
2020-04-21  8:23 ` jakub at gcc dot gnu.org
2020-04-21  8:29 ` rguenther at suse dot de
2020-04-21  8:32 ` jakub at gcc dot gnu.org
2020-04-21  8:33 ` jakub at gcc dot gnu.org
2020-04-21  8:34 ` bisqwit at iki dot fi
2020-04-21  8:43 ` jakub at gcc dot gnu.org
2020-04-21  8:47 ` rguenther at suse dot de
2020-04-21  8:51 ` bisqwit at iki dot fi
2020-04-21  8:58 ` jakub at gcc dot gnu.org
2020-04-21  9:06 ` bisqwit at iki dot fi
2021-08-16 21:29 ` pinskia at gcc dot gnu.org
2021-08-16 21:29 ` [Bug tree-optimization/31485] " pinskia at gcc dot gnu.org
2022-02-07  8:48 ` rguenth at gcc dot gnu.org
2023-10-01 18:45 ` pinskia at gcc dot gnu.org
2007-04-05 11:29 [Bug rtl-optimization/31485] New: " bisqwit at iki dot fi
2007-04-09 17:48 ` [Bug rtl-optimization/31485] " rguenth at gcc dot gnu dot org
2008-07-29 22:07 ` victork at gcc dot gnu dot org
2008-08-02 12:23 ` rguenth at gcc dot gnu dot org
2008-08-02 13:01 ` ubizjak at gmail dot com
2008-08-02 13:19 ` rguenth at gcc dot gnu dot org
2010-04-17  0:28 ` ddesics at gmail dot com
2010-04-17 11:11 ` rguenth at gcc dot gnu dot org
2010-04-21 11:33 ` irar at il dot ibm dot com
2010-04-21 11:44 ` rguenther at suse dot de
2010-04-21 18:34 ` irar at il dot ibm dot com

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-31485-4-MWyu0ort20@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).