From owner-cvs-src@FreeBSD.ORG Mon Sep 22 14:46:49 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0656416A4B3; Mon, 22 Sep 2003 14:46:49 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A1DF4401A; Mon, 22 Sep 2003 14:46:48 -0700 (PDT) (envelope-from peter@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id h8MLkmXJ045782; Mon, 22 Sep 2003 14:46:48 -0700 (PDT) (envelope-from peter@repoman.freebsd.org) Received: (from peter@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id h8MLkmia045781; Mon, 22 Sep 2003 14:46:48 -0700 (PDT) (envelope-from peter) Message-Id: <200309222146.h8MLkmia045781@repoman.freebsd.org> From: Peter Wemm Date: Mon, 22 Sep 2003 14:46:48 -0700 (PDT) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/i386/include endian.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2003 21:46:49 -0000 peter 2003/09/22 14:46:48 PDT FreeBSD src repository Modified files: sys/i386/include endian.h Log: 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. Obtained from: Ideas from NetBSD and Linux, and some code from NetBSD Revision Changes Path 1.37 +49 -4 src/sys/i386/include/endian.h