From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72968 invoked by alias); 20 May 2016 15:54:55 -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 72929 invoked by uid 89); 20 May 2016 15:54:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*r:503, (unknown), act X-HELO: one.firstfloor.org Received: from one.firstfloor.org (HELO one.firstfloor.org) (193.170.194.197) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 20 May 2016 15:54:44 +0000 Received: by one.firstfloor.org (Postfix, from userid 503) id 68B5C87176; Fri, 20 May 2016 17:54:39 +0200 (CEST) Date: Fri, 20 May 2016 15:54:00 -0000 From: Andi Kleen To: gcc-patches@gcc.gnu.org Cc: Andi Kleen Subject: Re: [PATCH][RFC] Introduce BIT_FIELD_INSERT Message-ID: <20160520155439.GU13997@two.firstfloor.org> References: <87r3cwes8x.fsf@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2016-05/txt/msg01668.txt.bz2 On Fri, May 20, 2016 at 05:11:59PM +0200, Marc Glisse wrote: > On Fri, 20 May 2016, Andi Kleen wrote: > > >Richard Biener writes: > > > >>The following patch adds BIT_FIELD_INSERT, an operation to > >>facilitate doing bitfield inserts on registers (as opposed > >>to currently where we'd have a BIT_FIELD_REF store). > > > >I wonder if these patches would make it easier to use the Haswell > >bit manipulations instructions on x86 (which act on registers). > > > >I found that gcc makes significantly less use of them than LLVM, > >sometimes leading to much bigger code. > > Could you point at some bugzilla entries? I don't really see which > BMI* instruction could be helped by BIT_FIELD_INSERT (PDEP seems too > hard). There is one BMI1 instruction we don't use much, bextr (only > defined with an UNSPEC in i386.md, unlike the TBM version), but it > is about extracting. Ok. Yes I was thinking of BEXTR. I thought I had filed a bugzilla at some point, but can't find it right now. If you compare bitfield code compiled for Haswell on LLVM and GCC it is very visible how much worse gcc is. So perhaps it only needs changes in the backend. -Andi