From: Avi Kivity <avi@redhat.com>
To: Jan Beulich <JBeulich@novell.com>
Cc: Ingo Molnar <mingo@elte.hu>,
a.p.zijlstra@chello.nl, tglx@linutronix.de,
torvalds@linux-foundation.org, mingo@redhat.com, npiggin@suse.de,
linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org,
hpa@zytor.com
Subject: Re: [tip:core/locking] locking, x86: Slightly shorten __ticket_spin_trylock()
Date: Wed, 02 Dec 2009 16:12:26 +0200 [thread overview]
Message-ID: <4B1675CA.1020504@redhat.com> (raw)
In-Reply-To: <4B168293020000780002308E@vpn.id2.novell.com>
On 12/02/2009 04:06 PM, Jan Beulich wrote:
>>>> Ingo Molnar<mingo@elte.hu> 02.12.09 14:29>>>
>>>>
>> at first quick sight, this bit looks odd:
>>
>> + union { int i; bool b; } new;
>>
>> + return new.b;
>>
>> shouldnt that be short based, to work correctly in the 0-255 CPUs case?
>>
> No, I can't see why. In both instances, we're using (and had been
> using previously, just with the added movzbl) the outcome of a
> setCC instruction, which produces valid bool (single byte) values.
> It is precisely that reason why I needed to introduce these unions,
> since the upper bytes of the register aren't valid (and shouldn't be
> looked at by the caller).
>
>
Wouldn't 'u8 ret', as an additional argument be sufficient? gcc still
ought to be able to use the same register for new and ret if we remove
the early clobber.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2009-12-02 14:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-27 15:09 [PATCH] x86: slightly shorten __ticket_spin_trylock() Jan Beulich
2009-12-02 10:45 ` [tip:core/locking] locking, x86: Slightly " tip-bot for Jan Beulich
2009-12-02 13:29 ` Ingo Molnar
2009-12-02 14:06 ` Jan Beulich
2009-12-02 14:12 ` Avi Kivity [this message]
2009-12-02 14:25 ` Jan Beulich
2009-12-02 14:36 ` Avi Kivity
2009-12-02 14:59 ` Jan Beulich
2009-12-02 14:21 ` Ingo Molnar
2009-12-02 14:57 ` Jan Beulich
2009-12-02 15:33 ` Linus Torvalds
2009-12-02 15:26 ` Linus Torvalds
2009-12-02 16:24 ` Jan Beulich
2009-12-02 16:56 ` Linus Torvalds
2009-12-02 17:05 ` Linus Torvalds
2009-12-02 17:23 ` H. Peter Anvin
2009-12-02 17:48 ` Linus Torvalds
2009-12-02 17:58 ` H. Peter Anvin
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=4B1675CA.1020504@redhat.com \
--to=avi@redhat.com \
--cc=JBeulich@novell.com \
--cc=a.p.zijlstra@chello.nl \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=npiggin@suse.de \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.