From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2790 invoked by alias); 12 Aug 2010 20:25:23 -0000 Received: (qmail 2778 invoked by uid 22791); 12 Aug 2010 20:25:22 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD 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; Thu, 12 Aug 2010 20:25:19 +0000 Received: (qmail 17492 invoked from network); 12 Aug 2010 20:25:17 -0000 Received: from unknown (HELO localhost) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 12 Aug 2010 20:25:17 -0000 Date: Thu, 12 Aug 2010 21:09:00 -0000 From: Nathan Froyd To: Tom Tromey Cc: Andi Kleen , Richard Guenther , gcc-patches@gcc.gnu.org Subject: Re: The speed of the compiler, was: Re: Combine four insns Message-ID: <20100812202516.GT25394@codesourcery.com> References: <4C601691.1000303@moene.org> <4C601E08.4020303@google.com> <4C6035C2.9020505@moene.org> <4C60378B.4060303@google.com> <4C603AC2.5070403@moene.org> <45B5C4E0-DFA5-413E-8FC8-E13077862245@apple.com> <877hjy8qwk.fsf@basil.nowhere.org> <20100810151112.GD6801@basil.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) 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: 2010-08/txt/msg00948.txt.bz2 On Tue, Aug 10, 2010 at 01:51:46PM -0600, Tom Tromey wrote: > >>>>> "Andi" == Andi Kleen writes: > > Richard> I'm sure there is a way to open-code this using integer math. > > Andi> I don't think so. Take a look at what PCMPESTRI does. There's no easy > Andi> replacement, even if you use all the Hacker's Delight tricks > Andi> (it's really a cool instruction, but also very complicated :-) > > This is still pending: > > http://gcc.gnu.org/ml/gcc-patches/2010-03/msg00526.html > > I think any sort of hackery in this area is fine, if it speeds up the > compiler. All that is needed is someone with the time and motivation to > do the testing. FWIW, testing it on x86-64 on two source files lying about (admittedly a rather small sample size) reduced the # of instructions executed cc1plus -E by ~6% in one case and 0% (yes, exactly 0%) in the other. Perhaps there's a bug lying about (the patch wouldn't compile on a little-endian machine, for one...). I like Andi's PCMPESTRI idea, but that does nothing for the many people without Intel's latest generation of chips (of which there are many), let alone people on other platforms. -Nathan