From patchwork Wed Jun 29 16:03:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: harsha.jagasia@amd.com X-Patchwork-Id: 102622 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]) by ozlabs.org (Postfix) with SMTP id A86A9B6F59 for ; Thu, 30 Jun 2011 02:06:12 +1000 (EST) Received: (qmail 1964 invoked by alias); 29 Jun 2011 16:06:08 -0000 Received: (qmail 1949 invoked by uid 22791); 29 Jun 2011 16:06:06 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from tx2ehsobe004.messaging.microsoft.com (HELO TX2EHSOBE007.bigfish.com) (65.55.88.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Jun 2011 16:05:52 +0000 Received: from mail171-tx2-R.bigfish.com (10.9.14.248) by TX2EHSOBE007.bigfish.com (10.9.40.27) with Microsoft SMTP Server id 14.1.225.22; Wed, 29 Jun 2011 16:05:51 +0000 Received: from mail171-tx2 (localhost.localdomain [127.0.0.1]) by mail171-tx2-R.bigfish.com (Postfix) with ESMTP id 417CA3B0148 for ; Wed, 29 Jun 2011 16:05:51 +0000 (UTC) X-SpamScore: -2 X-BigFish: VPS-2(zz936eKzz1202hzz8275bhz32i668h839h62h) X-Spam-TCS-SCL: 1:0 X-Forefront-Antispam-Report: CIP:163.181.249.109; KIP:(null); UIP:(null); IPVD:NLI; H:ausb3twp02.amd.com; RD:none; EFVD:NLI Received: from mail171-tx2 (localhost.localdomain [127.0.0.1]) by mail171-tx2 (MessageSwitch) id 1309363549995421_443; Wed, 29 Jun 2011 16:05:49 +0000 (UTC) Received: from TX2EHSMHS015.bigfish.com (unknown [10.9.14.250]) by mail171-tx2.bigfish.com (Postfix) with ESMTP id EFB8C87804C for ; Wed, 29 Jun 2011 16:05:49 +0000 (UTC) Received: from ausb3twp02.amd.com (163.181.249.109) by TX2EHSMHS015.bigfish.com (10.9.99.115) with Microsoft SMTP Server id 14.1.225.22; Wed, 29 Jun 2011 16:05:49 +0000 X-M-MSG: Received: from sausexedgep01.amd.com (sausexedgep01-ext.amd.com [163.181.249.72]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ausb3twp02.amd.com (Axway MailGate 3.8.1) with ESMTP id 23E0CC8538 for ; Wed, 29 Jun 2011 11:05:45 -0500 (CDT) Received: from sausexhtp02.amd.com (163.181.3.152) by sausexedgep01.amd.com (163.181.36.54) with Microsoft SMTP Server (TLS) id 8.3.106.1; Wed, 29 Jun 2011 11:05:58 -0500 Received: from sausexmb1.amd.com (163.181.3.156) by sausexhtp02.amd.com (163.181.3.152) with Microsoft SMTP Server id 8.3.83.0; Wed, 29 Jun 2011 11:05:47 -0500 Received: from gccpike4.amd.com ([10.236.44.242]) by sausexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 29 Jun 2011 11:03:55 -0500 From: To: , , , , CC: Message-ID: <20110629160354.2895.50678.sendpatchset@gccpike4.amd.com> Subject: Backport patches that are correctness or performance bug fixes for latest AMD/Intel hardware. Date: Wed, 29 Jun 2011 11:03:55 -0500 MIME-Version: 1.0 X-OriginatorOrg: amd.com 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 Is it ok to commit backported patch from trunk below to gcc 4.6 as long as bootstrap and tests pass (ongoing)? This is one of the patches that is significant enough a bug for recent AMD and Intel hardware. 2011-06-29 Harsha Jagasia Backport from mainline 2011-05-31 Alexandre Oliva * config/i386/i386.c (ix86_rtx_costs): Drop NEG from sub for FMA. * config/i386/sse.md: Add n to negated FMA pattern names. Index: config/i386/sse.md =================================================================== --- config/i386/sse.md (revision 175646) +++ config/i386/sse.md (working copy) @@ -2130,7 +2130,7 @@ (define_insn "*fma_fmsub_" [(set_attr "type" "ssemuladd") (set_attr "mode" "")]) -(define_insn "*fma_fmadd_" +(define_insn "*fma_fnmadd_" [(set (match_operand:FMAMODE 0 "register_operand" "=x,x,x") (fma:FMAMODE (neg:FMAMODE @@ -2145,7 +2145,7 @@ (define_insn "*fma_fmadd_" [(set_attr "type" "ssemuladd") (set_attr "mode" "")]) -(define_insn "*fma_fmsub_" +(define_insn "*fma_fnmsub_" [(set (match_operand:FMAMODE 0 "register_operand" "=x,x,x") (fma:FMAMODE (neg:FMAMODE Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (revision 175646) +++ config/i386/i386.c (working copy) @@ -29081,12 +29081,12 @@ ix86_rtx_costs (rtx x, int code, int out /* Negate in op0 or op2 is free: FMS, FNMA, FNMS. */ sub = XEXP (x, 0); if (GET_CODE (sub) == NEG) - sub = XEXP (x, 0); + sub = XEXP (sub, 0); *total += rtx_cost (sub, FMA, speed); sub = XEXP (x, 2); if (GET_CODE (sub) == NEG) - sub = XEXP (x, 0); + sub = XEXP (sub, 0); *total += rtx_cost (sub, FMA, speed); return true; }