From patchwork Tue Apr 9 11:25:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joern Rennecke X-Patchwork-Id: 235050 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 5073B2C009D for ; Tue, 9 Apr 2013 21:25:35 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:to:cc:subject:references:in-reply-to :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=RCPIOBvIhnocuUMVu7kFqK5Y1qnVSSsvLjpi6mT+8jMHwfECkNhCD 5ySjd6oINSVRS+XogtYLsGXV1e/CItfF01GYWbT++TOPOSQPS0l0yrq5cfkUJ1r9 aID8upAqbjrcgEiEmWZwdrF81Vqahoi/CpvmKgKDqxk0dp8Ii/95X4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:to:cc:subject:references:in-reply-to :mime-version:content-type:content-transfer-encoding; s=default; bh=il0vslYov8/AaZCcL3T+fdyImSU=; b=kdsP8s7E3fGPiYmtXDhaiZwyDPhD 9sRV04rmxJlGrNJph9VSZxB/bUjuFyXYCTprj0c3BCTXKAn/hk64n/HrGEltsX+q isWVqhiVtpMKq84+XrHDMAOtHKhnzM3XRH3y71g3Huzvy78TlPZWqKgYQHZyBIM3 q2JP7ncxbvcIWhU= Received: (qmail 6799 invoked by alias); 9 Apr 2013 11:25:29 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 6787 invoked by uid 89); 9 Apr 2013 11:25:29 -0000 X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, MIME_QP_LONG_LINE, TW_MF autolearn=ham version=3.3.1 Received: from c62.cesmail.net (HELO c62.cesmail.net) (216.154.195.54) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 09 Apr 2013 11:25:28 +0000 Received: from unknown (HELO epsilon2) ([192.168.1.60]) by c62.cesmail.net with ESMTP; 09 Apr 2013 07:25:26 -0400 Received: from cust213-dsl91-135-11.idnet.net (cust213-dsl91-135-11.idnet.net [91.135.11.213]) by webmail.spamcop.net (Horde MIME library) with HTTP; Tue, 09 Apr 2013 07:25:25 -0400 Message-ID: <20130409072525.7t4cx69hc0os0c08-nzlynne@webmail.spamcop.net> Date: Tue, 09 Apr 2013 07:25:25 -0400 From: Joern Rennecke To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: Re: RFA: Fix tree-optimization/55524 References: <20130408111056.gvvtnyc8w04cww8g-nzlynne@webmail.spamcop.net> In-Reply-To: MIME-Version: 1.0 User-Agent: Internet Messaging Program (IMP) H3 (4.1.4) X-Virus-Found: No Quoting Richard Biener : > On Mon, Apr 8, 2013 at 5:10 PM, Joern Rennecke > wrote: >> This is basically the same patch as attached to the PR, except that I >> have changed the goto-loop into a do-while loop with a new comment; >> this caused the need for a lot of reformatting. > > Can you please include a testcase that shows the effect of this? Attached. FWIW, the assembler is simpler to understand if you add the compilation option -mfp-mode=round-nearest. Without the patch, you then get: _f: fmul r1,r1,r3 mov r3, %low(#-2147483648) movt r3, %high(#-2147483648) eor r1,r3,r1 fmadd r1,r0,r2 mov r0,r1 rts And with the patch: _f: fmul r0,r0,r2 fmsub r0,r1,r3 rts >> 2013-04-08 Joern Rennecke >> >> * tree-ssa-math-opts.c (mult_to_fma_pass): New file static struct. >> (convert_mult_to_fma): In first pass, don't use an fms construct >> when we don't have an fms operation, but fmna. > > it's fnma I believe. Oops, yes, typo. The patch itself has the right spelling. 2013-03-09 Joern Rennecke * gcc.target/epiphany/fnma-1.c: New test. Index: gcc.target/epiphany/fnma-1.c =================================================================== --- gcc.target/epiphany/fnma-1.c (revision 0) +++ gcc.target/epiphany/fnma-1.c (working copy) @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-final { scan-assembler-times "fmsub\[ \ta-zA-Z0-9\]*," 1 } } */ + +float +f (float ar, float ai, float br, float bi) +{ + return ar * br - ai * bi; +}