From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29570 invoked by alias); 14 Jul 2011 09:10:55 -0000 Received: (qmail 29552 invoked by uid 22791); 14 Jul 2011 09:10:54 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e9.ny.us.ibm.com (HELO e9.ny.us.ibm.com) (32.97.182.139) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Jul 2011 09:10:40 +0000 Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by e9.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p6E8ceKO026724 for ; Thu, 14 Jul 2011 04:38:40 -0400 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p6E9Acoi1720416 for ; Thu, 14 Jul 2011 05:10:38 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p6E5AP0x024341 for ; Thu, 14 Jul 2011 02:10:25 -0300 Received: from [9.152.224.27] (dyn-9-152-224-27.boeblingen.de.ibm.com [9.152.224.27]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p6E5AOZJ023956 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 14 Jul 2011 02:10:25 -0300 Message-ID: <4E1EB28C.1040405@linux.vnet.ibm.com> Date: Thu, 14 Jul 2011 09:28:00 -0000 From: Andreas Krebbel User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10 MIME-Version: 1.0 To: Richard Henderson CC: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] widening_mul: Do cost check when propagating mult into plus/minus expressions References: <20110713131305.GA5348@bart> <4E1DCEA0.5080007@redhat.com> In-Reply-To: <4E1DCEA0.5080007@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-07/txt/msg01110.txt.bz2 On 07/13/2011 06:58 PM, Richard Henderson wrote: > Why the force_operand? You've got register inputs. Either the target > is going to support the operation or it isn't. > Seems to me you can check the availability of the operation in the > optab and pass that gen_rtx_fmt_ee result to rtx_cost directly. Do I really need to check optab for availability at this point? For FMA convert_mult_to_fma already did the check. But what to do if no optab is available for add/mul? Assume extraordinary high costs? This probably wouldn't make sense since it would make a mul or add more expensive than an fma. Or perhaps the rtx_cost hooks should handle that by returning high costs for everything the backend is not able to implement directly? >> + bool speed = optimize_bb_for_speed_p (gimple_bb (mul_stmt)); >> + static unsigned mul_cost[NUM_MACHINE_MODES]; >> + static unsigned add_cost[NUM_MACHINE_MODES]; >> + static unsigned fma_cost[NUM_MACHINE_MODES]; > ... >> + if (!fma_cost[mode]) >> + { >> + fma_cost[mode] = compute_costs (mode, FMA, speed); >> + add_cost[mode] = compute_costs (mode, PLUS, speed); >> + mul_cost[mode] = compute_costs (mode, MULT, speed); >> + } > > Saving cost data dependent on speed, which is non-constant. > You probably need to make this a two dimensional array. Right. I'll fix this. Bye, -Andreas-