LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: James Antill <james@and.org>
Cc: Andi Kleen <ak@suse.de>, linux-kernel@vger.kernel.org
Subject: Re: Linux 2.4.10-pre11 -- __builtin_expect
Date: 27 Sep 2001 18:28:08 +0200 [thread overview]
Message-ID: <jeofnwsinb.fsf@sykes.suse.de> (raw)
In-Reply-To: <20010918031813.57E1062ABC@oscar.casa.dyndns.org.suse.lists.linux.kernel> <E15jBLy-0008UF-00@the-village.bc.nu.suse.lists.linux.kernel> <9o6j9l$461$1@cesium.transmeta.com.suse.lists.linux.kernel> <oup4rq0bwww.fsf_-_@pigdrop.muc.suse.de> <jeelp4rbtf.fsf@sykes.suse.de> <20010918143827.A16003@gruyere.muc.suse.de> <nn3d59qzho.fsf@code.and.org> <jezo7gu78f.fsf@sykes.suse.de> <nnvgi4prod.fsf@code.and.org>
In-Reply-To: <nnvgi4prod.fsf@code.and.org> (James Antill's message of "27 Sep 2001 11:41:22 -0400")
James Antill <james@and.org> writes:
|> Andreas Schwab <schwab@suse.de> writes:
|>
|> > James Antill <james@and.org> writes:
|> >
|> > |> unlikely() also needs to be...
|> > |>
|> > |> #define unlikely(x) __builtin_expect(!(x), 1)
|> > |>
|> > |> ...or...
|> > |>
|> > |> #define unlikely(x) __builtin_expect(!!(x), 0)
|> >
|> > This is not needed, since only 0 is the likely value and !! does not
|> > change that.
|>
|> Yes it is, given the code...
|>
|> struct blah *ptr = NULL;
|>
|> if (unlikely(ptr))
|>
|> ...you'll get a warning from gcc because you are implicitly converting
|> from a pointer to a long.
You're right, seems like __builtin_expect is really only defined for pure
boolean values.
Andreas.
--
Andreas Schwab "And now for something
Andreas.Schwab@suse.de completely different."
SuSE Labs, SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
next prev parent reply other threads:[~2001-09-27 16:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20010918031813.57E1062ABC@oscar.casa.dyndns.org.suse.lists.linux.kernel>
[not found] ` <E15jBLy-0008UF-00@the-village.bc.nu.suse.lists.linux.kernel>
[not found] ` <9o6j9l$461$1@cesium.transmeta.com.suse.lists.linux.kernel>
2001-09-18 10:44 ` Andi Kleen
2001-09-18 11:13 ` Andreas Schwab
2001-09-18 12:38 ` Andi Kleen
2001-09-26 23:54 ` James Antill
2001-09-27 12:51 ` Andreas Schwab
2001-09-27 15:41 ` James Antill
2001-09-27 16:28 ` Andreas Schwab [this message]
2001-10-04 18:52 ` Richard Henderson
2001-10-08 6:17 ` James Antill
2001-09-18 20:11 ` Horst von Brand
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=jeofnwsinb.fsf@sykes.suse.de \
--to=schwab@suse.de \
--cc=ak@suse.de \
--cc=james@and.org \
--cc=linux-kernel@vger.kernel.org \
--subject='Re: Linux 2.4.10-pre11 -- __builtin_expect' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).