From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1495 Path: news.gmane.org!not-for-mail From: Solar Designer Newsgroups: gmane.linux.lib.musl.general Subject: Re: crypt_blowfish integration, optimization Date: Fri, 10 Aug 2012 02:21:03 +0400 Message-ID: <20120809222103.GA29365@openwall.com> References: <20120808022421.GE27715@brightrain.aerifal.cx> <20120808044235.GA22470@openwall.com> <20120808052844.GF27715@brightrain.aerifal.cx> <20120808062706.GA23135@openwall.com> <20120808214855.GL27715@brightrain.aerifal.cx> <20120809033613.GA24926@openwall.com> <20120809072940.GA26288@openwall.com> <20120809105348.GA27361@openwall.com> <20120809214654.GU27715@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1344550866 23727 80.91.229.3 (9 Aug 2012 22:21:06 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Aug 2012 22:21:06 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-1496-gllmg-musl=m.gmane.org@lists.openwall.com Fri Aug 10 00:21:06 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Szb6I-0005IL-DV for gllmg-musl@plane.gmane.org; Fri, 10 Aug 2012 00:21:06 +0200 Original-Received: (qmail 20389 invoked by uid 550); 9 Aug 2012 22:21:05 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 20381 invoked from network); 9 Aug 2012 22:21:05 -0000 Content-Disposition: inline In-Reply-To: <20120809214654.GU27715@brightrain.aerifal.cx> User-Agent: Mutt/1.4.2.3i Xref: news.gmane.org gmane.linux.lib.musl.general:1495 Archived-At: On Thu, Aug 09, 2012 at 05:46:54PM -0400, Rich Felker wrote: > I've taken this version and made some minimum changes based on my > version, mainly for integration with musl where I'm testing it. I also > think we've reached the final word on loop unrolling: > > Just For Fun, I tried replacing your unrolled BF_ROUND loop with a for > loop and compiling with -O3 on gcc 4.6.3. After noticing the > performance numbers were coming out near-identical, and that the .o > sizes were mysteriously identical, I decided, Just For Fun, to > disassemble both versions with objdump and diff them. They are > identical. That is, modern gcc generates byte-for-byte identical code > with -O3 for the manually unrolled loop and the for loop. What about -O2? -O3 is probably not what will be used for most musl builds, is it? Hmm, for me "gcc -Q -O2 --help=optimizers" and ditto for -O3 both show "disabled" for -funroll-loops. Why was the loop unrolled for you? Did you also have -funroll-loops specified explicitly? If so, does this happen for normal musl builds? I guess not? As discussed, the problem with avoiding such hand-unrolls is that the compiler doesn't know just which loops are most important to unroll. BTW, what speeds are you getting on your Atom? How does this compare to the original crypt_blowfish-1.2 with asm code (both on 32-bit)? Alexander