From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932995AbcLIJMF (ORCPT ); Fri, 9 Dec 2016 04:12:05 -0500 Received: from merlin.infradead.org ([205.233.59.134]:45600 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751983AbcLIJMC (ORCPT ); Fri, 9 Dec 2016 04:12:02 -0500 Date: Fri, 9 Dec 2016 10:11:49 +0100 From: Peter Zijlstra To: Thomas Gleixner Cc: LKML , John Stultz , Ingo Molnar , David Gibson , Liav Rehana , Chris Metcalf , Richard Cochran , Parit Bhargava , Laurent Vivier , "Christopher S. Hall" Subject: Re: [patch 5/6] [RFD] timekeeping: Provide optional 128bit math Message-ID: <20161209091149.GE15765@worktop.programming.kicks-ass.net> References: <20161208202623.883855034@linutronix.de> <20161208204229.005418487@linutronix.de> <20161209052638.GC3061@worktop.programming.kicks-ass.net> <20161209063847.GC15765@worktop.programming.kicks-ass.net> <20161209083011.GD15765@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161209083011.GD15765@worktop.programming.kicks-ass.net> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 09, 2016 at 09:30:11AM +0100, Peter Zijlstra wrote: > > > Just for giggles, on tilegx the branch is actually slower than doing the > > > mult unconditionally. > > > > > > The problem is that the two multiplies would otherwise completely > > > pipeline, whereas with the conditional you serialize them. > Only when using x86_64 instructions, once I fixed the i386 variant it > was slower, probably due to register pressure and the like. OK, maybe I messed up on i386, although I've yet to try running that on an actual 32bit machine. I also need to dig up a small core, who knows what atoms do. Results are in cycles, average over 1e6 loops. I think the 128 results are around 1 cycle, measurements are maybe a tad wobbly because I compare against an empty loop to correct measurement overhead. root@ivb-ep:~/tmp# for i in -m64 -m32 -mx32; do echo $i ; gcc -O3 $i -o mult mult.c -lm; ./mult ; done -m64 cond: avg: 5.487738 +- 0.004152 uncond: avg: 4.495690 +- 0.006009 128: avg: 0.634496 +- 0.004795 -m32 cond: avg: 14.807630 +- 0.006890 uncond: avg: 11.601985 +- 0.009722 -mx32 cond: avg: 5.027696 +- 0.005766 uncond: avg: 4.038013 +- 0.008069 128: avg: 0.009928 +- 0.005730 root@hsw:~/tmp# for i in -m64 -m32 -mx32; do echo $i ; gcc -O3 $i -o mult mult.c -lm; ./mult ; done -m64 cond: avg: 1.998718 +- 0.008775 uncond: avg: 2.004795 +- 0.009865 128: avg: 0.991947 +- 0.007607 -m32 cond: avg: 12.981868 +- 0.011239 uncond: avg: 13.000566 +- 0.011668 -mx32 cond: avg: 2.005437 +- 0.006840 uncond: avg: 3.001631 +- 0.004786 128: avg: 1.990425 +- 0.003880