From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2087 invoked by alias); 13 Jun 2011 10:57:44 -0000 Received: (qmail 2079 invoked by uid 22791); 13 Jun 2011 10:57:43 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,TW_IV X-Spam-Check-By: sourceware.org Received: from mail-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 13 Jun 2011 10:57:29 +0000 Received: by wye20 with SMTP id 20so3664890wye.20 for ; Mon, 13 Jun 2011 03:57:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.55.67 with SMTP id t3mr4911537wbg.90.1307962648161; Mon, 13 Jun 2011 03:57:28 -0700 (PDT) Received: by 10.227.28.69 with HTTP; Mon, 13 Jun 2011 03:57:28 -0700 (PDT) In-Reply-To: References: <4DEDB98F.6010508@redhat.com> <4DEE2DCF.7020905@redhat.com> <4DEE3484.8030101@redhat.com> <4DF11FBC.3010304@redhat.com> <4DF223D4.3080700@redhat.com> <4DF22656.9050700@redhat.com> <37B61697-B4A5-49B6-87C4-AD361A86F752@comcast.net> Date: Mon, 13 Jun 2011 12:46:00 -0000 Message-ID: Subject: Re: RFA (fold): PATCH for c++/49290 (folding *(T*)(ar+10)) From: Richard Guenther To: Mike Stump Cc: Richard Guenther , Jason Merrill , gcc-patches List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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-06/txt/msg00968.txt.bz2 On Mon, Jun 13, 2011 at 5:17 AM, Mike Stump wrote: > On Jun 12, 2011, at 3:55 AM, Richard Guenther wrote: >> In almost all cases(*) the need for a lvalue VIEW_CONVERT_EXPR can be av= oided >> by moving the VIEW_CONVERT_EXPR to the rvalue assigned too it. =A0Rememb= er that >> VIEW_CONVERT_EXPR always conver the full object and are not allowed to >> change sizes. >> >> So, do you have an example? > > Sure, take a divmod type of instruction.[1] =A0It has two outputs, a div = and a mod. =A0The instruction operates on registers, and produces two compl= etely independent values. =A0But really, it is a general features of the bu= ilt-in mechanism that Kenny and I are working on that some people would lik= e to reuse for other ports. =A0The general feature is that one can declare = any argument to a built-in to be input only, output only or input/output. = =A0This nicely matches what I think quite of lot of machines do for assembl= y language semantics. =A0The support isn't to match my machine, but rather = to support building a port, in which 1 or more instructions have such param= eters. =A0Requiring memory is a non-starter, and in fact, we already have a= scheme for memory_operand type things for the instructions that take memor= y. =A0The scheme used for them is borrowed from C++, where we just declare = that the built-in takes a reference type. =A0This reuses most of the code p= aths from C++ and it seems to work nicely. =A0I'd be tempting to use it for= register references, but, in my current scheme for registers, I support da= ta flow in, out and in/out at the tree level and at the rtl level. =A0We be= lieve this is nice from an optimizing perspective, and probably required to= get the warnings about using uninitialized variables correct. That's not exactly an example - I can't think of how you want or need to use VIEW_CONVERT_EXPRs to implement said divmod instruction or why you would need anything special for the _argument_ of said instruction. An instruction or call with multiple outputs would simply be something like { div_1, mod_2 } =3D __builtin_divmod (arg_3); with two SSA defs. A nice representation for the tree for { div_1, mod_2 } remains to be found (if it should be a single tree at all, or possibly multiple ones). We already play tricks for sincos for example via tem_1 =3D __builtin_cexpi (arg_2); sin_3 =3D REALPART_EXPR ; cos_4 =3D IMAGPART_EXPR ; which avoids the two defs by using a single def which is then decomposed. So, can you elaborate a bit more on what you want to do with special argument kinds? Elaborate with an actual example, not words. Thanks, Richard.