NetBSD-Bugs archive

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

Re: lib/49745: tests/include/sys/t_bitops: improvement



The following reply was made to PR lib/49745; it has been noted by GNATS.

From: christos%zoulas.com@localhost (Christos Zoulas)
To: gnats-bugs%NetBSD.org@localhost, lib-bug-people%netbsd.org@localhost, 
	gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
Cc: 
Subject: Re: lib/49745: tests/include/sys/t_bitops: improvement
Date: Sat, 14 Mar 2015 10:18:14 -0400

 On Mar 14,  9:55am, isaki%pastel-flower.jp@localhost (isaki%pastel-flower.jp@localhost) wrote:
 -- Subject: lib/49745: tests/include/sys/t_bitops: improvement
 
 | >Number:         49745
 | >Category:       lib
 | >Synopsis:       tests/include/sys/t_bitops: improvement
 | >Confidential:   no
 | >Severity:       non-critical
 | >Priority:       low
 | >Responsible:    lib-bug-people
 | >State:          open
 | >Class:          sw-bug
 | >Submitter-Id:   net
 | >Arrival-Date:   Sat Mar 14 09:55:00 +0000 2015
 | >Originator:     Tetsuya Isaki
 | >Release:        NetBSD-current (2015/02)
 | >Organization:
 | >Environment:
 | NetBSD XXXXX 7.99.4 NetBSD 7.99.4 (GENERIC) #1: Wed Feb 11 12:54:54 JST 2015  isaki@XXXXX:/var/obj/current/x68k/obj/sys/arch/x68k/compile/GENERIC x68k
 | >Description:
 | The current ilog2()'s implementation consists of 32bit variable
 | part, 64bit variable part and constant part.  But 'ilog2_basic'
 | test checks only 64bit variable.  32bit variable and constant
 | were not checked.
 | 
 | 'ilog2_log2' test is fully meaningless.  It checks only bit 0
 | and bit 16-31 of 64bit variable though it spent 65000 times loop.
 | All range of 64bit variable was already checked by 'ilog2_basic'
 | before.
 | 
 | In addition, comparing it with math log2() is also really bad
 | idea.  It should be compared with prepared(=pre-calculated)
 | value.  The current 'ilog2_log2' test does not seem to work
 | on vax and QEMU due to lack/fail of math log2() according to
 | source code comment (I don't know details and it seems to work
 | on my QEMU though..).  However, it's not necessary to use math
 | log2() here.
 
 I would prefer if you put the constants in an array and loop instead
 of inlining it.
 
 christos
 


Home | Main Index | Thread Index | Old Index