From: Brian Gerst <bgerst@didntduck.org>
To: Jamie Lokier <lk@tantalophile.demon.co.uk>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
Jean-Marc Saffroy <saffroy@ri.silicomp.fr>,
linux-kernel@vger.kernel.org, linux-smp@vger.kernel.org
Subject: Re: [Q] Implementation of spin_lock on i386: why "rep;nop" ?
Date: Wed, 19 Sep 2001 00:06:26 -0400 [thread overview]
Message-ID: <3BA819C2.35829D39@didntduck.org> (raw)
In-Reply-To: <Pine.LNX.4.31.0109171725140.26090-100000@sisley.ri.silicomp.fr> <E15j2BM-0007WU-00@the-village.bc.nu> <20010919044203.A20143@kushida.degree2.com>
Jamie Lokier wrote:
>
> Alan Cox wrote:
> > > The "rep;nop" line looks dubious, since the IA-32 programmer's manual from
> > > Intel (year 2001) mentions that the behaviour of REP is undefined when it
> > > is not used with string opcodes. BTW, according to the same manual, REP is
> > > supposed to modify ecx, but it looks like is is not the case here... which
> > > is fortunate, since ecx is never saved. :-)
> >
> > rep nop is a pentium IV operation. Its retroactively after testing defined
> > to be portable and ok.
>
> Are we sure that the value of ECX doesn't matter on a 386? Or does it
> count down doing nops ECX times on a 386?
Older processors ignore the rep prefix when used with non-string
opcodes. %ecx should not be affected.
--
Brian Gerst
prev parent reply other threads:[~2001-09-19 4:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-17 16:16 [Q] Implementation of spin_lock on i386: why "rep;nop" ? Jean-Marc Saffroy
2001-09-17 16:22 ` Dave Jones
2001-09-17 17:19 ` Jean-Marc Saffroy
2001-09-17 16:42 ` Richard B. Johnson
2001-09-17 17:06 ` Jonathan Lundell
2001-09-17 17:27 ` Alan Cox
2001-09-17 19:47 ` H. Peter Anvin
2001-09-19 3:42 ` Jamie Lokier
2001-09-19 4:06 ` Brian Gerst [this message]
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=3BA819C2.35829D39@didntduck.org \
--to=bgerst@didntduck.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-smp@vger.kernel.org \
--cc=lk@tantalophile.demon.co.uk \
--cc=saffroy@ri.silicomp.fr \
/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).