From owner-freebsd-arm@FreeBSD.ORG Mon Sep 11 16:32:20 2006 Return-Path: X-Original-To: freebsd-arm@freebsd.org Delivered-To: freebsd-arm@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 702A616A412 for ; Mon, 11 Sep 2006 16:32:20 +0000 (UTC) (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 E76E643D88 for ; Mon, 11 Sep 2006 16:32:19 +0000 (GMT) (envelope-from obrien@NUXI.com) Received: from dragon.NUXI.org (obrien@localhost [127.0.0.1]) by dragon.NUXI.org (8.13.7/8.13.7) with ESMTP id k8BGWIp7088814 for ; Mon, 11 Sep 2006 09:32:19 -0700 (PDT) (envelope-from obrien@dragon.NUXI.org) Received: (from obrien@localhost) by dragon.NUXI.org (8.13.7/8.13.7/Submit) id k8BGWIdn088813 for freebsd-arm@freebsd.org; Mon, 11 Sep 2006 09:32:18 -0700 (PDT) (envelope-from obrien) Date: Mon, 11 Sep 2006 09:32:18 -0700 From: "David O'Brien" To: freebsd-arm@freebsd.org Message-ID: <20060911163218.GA88778@dragon.NUXI.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD 7.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.11 Subject: -O2 optimization X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-arm@freebsd.org List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Sep 2006 16:32:20 -0000 I've been wondering. Since most ARM platforms are RAM and storage limited, should we not compile with -O2 and use -Os instead. -Os is "Optimize for size. -Os enables all -O2 optimizations that do not typically increase code size. It also performs further optimizations designed to reduce code size". So what do folks think about this patch? Index: kern.pre.mk =================================================================== RCS file: /home/ncvs/src/sys/conf/kern.pre.mk,v retrieving revision 1.76 diff -u -p -r1.76 kern.pre.mk --- kern.pre.mk 17 Jul 2006 18:43:16 -0000 1.76 +++ kern.pre.mk 11 Sep 2006 16:29:47 -0000 @@ -27,7 +27,11 @@ COPTFLAGS?= -O . if defined(DEBUG) _MINUS_O= -O . else +. if ${MACHINE_ARCH} == "arm" +_MINUS_O= -Os +. else _MINUS_O= -O2 +. endif . endif . if ${MACHINE_ARCH} == "amd64" COPTFLAGS?=-O2 -frename-registers -pipe -- -- David (obrien@FreeBSD.org) Q: Because it reverses the logical flow of conversation. A: Why is top-posting (putting a reply at the top of the message) frowned upon? From owner-freebsd-arm@FreeBSD.ORG Wed Sep 13 17:11:52 2006 Return-Path: X-Original-To: freebsd-arm@FreeBSD.org Delivered-To: freebsd-arm@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7D28516A547 for ; Wed, 13 Sep 2006 17:11:52 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id A95EF43E98 for ; Wed, 13 Sep 2006 17:10:50 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id k8DH8jEv054544 for ; Wed, 13 Sep 2006 11:08:45 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 13 Sep 2006 11:08:48 -0600 (MDT) Message-Id: <20060913.110848.-311941144.imp@bsdimp.com> To: freebsd-arm@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <20060911163218.GA88778@dragon.NUXI.org> References: <20060911163218.GA88778@dragon.NUXI.org> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Wed, 13 Sep 2006 11:08:46 -0600 (MDT) Cc: Subject: Re: -O2 optimization X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2006 17:11:52 -0000 In message: <20060911163218.GA88778@dragon.NUXI.org> "David O'Brien" writes: : I've been wondering. Since most ARM platforms are RAM and storage : limited, should we not compile with -O2 and use -Os instead. : : -Os is "Optimize for size. -Os enables all -O2 optimizations that do not : typically increase code size. It also performs further optimizations : designed to reduce code size". : : So what do folks think about this patch? I like the idea, but I'm not sure I like the testing of MACHINE_ARCH directly for this. Maybe something like OPT_SMALL being defined instead? However, the following change saved ~65kB in a ~1900kB kernel I just built, or about 3%. That seems signficant enough to me to have a knob for. : Index: kern.pre.mk : =================================================================== : RCS file: /home/ncvs/src/sys/conf/kern.pre.mk,v : retrieving revision 1.76 : diff -u -p -r1.76 kern.pre.mk : --- kern.pre.mk 17 Jul 2006 18:43:16 -0000 1.76 : +++ kern.pre.mk 11 Sep 2006 16:29:47 -0000 : @@ -27,7 +27,11 @@ COPTFLAGS?= -O : . if defined(DEBUG) : _MINUS_O= -O : . else : +. if ${MACHINE_ARCH} == "arm" : +_MINUS_O= -Os : +. else : _MINUS_O= -O2 : +. endif : . endif : . if ${MACHINE_ARCH} == "amd64" : COPTFLAGS?=-O2 -frename-registers -pipe : : -- : -- David (obrien@FreeBSD.org) : Q: Because it reverses the logical flow of conversation. : A: Why is top-posting (putting a reply at the top of the message) frowned upon? : _______________________________________________ : freebsd-arm@freebsd.org mailing list : http://lists.freebsd.org/mailman/listinfo/freebsd-arm : To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" : :