Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Apr 2003 08:16:17 +0300
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        mike@FreeBSD.org
Subject:   Re: cvs commit: src/sys/sys endian.h src/share/man/man9 byteorder.9
Message-ID:  <20030405051617.GB38538@sunbay.com>
In-Reply-To: <20030404.160823.91026001.imp@bsdimp.com>
References:  <Pine.BSF.4.21.0304031545540.15187-100000@root.org> <20030403184229.D18209@espresso.bsdmike.org> <20030404085200.GA1765@sunbay.com> <20030404.160823.91026001.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--8w3uRX/HFJGApMzv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Apr 04, 2003 at 04:08:23PM -0700, M. Warner Losh wrote:
> In message: <20030404085200.GA1765@sunbay.com>
>             Ruslan Ermilov <ru@FreeBSD.org> writes:
> : +#define	BSWAP64(x)	(uint64_t) \
> : +	(((x) >> 56) | (((x) >> 40) & 0xff00) | (((x) >> 24) & 0xff0000) | \
> : +	(((x) >> 8) & 0xff000000) | (((x) << 8) & ((uint64_t)0xff << 32)) | \
> : +	(((x) << 24) & ((uint64_t)0xff << 40)) | \
> : +	(((x) << 40) & ((uint64_t)0xff << 48)) | (((x) << 56)))
>=20
> 0xffull or 0xffULL might be better than the casts here.  This does
> assume that 0ull =3D=3D (uint64_t)0, which does hold for all our
> architectures...
>=20
Why make assumptions where uint64_t gives us precisely what
we need?  Note that these are evaluated at compile time, so
it cannot affect the run-time performance.


Cheers,
--=20
Ruslan Ermilov		Sysadmin and DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age

--8w3uRX/HFJGApMzv
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE+jmahUkv4P6juNwoRAuJ3AJ9Rc8UbtMvJo6/88fmsuxWuC+Sj2ACfccgo
Dlr3EVZdp3l5jgC6R2c9LXU=
=vfBQ
-----END PGP SIGNATURE-----

--8w3uRX/HFJGApMzv--



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