From owner-freebsd-amd64@FreeBSD.ORG Fri Jul 22 03:49:40 2005 Return-Path: X-Original-To: freebsd-amd64@freebsd.org Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8E5E616A41F for ; Fri, 22 Jul 2005 03:49:40 +0000 (GMT) (envelope-from obrien@NUXI.com) Received: from dragon.NUXI.org (trang.nuxi.com [66.93.134.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 228DD43D8F for ; Fri, 22 Jul 2005 03:49:10 +0000 (GMT) (envelope-from obrien@NUXI.com) Received: from dragon.NUXI.org (obrien@localhost [127.0.0.1]) by dragon.NUXI.org (8.13.4/8.13.4) with ESMTP id j6M3nAV4042093; Thu, 21 Jul 2005 20:49:10 -0700 (PDT) (envelope-from obrien@dragon.NUXI.org) Received: (from obrien@localhost) by dragon.NUXI.org (8.13.4/8.13.1/Submit) id j6M3n99v042092; Thu, 21 Jul 2005 20:49:09 -0700 (PDT) (envelope-from obrien) Date: Thu, 21 Jul 2005 20:49:09 -0700 From: "David O'Brien" To: Olexandr Konovalenko Message-ID: <20050722034909.GD41313@dragon.NUXI.org> References: <49213.130.237.35.96.1121786769.squirrel@webmail.sys.kth.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49213.130.237.35.96.1121786769.squirrel@webmail.sys.kth.se> X-Operating-System: FreeBSD 6.0-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 User-Agent: Mutt/1.5.9i Cc: freebsd-amd64@freebsd.org Subject: Re: better optimization flags for opteron (amd64)// -ffast-math and -O3 are not friends X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-amd64@freebsd.org List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2005 03:49:40 -0000 On Tue, Jul 19, 2005 at 05:26:09PM +0200, Olexandr Konovalenko wrote: > I found that on my system combination of -ffast-math AND -O3 is slower than > -O0 on AMD64 (interestingly it is true for Xeon EM64 as well), how can it be? > though just -O3 gives fastest double precision floating point computations. -O3 does a lot more than just FP optimizations. It also does a lot of inlining that can blow your caches. It is a falicay that -ON is better than -ON-1 level. Look in the GCC manual at http://gcc.gnu.org - you'll see all the optimizations that -O3 implies. Start with -O2 and add ones from the -O3 list to find the best performance for your benchmark on your machine. -- -- David (obrien@FreeBSD.org)