From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24478 invoked by alias); 22 Jul 2011 13:27:43 -0000 Received: (qmail 24469 invoked by uid 22791); 22 Jul 2011 13:27:42 -0000 X-SWARE-Spam-Status: No, hits=-2.2 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:27:29 +0000 Received: (qmail 7583 invoked from network); 22 Jul 2011 13:27:28 -0000 Received: from unknown (HELO ?192.168.0.104?) (ams@127.0.0.2) by mail.codesourcery.com with ESMTPA; 22 Jul 2011 13:27:28 -0000 Message-ID: <4E297ABE.6040401@codesourcery.com> Date: Fri, 22 Jul 2011 13:50:00 -0000 From: Andrew Stubbs User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110627 Thunderbird/5.0 MIME-Version: 1.0 To: Bernd Schmidt 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> In-Reply-To: <4E296E70.1040207@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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/msg01955.txt.bz2 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? If you want to add support for machine instructions that only widen one input, then that's surely a separate problem? If the target mode is smaller than the combined size of the inputs, then the changes to the widening_mul pass would be non-trivial. If the point is just to be absolutely certain that the inputs are valid then I'm happy to add the function. BTW, did you mean the have the unused parameter? Andrew