From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107471 invoked by alias); 20 May 2016 08:59:24 -0000 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 Received: (qmail 107452 invoked by uid 89); 20 May 2016 08:59:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:U*matz X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Fri, 20 May 2016 08:59:21 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 52DB2AB9D; Fri, 20 May 2016 08:59:18 +0000 (UTC) Date: Fri, 20 May 2016 08:59:00 -0000 From: Richard Biener To: Eric Botcazou cc: gcc-patches@gcc.gnu.org, Michael Matz Subject: Re: [PATCH][RFC] Introduce BIT_FIELD_INSERT In-Reply-To: <10155617.0hHYLBiUYX@polaris> Message-ID: References: <10155617.0hHYLBiUYX@polaris> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2016-05/txt/msg01601.txt.bz2 On Thu, 19 May 2016, Eric Botcazou wrote: > > Index: trunk/gcc/tree.def > > =================================================================== > > *** trunk.orig/gcc/tree.def 2016-05-17 17:19:41.783958489 +0200 > > --- trunk/gcc/tree.def 2016-05-19 10:23:35.779141973 +0200 > > *************** DEFTREECODE (ADDR_EXPR, "addr_expr", tcc > > *** 852,857 **** > > --- 852,871 ---- > > descriptor of type ptr_mode. */ > > DEFTREECODE (FDESC_EXPR, "fdesc_expr", tcc_expression, 2) > > > > + /* Given a word, a value and a bit position within the word, > > + produce the value that results if replacing the parts of word > > + starting at the bit position with value. > > + Operand 0 is a tree for the word of integral or vector type; > > + Operand 1 is a tree for the value of integral or vector element type; > > + Operand 2 is a tree giving the constant position of the first > > referenced bit; + The number of bits replaced is given by the precision > > of the value + type if that is integral or by its size if it is > > non-integral. + ??? The reason to make the size of the replacement > > implicit is to not + have a quaternary operation. > > + The replaced bits shall be fully inside the word. If the word is of > > + vector type the replaced bits shall be aligned with its elements. */ > > + DEFTREECODE (BIT_INSERT_EXPR, "bit_field_insert", tcc_expression, 3) > > + > > "word" is ambiguous (what is a word of vector type?). What's allowed as > operand #0 exactly? If that's anything, I'd call it a value too, possibly > with a qualifier, for example: > > /* Given a container value, a replacement value and a bit position within > the container, produce the value that results from replacing the part of > the container starting at the bit position with the replacement value. > Operand 0 is a tree for the container value of integral or vector type; > Operand 1 is a tree for the replacement value of another integral or > vector element type; > Operand 2 is a tree giving the constant bit position; > The number of bits replaced is given by the precision of the type of the > replacement value if it is integral or by its size if it is non-integral. > ??? The reason to make the size of the replacement implicit is to avoid > introducing a quaternary operation. > The replaced bits shall be fully inside the container. If the container > is of vector type, then these bits shall be aligned with its elements. */ > DEFTREECODE (BIT_INSERT_EXPR, "bit_field_insert", tcc_expression, 3) Sounds good. I will commit later with your wording. Richard.