🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #190

Re: Performance of xchg reg,reg

#190
From: Michael S
Date: Sun, 18 Oct 2026 17:47
54 lines
4010 bytes
On Sun, 18 Oct 2026 16:57:26 GMT
anton@mips.complang.tuwien.ac.at (Anton Ertl) wrote:

> Michael S <already5chosen@yahoo.com> writes:
> >On Sun, 18 Oct 2026 15:08:23 GMT
> >anton@mips.complang.tuwien.ac.at (Anton Ertl) wrote:  
> >> I don't think that's the issue here.  They just did not limit the
> >> sentence "The XCHG instruction always asserts the LOCK# signal
> >> regardless of the presence or absence of the LOCK prefix."  to XCHG
> >> instructions with memory operands.  That would be easy to fix, but
> >> they did not.  And Chris M. Thomasson understood it as including
> >> XCHG reg, reg.  
> ...
> >Frankly, I don't understand what both you and Dan Cross are talking
> >about.
> >I don't see how sentence from Intel's manual ("If a memory operand is
> >referenced, the processor=E2=80=99s locking protocol is automatically
> >implemented for the duration of the exchange operation, regardless of
> >the presence or absence of the LOCK prefix or of the value of the
> >IOPL") or sentence from AMD's manual ("If either operand references
> >memory, the processor locks automatically, whether or not the LOCK
> >prefix is used and independently of the value of IOPL.") can be
> >pssibly misunderstood.  
> 
> Chris M. Thomasson wrote in <11arg45$2p70p$1@dont-email.me>:
> |Well, for some reason the LOCK prefix is implied for XCHG.
> 
> Given that the thread up to that point was aboyt XCHG reg, reg (and
> according to the subject it still is), he seems to be an example that
> what Intel wrote about XCHG and LOCK can be misunderstood.  I looked
> at the documentation and cited the relevant sentences in
> <2026Oct16.075055@mips.complang.tuwien.ac.at>; most occurences clearly
> refer only to XCHG where one operand is in memory.  The exception is:
> 
> |The XCHG instruction always asserts the LOCK# signal regardless of
> the |presence or absence of the LOCK prefix.
> 

What is a source of this? Intel, AMD or somebody else?

> And actually all the stuff about XCHG with memory operands does not
> contradict this sentence.  It could be understood as meaning that
> while all the other aspects of locking don't apply to "XCHG reg, reg",
> the assertion of the LOCK# signal still has to occur, and that's why
> Intel processors implement a slow XCHG reg, reg.  I don't think that's
> what Intel intends and implements, but that's what a reading of their
> manual implies.
> 
> - anton

Somehow, it does not imply it to me.


Technical Details
Message-ID: <20261018204738.00006b41@yahoo.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <2026Oct13.104347@mips.complang.tuwien.ac.at> <11au1vu$3ks5m$2@dont-email.me> <11aunpn$8c6$1@reader2.panix.com> <1792257076-5857@newsgrouper.org> <11b0bd3$b5b$1@reader2.panix.com> <1792265982-5857@newsgrouper.org> <2026Oct18.170823@mips.complang.tuwien.ac.at> <20261018184318.00000bee@yahoo.com> <2026Oct18.185726@mips.complang.tuwien.ac.at>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Michael S <already5chosen@yahoo.com>
Newsgroups: comp.arch
Subject: Re: Performance of xchg reg,reg
Date: Sun, 18 Oct 2026 20:47:38 +0300
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <20261018204738.00006b41@yahoo.com>
References: <2026Oct13.104347@mips.complang.tuwien.ac.at>
	<11au1vu$3ks5m$2@dont-email.me>
	<11aunpn$8c6$1@reader2.panix.com>
	<1792257076-5857@newsgrouper.org>
	<11b0bd3$b5b$1@reader2.panix.com>
	<1792265982-5857@newsgrouper.org>
	<2026Oct18.170823@mips.complang.tuwien.ac.at>
	<20261018184318.00000bee@yahoo.com>
	<2026Oct18.185726@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 18 Oct 2026 17:47:47 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1262206"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18dWywvLuMVvjf2TNkbqCivWEqgkxDHw94="; posting-host="f3ba9e4a06adc8c40e079351cfd7a0db"
Cancel-Lock: sha1:/ZjWCPs1imu21EniQl4rizlN1lI= sha256:LBgsnvWHg1+TYzLXJ7Anqt2y2gq7RejfwnX1nrwAVJw=
	sha1:f95xGoNswXDPcKBMcQ4gQK2rdOI= sha256:qbMraiCBngWkXwY76l1L1+bnc4m4qs/4UrFsoKWH1/A=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)