From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17841 invoked by alias); 14 Oct 2014 12:26:02 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 17791 invoked by uid 48); 14 Oct 2014 12:25:56 -0000 From: "olegendo at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.8.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: olegendo at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-10/txt/msg01054.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53513 --- Comment #22 from Oleg Endo --- (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.