Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750994AbXACRwM (ORCPT ); Wed, 3 Jan 2007 12:52:12 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750995AbXACRwM (ORCPT ); Wed, 3 Jan 2007 12:52:12 -0500 Received: from xdsl-664.zgora.dialog.net.pl ([81.168.226.152]:1562 "EHLO tuxland.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750993AbXACRwL (ORCPT ); Wed, 3 Jan 2007 12:52:11 -0500 From: Mariusz Kozlowski To: Linus Torvalds Subject: Re: kernel + gcc 4.1 = several problems Date: Wed, 3 Jan 2007 18:53:35 +0100 User-Agent: KMail/1.9.5 Cc: Grzegorz Kulewski , Alan , Mikael Pettersson , s0348365@sms.ed.ac.uk, 76306.1226@compuserve.com, akpm@osdl.org, bunk@stusta.de, greg@kroah.com, linux-kernel@vger.kernel.org, yanmin_zhang@linux.intel.com References: <200701030212.l032CDXe015365@harpo.it.uu.se> In-Reply-To: MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_g2+mFD/cDRUjCDA" Message-Id: <200701031853.36145.m.kozlowski@tuxland.pl> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 10326 Lines: 187 --Boundary-00=_g2+mFD/cDRUjCDA Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello, > Here's an example program that you can test and time yourself. > > On my Core 2, I get > > [torvalds@woody ~]$ gcc -DCMOV -Wall -O2 t.c > [torvalds@woody ~]$ time ./a.out > 600000000 > > real 0m0.194s > user 0m0.192s > sys 0m0.000s > > [torvalds@woody ~]$ gcc -Wall -O2 t.c > [torvalds@woody ~]$ time ./a.out > 600000000 > > real 0m0.167s > user 0m0.168s > sys 0m0.000s Test was done on my laptop with gcc 4.1.1 and CPU: processor : 0 vendor_id : GenuineIntel cpu family : 15 model : 2 model name : Intel(R) Pentium(R) 4 CPU 2.40GHz stepping : 9 cpu MHz : 2392.349 cache size : 512 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr bogomips : 4786.36 clflush size : 64 I wrote a simple script that run each version of your code 100 times measuring the execution time. Then some simple gnuplot magic was applied. The result is attached (png file). - cmovne was faster with almost stable execution time (~171ms) - je-mov was slower and execution time varies Interpretation is up to you ;-) -- Regards, Mariusz Kozlowski --Boundary-00=_g2+mFD/cDRUjCDA Content-Type: image/png; name="benchmark.png" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="benchmark.png" iVBORw0KGgoAAAANSUhEUgAAAnYAAAG/CAIAAABaOQ1PAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA B3RJTUUH1wEDERkxOwBgDAAAF7RJREFUeNrt3dmynDgWBdD0Jf//j7nVD5RpilGAEBrWio4Ol52D kkFbR0x/+r7/AACx/VgEACBiAUDEAoCIBQBELACIWAAQsQCAiAUAEQsAIhYAELEAIGIBQMRCMt1/ pfm6/RfE+qKsPmd/yee2SYQ0e+tXTN++81Hhv332muV/Xvh2RCyk0Pf98JSn8Q93wubwNZ4otVz4 fd+fCoPVF6eJk67rlm2+8CtWPyf8jdNAvfY5iFjILg+ivIa31k7cqj3Nup5VpeNwcNlO2x4ilgIM nddsEm/5n8s/L+f9rk2ELt+1Ohm4/5plk8Y/n/3kkOwJ/5xTv335OdfWzupv36oR8xkQRGlP4kMh 5OlrEZBVyg5d237dsOw3Z68Z+8dTfeXsXdP3LhsW/pqxhdPXh7zrsP2B375Tou184+wPsx+7teS3 1s7q22MVmhc+9olQj7IRImLh8SLjZpf03DlHOw071fidT77ZNV+bV39x/vNyAl1uYfjAJXA9LodN 6Qt0RCxEyODDkmhWk0WJ/OdCZaeFT1R+iX/p2aFMgt8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_g2+mFD/cDRUjCDA-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/