Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Sep 2003 14:46:48 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/i386/include endian.h
Message-ID:  <200309222146.h8MLkmia045781@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200309222146.h8MLkmia045781>