From: Ingo Molnar <mingo@elte.hu>
To: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Jason Baron <jbaron@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
Steven Rostedt <rostedt@goodmis.org>, Andi Kleen <ak@suse.de>,
linux-kernel@vger.kernel.org
Subject: Re: Immediate values
Date: Thu, 24 Sep 2009 21:16:42 +0200 [thread overview]
Message-ID: <20090924191642.GA19225@elte.hu> (raw)
In-Reply-To: <20090924141600.GA22007@Krystal>
* Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> wrote:
> * Jason Baron (jbaron@redhat.com) wrote:
> >
> > right we've proposed an alternative to the immediate values, which
> > I've been calling 'jump label', here:
> >
> > http://marc.info/?l=linux-kernel&m=125200966226921&w=2
> >
> > The basic idea is that gcc, 4.5 will have support for an 'asm goto'
> > construct which can refer to c code labels. Thus, we can replace a
> > nop in the code stream with a 'jmp' instruction to various branch
> > targets.
> >
> > In terms of a comparison between the two, IMO, I think that the
> > syntax for the immediate variables can be more readable, since it
> > just looks like a conditional expression.
> >
> > The immediate values do a 'mov', 'test' and then a jump, whereas
> > jump label can just do a jump. So in this respect, I believe jump
> > label can be more optimal. Additinally, if we want to mark sections
> > 'cold' so they don't impact the istruction cache, the jump label
> > already has the labels for doing so. Obviously, a performance
> > comparison would be interesting as well.
>
> For branches, I'm convinced that a "static jump" approach will beat
> immediate values anytime, because you save the BPB hit completely.
>
> However, there are other use-cases involving a variable read, and in
> that case immediate values are useful. Andi has been bugging me for a
> while to re-post this patchset, I'm pretty sure he has precise ideas
> about how he would like to use it.
It depends on how significant that usecase is.
Tracepoints used to be the biggest use-case for immediate values, and
without that the thing becomes rather complex to maintain, for probably
very little benefit.
Ingo
next prev parent reply other threads:[~2009-09-24 19:17 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-24 12:31 Immediate values Mathieu Desnoyers
2009-09-24 12:34 ` Ingo Molnar
2009-09-24 14:02 ` Jason Baron
2009-09-24 14:10 ` H. Peter Anvin
2009-09-24 14:16 ` Mathieu Desnoyers
2009-09-24 19:16 ` Ingo Molnar [this message]
2009-09-24 19:34 ` Ingo Molnar
2009-09-25 6:51 ` Arjan van de Ven
2009-09-25 7:35 ` Mathieu Desnoyers
2009-09-25 8:25 ` Arjan van de Ven
2009-09-25 10:02 ` Alan Cox
2009-09-25 10:14 ` Arjan van de Ven
2009-09-25 16:19 ` H. Peter Anvin
2009-09-25 16:45 ` Arjan van de Ven
2009-09-25 17:05 ` H. Peter Anvin
2009-09-25 10:18 ` Richard J Moore
2009-09-25 11:12 ` Masami Hiramatsu
2009-09-24 14:16 ` H. Peter Anvin
2009-09-24 15:39 ` Jason Baron
2009-09-24 16:52 ` 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=20090924191642.GA19225@elte.hu \
--to=mingo@elte.hu \
--cc=ak@suse.de \
--cc=hpa@zytor.com \
--cc=jbaron@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@polymtl.ca \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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