🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #223

Re: Performance of xchg reg,reg

#223
From: Stephen Fuld
Date: Mon, 19 Oct 2026 13:57
30 lines
2859 bytes
On 10/18/2026 8:43 PM, Stefan Monnier wrote:
> Anton Ertl [2026-10-18 16:57:26] wrote:
>> 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.
> 
> How could code witness the difference?
> 
> I believe AMD can claim that its behavior is consistent with the
> behavior you'd get when asserting the LOCK# signal.
> 
> 
> === Stefan

I believe this all started with empirical data from Anton showing 
different performance between Intel and AMD processors for XCHG 
reg,reg.  There was some speculation that Intel asserted the lock 
protocol and that was the cause.  The discussion then moved to at best 
confusing, and perhaps contradictory documentation.  But has anyone 
addressed the original question?

Specifically, do Intel processors actually do the lock stuff when it 
isn't necessary?  If so, is the cause of the difference?  If not, what 
is the cause?

-- 
  - Stephen Fuld
(e-mail address disguised to prevent spam)
Technical Details
Message-ID: <11b57kt$244nj$1@dont-email.me>
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> <jwv8q3uqrxf.fsf-monnier+comp.arch@gnu.org>

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: Stephen Fuld <sfuld@alumni.cmu.edu.invalid>
Newsgroups: comp.arch
Subject: Re: Performance of xchg reg,reg
Date: Mon, 19 Oct 2026 06:57:48 -0700
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <11b57kt$244nj$1@dont-email.me>
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>
 <jwv8q3uqrxf.fsf-monnier+comp.arch@gnu.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 19 Oct 2026 13:57:50 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="2233075"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18pMNqMNIl9W/RlvP+bUcCOILbpR+JmsGc="; posting-host="bf662dd30c7bdd6ad6fe0b12fe910baf"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:mxuXExFwigxgmDny5+xJD5+KaGo= sha256:aKEbjKEqqQsEfcyjsDlZ8EVF1STX7HTChM5d1XnOkeU=
	sha1:MhUSViM+X6ahgqMEi8ioYbEibOk= sha256:0qlUybA2LpTSvpl3zrPG3KsFircQlKOA3FD0CVdRToU=
In-Reply-To: <jwv8q3uqrxf.fsf-monnier+comp.arch@gnu.org>
Content-Language: en-US