From: Richard Henderson <rth@twiddle.net>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Jan Hubicka <jh@suse.cz>, linux-kernel@vger.kernel.org
Subject: Re: i386 flags register clober in inline assembly
Date: Tue, 20 Nov 2001 00:33:38 -0800 [thread overview]
Message-ID: <20011120003338.A24717@twiddle.net> (raw)
In-Reply-To: <20011118020957.A10674@atrey.karlin.mff.cuni.cz> <Pine.LNX.4.33.0111171844001.899-100000@penguin.transmeta.com>
In-Reply-To: <Pine.LNX.4.33.0111171844001.899-100000@penguin.transmeta.com>; from torvalds@transmeta.com on Sat, Nov 17, 2001 at 06:48:22PM -0800
On Sat, Nov 17, 2001 at 06:48:22PM -0800, Linus Torvalds wrote:
> That sounds pretty ideal - have some way of telling gcc to add a "seta
> %reg", while at the same time telling gcc that if it can elide the "seta"
> and use a direct jump instead, do so..
Hmm. It appears to be easy to do with machine-dependent builtins. E.g.
int x;
__asm__ __volatile__(LOCK "subl %1,%0"
: "=m"(v->counter) : "ir"(i) : "memory");
x = __builtin_ia32_sete();
if (x) {
...
}
Now, you'd have to be careful in where that __builtin_ia32_sete
gets placed, but I'd guess that immediately after an asm would
be relatively safe. No 100% guarantees on that, unfortunately.
And the sete _ought_ to get merged with the if test by combine
or cse with no extra code.
It wouldn't take too much effort to try this out either...
r~
next prev parent reply other threads:[~2001-11-20 8:34 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-17 14:06 i386 flags register clober in inline assembly Momchil Velikov
2001-11-17 15:14 ` Jan Hubicka
2001-11-17 19:20 ` Linus Torvalds
2001-11-17 19:58 ` H. Peter Anvin
2001-11-17 20:24 ` Momchil Velikov
2001-11-17 20:30 ` Linus Torvalds
2001-11-17 20:40 ` Jan Hubicka
2001-11-17 20:42 ` Linus Torvalds
2001-11-18 1:09 ` Jan Hubicka
2001-11-18 2:48 ` Linus Torvalds
2001-11-20 8:33 ` Richard Henderson [this message]
2001-11-20 13:00 ` Jan Hubicka
2001-11-20 23:14 ` Richard Henderson
2001-11-20 17:12 ` Linus Torvalds
2001-11-17 21:00 ` H. Peter Anvin
2001-11-20 14:39 ` PATCH 2.4.15-pre6 idt compilation and proc_misc cleanup Martin Dalecki
2001-11-23 22:24 ` Roman Zippel
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=20011120003338.A24717@twiddle.net \
--to=rth@twiddle.net \
--cc=jh@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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