From: Chuck Ebbert <76306.1226@compuserve.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Wu Fengguang <wfg@mail.ustc.edu.cn>
Subject: Re: [minor fix] radixtree: regulate tag get return value
Date: Sun, 4 Jun 2006 23:07:32 -0400 [thread overview]
Message-ID: <200606042309_MC3-1-C19F-CFFD@compuserve.com> (raw)
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
next reply other threads:[~2006-06-05 3:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-05 3:07 Chuck Ebbert [this message]
[not found] <20060604084548.GA5609@mail.ustc.edu.cn>
2006-06-04 8:45 ` 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200606042309_MC3-1-C19F-CFFD@compuserve.com \
--to=76306.1226@compuserve.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wfg@mail.ustc.edu.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome