From owner-cvs-all@FreeBSD.ORG Wed Sep 24 04:40:50 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C7ED816A4B3; Wed, 24 Sep 2003 04:40:50 -0700 (PDT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 15F5143FA3; Wed, 24 Sep 2003 04:40:49 -0700 (PDT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) (authenticated bits=0) h8OBefFs066228 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Wed, 24 Sep 2003 13:40:46 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [IPv6:3ffe:400:8d0:301::12]) by cicely5.cicely.de (8.12.10/8.12.10) with ESMTP id h8OBeeWZ034274 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 24 Sep 2003 13:40:40 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.9/8.12.9) with ESMTP id h8OBedrY088283; Wed, 24 Sep 2003 13:40:40 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.9/8.12.9/Submit) id h8OA3p2Z088026; Wed, 24 Sep 2003 12:03:51 +0200 (CEST) Date: Wed, 24 Sep 2003 12:03:50 +0200 From: Bernd Walter To: Peter Wemm Message-ID: <20030924100349.GR21665@cicely12.cicely.de> References: <20030923164531.6AC882A8DA@canning.wemm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030923164531.6AC882A8DA@canning.wemm.org> X-Operating-System: FreeBSD cicely12.cicely.de 5.1-CURRENT alpha User-Agent: Mutt/1.5.4i cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: Robert Watson cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/i386/include endian.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2003 11:40:50 -0000 On Tue, Sep 23, 2003 at 09:45:31AM -0700, Peter Wemm wrote: > Robert Watson wrote: > > > > On Mon, 22 Sep 2003, Peter Wemm wrote: > > > > > Microoptimization to allow the compiler to evaluate ntohl() etc on > > > known constants at compile time rather than at run time. We have a numbe > r > > > of nasty hacks around the place to cache ntohl() of constants (eg: nfs). > > > This change allows the compiler to compile-time evaluate ntohl(1) as > > > 0x01000000 rather than having to emit assembler code to do it. This > > > has other smaller flow-on effects because the compiler can see that > > > ntohl(constant) itself has a constant value now and can propagate the > > > compile time evaluation. > > > > So should we now be doing a sweep through the tree to remove instances of > > this? I.e.: > > > > /* > > * To avoid byte-swapping the same value over and over again. > > */ > > igmp_all_hosts_group = htonl(INADDR_ALLHOSTS_GROUP); > > igmp_all_rtrs_group = htonl(INADDR_ALLRTRS_GROUP); > > > > Etc? > > It is probably premature to do that just yet (only 2 of 5 or so platforms > handled), but that was the kind of "optimization" that prompted this. > NFS is also riddled with this. 2 platforms is already much - considered that ppc and sparc64 are big endian and therefor not influenced. But I think the above assignment can be optimized away by the compiler in many cases now. Nevertheless - having alpha done first would be fine ;-) -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de