From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25319 invoked by alias); 22 Jul 2011 13:29:23 -0000 Received: (qmail 25311 invoked by uid 22791); 22 Jul 2011 13:29:23 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,TW_CF X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 22 Jul 2011 13:29:07 +0000 Received: (qmail 7955 invoked from network); 22 Jul 2011 13:29:06 -0000 Received: from unknown (HELO ?84.152.166.209?) (bernds@127.0.0.2) by mail.codesourcery.com with ESMTPA; 22 Jul 2011 13:29:06 -0000 Message-ID: <4E297B04.3000701@codesourcery.com> Date: Fri, 22 Jul 2011 14:01:00 -0000 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110715 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: Andrew Stubbs CC: gcc-patches@gcc.gnu.org, patches@linaro.org Subject: Re: [PATCH (1/7)] New optab framework for widening multiplies References: <4E034EF2.3070503@codesourcery.com> <4E034F98.5000809@codesourcery.com> <4E186929.9080805@codesourcery.com> <4E296E70.1040207@codesourcery.com> <4E297ABE.6040401@codesourcery.com> In-Reply-To: <4E297ABE.6040401@codesourcery.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/msg01956.txt.bz2 On 07/22/11 15:27, Andrew Stubbs wrote: > On 22/07/11 13:34, Bernd Schmidt wrote: >>> @@ -1242,7 +1242,8 @@ expand_binop_directly (enum machine_mode mode, >>> optab binoptab, >>> > rtx target, int unsignedp, enum optab_methods methods, >>> > rtx last) >>> > { >>> > - enum insn_code icode = optab_handler (binoptab, mode); >>> > + enum machine_mode from_mode = GET_MODE (op0); >>> > + enum insn_code icode = widening_optab_handler (binoptab, mode, >>> from_mode); >> Please add a new function along the lines of >> >> enum machine_mode >> widened_mode (enum machine_mode to_mode, rtx op0, rtx op1) >> { >> if (GET_MODE (op1) == VOIDmode) >> return GET_MODE (op0); >> gcc_assert (GET_MODE (op0) == GET_MODE (op1); >> return GET_MODE (op0); >> } >> >> I'll want to extend this at some point to allow widening multiplies >> where only one operand is widened (with a new set of optabs). > > Sorry, I don't quite understand what you're getting at here? > > expand_binop_directly is only ever used, I think, when the tree > optimizer has already identified what insn to use. Both before and after > my patch, the tree-cfg gimple verification requires that both op0 and > op1 are the same mode, and non-widening operation are always he same > mode, so I think my code is perfectly adequate. Is that not so? For the moment, yes. Oh well, let's shelve it and do it later. Bernd