Article View: comp.arch
Article #94Re: Performance of xchg reg,reg
From: Lawrence D’Oliveiro
Date: Wed, 14 Oct 2026 00:23
Date: Wed, 14 Oct 2026 00:23
15 lines
1893 bytes
1893 bytes
On Tue, 13 Oct 2026 08:43:47 GMT, Anton Ertl wrote: > On Zen5, even a 5-register cycle can be profitably implemented with > xchg when you have no spare register, a 4-register cycle even when > you have a spare register. For Zen4 and Zen3 cyc4 (for mem) and cyc3 > (for reg) are borderline cases, and for shorter cycles xchg is > better. > > On Intel processors, xchg is so slow that it never is profitable to > use it. The slowness takes on extreme values in the E-cores, with > slowdowns by a factor >10 for cyc4 and cyc5. You’d think both companies would be running similar kinds of instruction workloads to find the things worth optimizing in their CPU architectures. But perhaps not ...
Technical Details
Message-ID:
<11ami2v$11dqu$3@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-mailReferences:
<2026Oct13.104347@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: Lawrence D’Oliveiro <ldo@nz.invalid> Newsgroups: comp.arch Subject: Re: Performance of xchg reg,reg Date: Wed, 14 Oct 2026 00:23:59 -0000 (UTC) Organization: A noiseless patient Spider Lines: 15 Message-ID: <11ami2v$11dqu$3@dont-email.me> References: <2026Oct13.104347@mips.complang.tuwien.ac.at> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 14 Oct 2026 00:24:00 +0000 (UTC) Injection-Info: dont-email.me; logging-data="1095518"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19+IFSJ5U/fv6CvGizd4qGH"; posting-host="ef67f4a7283e1d49e952a1a689508a25" User-Agent: Pan/0.165 (Kostiantynivka) Cancel-Lock: sha1:MAtlGVrndjbpiGJG2xgy0T3G/7s= sha256:hOVTN0fGyDegnwt0wPxhOjnv5gcYb3cdWWF2XwZB6zY= sha1:SrqXHKssOCpUxqQMkUDUoSiMF1U= sha256:c0QmfgvF7iq8RY0N8uvwObRaw44hPjycJg/fXSguDOw=