From owner-freebsd-current Thu Feb 27 0:38:17 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EDCFA37B401 for ; Thu, 27 Feb 2003 00:38:15 -0800 (PST) Received: from grassmarket.ucs.ed.ac.uk (grassmarket.ucs.ed.ac.uk [129.215.166.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id A47EA43F75 for ; Thu, 27 Feb 2003 00:38:13 -0800 (PST) (envelope-from bruce@cran.org.uk) Received: from fourtytwo.brucec.backnet (12266209.resnet.ed.ac.uk [10.6.0.100] (may be forged)) by grassmarket.ucs.ed.ac.uk (8.11.6/8.11.6) with ESMTP id h1R8c1h04979; Thu, 27 Feb 2003 08:38:11 GMT Received: from fourtytwo.brucec.backnet (localhost.fourtytwo.brucec.backnet [127.0.0.1]) by fourtytwo.brucec.backnet (8.12.6/8.12.6) with ESMTP id h1R8c0b1096559; Thu, 27 Feb 2003 08:38:00 GMT (envelope-from bruce@fourtytwo.brucec.backnet) Received: (from bruce@localhost) by fourtytwo.brucec.backnet (8.12.6/8.12.6/Submit) id h1R8c0oT096558; Thu, 27 Feb 2003 08:38:00 GMT Date: Thu, 27 Feb 2003 08:38:00 +0000 From: Bruce Cran To: alasir@supereva.it Cc: current@freebsd.org Subject: Re: -O2 considered harmful Message-ID: <20030227083800.GA96372@fourtytwo.brucec.backnet> References: <20030227025155.61529.qmail@web40310.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030227025155.61529.qmail@web40310.mail.yahoo.com> User-Agent: Mutt/1.5.3i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Feb 26, 2003 at 06:51:55PM -0800, Rhett Monteg Hollander wrote: > Nuno Teixeira wrote: > > > > Hi, > > > > Just a little question: > > > > Does -march=k6-2 implies -m3dnow? Or -march=pentiumpro implies -mmmx? > Pentium Pro doesn't support MMX; -march=pentiumpro (aka -march=i686) enables > compiling with main i686 instruction set, no MMX\SSE or whatever. > > > > > I always thought that when I use -march it will enable other > > porcessor specific optimizations like mmx and 3dnow (if available). > No way. Besides, only a dozen of open-source UNIX applications can really > profit from MMX, so it's absurd to use -mmmx for day-by-day use. To be correct, > MMX is only useful for real-time video\audio processing. > > A little example: consider some 16-bit pixel set that you need to increase > brightness, i.e. to add some value to every pixel. You can load a word into > integer register, process, and store. You can also load a quadword of four > 16-bit values into MMX register which is mapped onto FPU register, process them > at once, and store. Indeed to be faster. > > Enabling MMX usually results in about 50% performance increase for true CISC > processors like P-MMX, and about 20% for PII and up. > I'm afraid you're wrong - the V2SI datatype and MMX functions automatically become available after -march=pentium2, while with other processor types you've got to explicitly add -mmmx. -msse is presumed with -march=pentium3 and up. It's far from absurd to use mmx for everyday applications - sure, only a few applications may take advantage of it, but I've seen code which runs 40x faster when compiled for athlon-xp than for i386, and I would guess that a lot of that is because of clever use of sse and mmx. That wasn't an audio/video program, it was the libgmp arbitrary precision maths package. Also, I'm sure most people wouldn't say no to 50% more processing speed for free! So, if you've got a pentium, k6 or pentiumpro which supports MMX, you _do_ need to explicitly add -mmmx, but for other processors it's implied. Bruce Cran To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message