From owner-cvs-all@FreeBSD.ORG Tue Sep 23 07:33:29 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 94E5516A4B3; Tue, 23 Sep 2003 07:33:29 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id D45CC43F93; Tue, 23 Sep 2003 07:33:26 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.9/8.12.9) with ESMTP id h8NEXBgL082914; Tue, 23 Sep 2003 10:33:11 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)h8NEXBoe082911; Tue, 23 Sep 2003 10:33:11 -0400 (EDT) Date: Tue, 23 Sep 2003 10:33:11 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Peter Wemm In-Reply-To: <200309222146.h8MLkmia045781@repoman.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org 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 List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2003 14:33:29 -0000 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 number > 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? Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories