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 target/87555] There is no need for UNSPEC_FMADDSUB
Date: Fri, 18 Jun 2021 07:32:42 +0000 [thread overview]
Message-ID: <bug-87555-4-3hORb323DL@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-87555-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87555
--- Comment #14 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Hongtao.liu from comment #13)
> (In reply to Richard Biener from comment #12)
> > (In reply to Hongtao.liu from comment #10)
> > > > Note I'm not sure that doing fmaddsub as merge of fma and fms will be
> > > > optimal since that most definitely will preclude combine from recognizing
> > > > fmaddsub from (addsub (mul ..) x) which would be another goal to support
> > > > (PR81904)
> > >
> > > I guess you're talking about
> > >
> > > #include <x86intrin.h>
> > > __m128d f(__m128d x, __m128d y, __m128d z){
> > > return _mm_addsub_pd(_mm_mul_pd(x,y),z);
> > > }
> > >
> > > which pass_combine tries
> > >
> > > Failed to match this instruction:
> > > (set (reg:V2DF 88)
> > > (vec_merge:V2DF (minus:V2DF (mult:V2DF (reg:V2DF 90)
> > > (reg:V2DF 91))
> > > (reg:V2DF 92))
> > > (plus:V2DF (mult:V2DF (reg:V2DF 90)
> > > (reg:V2DF 91))
> > > (reg:V2DF 92))
> > > (const_int 1 [0x1])))
> > >
> > > but doesn't realize fisrt merge operand is fms and second is fma.
> >
> > Yes. This situation will happen when I push the SLP pattern detection
> > for addsub - we then no longer detect FMA on the GIMPLE level (we might
> > want to improve that as well, of course, exposing standard pattern names
> > for fmaddsub and fmsubadd).
>
> if fm{a,s}_optab is supported in the backend, can we always simplify (minus
> A (mult B C)) to (fma B C (neg A)) and (plus A (mult B C)) to (fma B C A)?
I suppose we could within the appropriate constraints (FP contraction allowed).
next prev parent reply other threads:[~2021-06-18 7:32 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bug-87555-4@http.gcc.gnu.org/bugzilla/>
2021-06-17 12:07 ` rguenth at gcc dot gnu.org
2021-06-18 1:22 ` crazylht at gmail dot com
2021-06-18 1:57 ` crazylht at gmail dot com
2021-06-18 5:40 ` crazylht at gmail dot com
2021-06-18 6:00 ` crazylht at gmail dot com
2021-06-18 6:02 ` crazylht at gmail dot com
2021-06-18 6:11 ` crazylht at gmail dot com
2021-06-18 6:34 ` crazylht at gmail dot com
2021-06-18 7:00 ` rguenth at gcc dot gnu.org
2021-06-18 7:09 ` crazylht at gmail dot com
2021-06-18 7:09 ` rguenth at gcc dot gnu.org
2021-06-18 7:11 ` rguenth at gcc dot gnu.org
2021-06-18 7:16 ` crazylht at gmail dot com
2021-06-18 7:32 ` rguenth at gcc dot gnu.org [this message]
2021-06-18 7:48 ` crazylht at gmail dot com
2021-06-18 10:29 ` rguenth at gcc dot gnu.org
2021-09-12 23:44 ` pinskia 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-87555-4-3hORb323DL@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).