linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Prarit Bhargava <prarit@redhat.com>
To: "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	x86@kernel.org, Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH] x86, bitops, variable_test_bit should return 1 not -1 on a match
Date: Thu, 08 Oct 2015 07:48:34 -0400	[thread overview]
Message-ID: <56165812.6070101@redhat.com> (raw)
In-Reply-To: <E661604A-0C9E-4C4F-84C3-BDEAEE2E18F3@zytor.com>



On 08/21/2015 04:08 AM, H. Peter Anvin wrote:
> Wrong fix, though.  Instead we should change it to use the set instruction, which would also make it easier to use the CC_SET/CC_OUT proposed macros to use assembly out in the future.
> 
> The downside with set is that it only sets a single byte, the upside is that it always outputs 0 or 1, and apparently if the output variable is your bool gcc can use that for optimization.
> 

hpa, I didn't realize your comment was suggesting a change.  I've done a google
search on "gcc bool optimization" (and various incantations of that) and didn't
find anything that lead me in the direction of making a change.  Could you
elaborate on what the issue is?

Thanks,

P.

  parent reply	other threads:[~2015-10-08 11:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-19 17:18 [PATCH] x86, bitops, variable_test_bit should return 1 not -1 on a match Prarit Bhargava
2015-08-21  6:51 ` Ingo Molnar
2015-08-21  8:08   ` H. Peter Anvin
2015-08-21 11:53     ` Prarit Bhargava
2015-08-24 18:22     ` [PATCH v2] " Prarit Bhargava
2015-10-07 23:27       ` Prarit Bhargava
2015-10-08  8:51         ` Ingo Molnar
2015-10-08 11:48     ` Prarit Bhargava [this message]
2015-08-21 11:50   ` [PATCH] " Prarit Bhargava
2015-08-22  9:14     ` Ingo Molnar

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=56165812.6070101@redhat.com \
    --to=prarit@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).