Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys Use fls64() only for types strictly bigger than 4 by...



details:   https://anonhg.NetBSD.org/src/rev/95f551ac5dd7
branches:  trunk
changeset: 764777:95f551ac5dd7
user:      jym <jym%NetBSD.org@localhost>
date:      Tue May 03 21:36:59 2011 +0000

description:
Use fls64() only for types strictly bigger than 4 bytes.

ok christos@. Will ask for a pull-up, using 64 bits ops even for 4-bytes
int's is plain overkill.

diffstat:

 sys/sys/bitops.h |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r c231e1897ffd -r 95f551ac5dd7 sys/sys/bitops.h
--- a/sys/sys/bitops.h  Tue May 03 18:28:44 2011 +0000
+++ b/sys/sys/bitops.h  Tue May 03 21:36:59 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bitops.h,v 1.7 2010/03/21 14:28:15 christos Exp $      */
+/*     $NetBSD: bitops.h,v 1.8 2011/05/03 21:36:59 jym Exp $   */
 
 /*-
  * Copyright (c) 2007, 2010 The NetBSD Foundation, Inc.
@@ -255,7 +255,7 @@
        _ilog2_helper(_n,  2) \
        _ilog2_helper(_n,  1) \
        _ilog2_helper(_n,  0) \
-       -1) : ((sizeof(_n) >= 4 ? fls64(_n) : fls32(_n)) - 1) \
+       -1) : ((sizeof(_n) > 4 ? fls64(_n) : fls32(_n)) - 1) \
 )
 
 static __inline void



Home | Main Index | Thread Index | Old Index