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/53513] [SH] Add support for fschg and fpchg insns and improve fenv support
Date: Tue, 14 Oct 2014 12:26:00 -0000	[thread overview]
Message-ID: <bug-53513-4-CI3wctYDlj@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-53513-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #22 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Oleg Endo from comment #21)
> (In reply to Oleg Endo from comment #17)
> > 
> > In the 'addsf3_i' pattern, I've tried replacing the
> > 
> >     (use (match_operand:PSI 3 "fpscr_operand" "c"))
> > 
> > with
> > 
> >     (set (match_operand:PSI 3 "fpscr_operand" "=&c")
> >          (unspec:PSI [(match_dup 3)] UNSPEC_FPSCR_SET))]
> > 
> > 
> > I haven't checked all the other side effects it could have, but at least the
> > FMA combine patterns still seem work after that change.
> 
> With those changes above applied to all the other FP insns, the FMA tests in
> gcc.target/sh fail.

As well as some of the FSCA tests.  E.g. 'return sinf (x) + cosf (x)' would
expand into two sincos patterns and normally combine would fold them into one. 
However, it doesn't understand the unspec:PSI stuff and tries to nest it such
as:
Failed to match this instruction:
(parallel [
        (set (reg:SI 174)
            (fix:SI (reg:SF 167)))
        (set (reg/v:PSI 151 )
            (unspec:PSI [
                    (unspec:PSI [
                            (reg/v:PSI 151 )
                        ] UNSPEC_FPSCR)
                ] UNSPEC_FPSCR))
    ])

I've tried adding a predicate that recursively matches those nested unspec:PSI
things, which makes combine happy, but then reload would bail out for some
reason.  Moreover, fp insns that do this

 (set (match_operand:PSI 3 "fpscr_operand" "=&c")
      (unspec:PSI [(match_dup 3)] UNSPEC_FPSCR_SET))]

won't get eliminated even if their results are unused/dead.
I'm trying to come up with some alternative approach.


  parent reply	other threads:[~2014-10-14 12:26 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-29  1:51 [Bug target/53513] New: SH Target: Add support for fschg and fpchg insns olegendo at gcc dot gnu.org
2013-03-10 19:54 ` [Bug target/53513] " olegendo at gcc dot gnu.org
2013-07-31 17:12 ` olegendo at gcc dot gnu.org
2014-03-13 20:48 ` olegendo at gcc dot gnu.org
2014-03-16 20:47 ` olegendo at gcc dot gnu.org
2014-03-16 23:32 ` olegendo at gcc dot gnu.org
2014-03-17  1:30 ` bugdal at aerifal dot cx
2014-03-17  9:09 ` olegendo at gcc dot gnu.org
2014-03-17 11:53 ` chrbr at gcc dot gnu.org
2014-03-17 13:51 ` kkojima at gcc dot gnu.org
2014-03-17 14:23 ` olegendo at gcc dot gnu.org
2014-03-17 15:18 ` chrbr at gcc dot gnu.org
2014-03-17 15:41 ` olegendo at gcc dot gnu.org
2014-05-12  8:47 ` chrbr at gcc dot gnu.org
2014-10-11 21:28 ` olegendo at gcc dot gnu.org
2014-10-11 22:02 ` olegendo at gcc dot gnu.org
2014-10-11 22:09 ` olegendo at gcc dot gnu.org
2014-10-12 14:13 ` olegendo at gcc dot gnu.org
2014-10-13  6:57 ` [Bug target/53513] [SH] Add support for fschg and fpchg insns and improve fenv support olegendo at gcc dot gnu.org
2014-10-13 14:40 ` olegendo at gcc dot gnu.org
2014-10-14  3:46 ` olegendo at gcc dot gnu.org
2014-10-14 12:26 ` olegendo at gcc dot gnu.org [this message]
2014-10-15  0:06 ` olegendo at gcc dot gnu.org
2014-10-15  1:00 ` olegendo at gcc dot gnu.org
2014-10-15  4:02 ` kkojima at gcc dot gnu.org
2014-10-15  8:41 ` olegendo at gcc dot gnu.org
2014-10-15 17:57 ` olegendo at gcc dot gnu.org
2014-10-15 22:08 ` olegendo at gcc dot gnu.org
2014-10-16  1:13 ` kkojima at gcc dot gnu.org
2014-10-16 10:59 ` olegendo at gcc dot gnu.org
2014-10-16 12:12 ` olegendo at gcc dot gnu.org
2014-10-16 13:28 ` kkojima at gcc dot gnu.org
2014-10-16 18:57 ` olegendo at gcc dot gnu.org
2014-10-17  9:22 ` olegendo at gcc dot gnu.org
2014-10-17 17:42 ` olegendo at gcc dot gnu.org
2014-10-17 22:20 ` olegendo at gcc dot gnu.org
2014-10-17 23:16 ` kkojima at gcc dot gnu.org
2014-12-07 23:20 ` olegendo at gcc dot gnu.org
2014-12-10  0:22 ` olegendo at gcc dot gnu.org
2014-12-10  8:32 ` olegendo at gcc dot gnu.org
2014-12-13 13:18 ` olegendo at gcc dot gnu.org
2014-12-14 14:00 ` [Bug target/53513] [SH] Add support for fpchg insn " olegendo at gcc dot gnu.org
2014-12-16 21:29 ` olegendo at gcc dot gnu.org
2014-12-21 17:54 ` 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-53513-4-CI3wctYDlj@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).