public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [minor fix] radixtree: regulate tag get return value
@ 2006-06-05  3:07 Chuck Ebbert
  0 siblings, 0 replies; 6+ messages in thread
From: Chuck Ebbert @ 2006-06-05  3:07 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Wu Fengguang

In-Reply-To: <20060604131824.e2d1c934.akpm@osdl.org>

On Sun, 4 Jun 2006 13:18:24 -0700, Andrew Morton wrote:

> test_bit() returns (1 & (expr)) - it _has_ to return 0 or 1.

On i386, test_bit(nr, addr) will return 0 or 1 only when nr is
a constant -- it uses (expr != 0).

If nr is a variable it will return either 0 or -1 because it uses:

        __asm__ __volatile__(
                "btl %2,%1\n\tsbbl %0,%0"
                :"=r" (oldbit)
                :"m" (*addr),"Ir" (nr));
        return oldbit;

btl %2,%1 sets the carry flag if the selected bit is set.

sbbl %0,%0 subtracts a register from itself and then subtracts one
from the result if the carry flag is set.

-- 
Chuck


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-06-05  3:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20060604084548.GA5609@mail.ustc.edu.cn>
2006-06-04  8:45 ` [minor fix] radixtree: regulate tag get return value Wu Fengguang
2006-06-04  9:11   ` Andrew Morton
     [not found]     ` <20060604111754.GA5984@mail.ustc.edu.cn>
2006-06-04 11:17       ` Wu Fengguang
2006-06-04 20:18         ` Andrew Morton
     [not found]     ` <20060604112636.GB5984@mail.ustc.edu.cn>
2006-06-04 11:26       ` [PATCH] radixtree: normalize radix_tree_tag_get() " Wu Fengguang
2006-06-05  3:07 [minor fix] radixtree: regulate tag get " Chuck Ebbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox