Article View: comp.arch
Article #787Architectural influence on performance (was: Large constants in RISC)
From: Anton Ertl
Date: Tue, 17 Nov 2026 06:35
Date: Tue, 17 Nov 2026 06:35
322 lines
17213 bytes
17213 bytes
antispam@fricas.org (Waldek Hebisch) writes: >Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote: >> In the late 1990s, AMD was a much smaller company than Intel, and also >> smaller than the larger members of the AIM (Apple, IBM, Motorola) >> consortium, and the "baroqueness" of IA-32 played a bigger role in the >> CPUs of the day, yet AMD managed to beat Intel in the GHz race and was >> very competetive in the following years, while the offerings of the >> AIM consortium were slow and only kept afloat by the faith in the >> church of Apple. And eventually Apple switched to Intel. >> >> It's not clear why the ARM A64 microarchtitects manage to outcompete >> AMD64 these days, while the AIM microarchitects could not do that in >> the early 2000s. Maybe there is something in the instruction sets >> that plays a role when you do 10-wide microarchitecture that was not >> an issue for 3-wide microarchitectures in the early 2000s. > >I think that economic factors worked differently than you suggest. >AMD and Intel were hardware companies serving large software >market Power/PPC software market was much smaller and fragmented. >Given size of PPC software market really large investments in >hardware were hard to justify. You may be right. Apple went through hard times in the late 1990s, shut down the clone market, and probably asked Motorola for even lower prices than usual, and actually Motorola was expelled from the AIM alliance, and according to Wikipedia forced to stop making PowerPC chips for a while in 1998-1999, which probably reduced Motorola's investment to 0, and one can imagine the kind of long-term effects this has had from dissolution of the development teams. In any case, Motorola apparently focused on making PowerPCs for the embedded market, rather than trying to compete with AMD and Intel. Also, the ideas that PowerPC-based machines would take over from IA-32-based machines (PReP, CHRP) did not work out as intended, reducing IBM's interest in AIM. But IBM still went for high-performance CPUs for their AS/400 and RS/6000 families, in particular Power4. Bot IIRC Power4 was better then Intel and AMD chips in SPECfp (possibly due to a more expensive memory subsystem), but worse in SPECint. IBM also succeeded at getting Power(PC) into the PlayStation 3 and other systems with the Cell chip, and into the Xbox 360, both markets where high performance counts. So between these markets, there was quite a bit of money in the Power(PC) architecture. The PC market may have been bigger, but AMD's share was probably smaller, and yet they managed to achieve competetive performance, while IBM could not followup in the next generation of game consoles (but still sells Power Systems for IBM i (the AS/400 OS), AIX, and Linux), and the next two game console generations went to AMD, despite their weakness in the heavy machinery times (2011-2017). >I compared performance of several low-end PC class processors >and I see wild variation of performance, which suggest that >now there are several microarchitecures. It is well-known that Intel has two families of microarchitectures, which turned into the P-cores and E-Cores of Alder Lake (e.g., Core i7-12700), and AMD now has one family (Zen..Zen6), with some variations in maximum clock rate since Zen4 and variations in configuration since Zen5. Also there are different cache configurations for the same microarchitecture. Depending on what you measure on what machines, you may be seeing cache effects, clock rate effects, differences between successive members of the same family, differences between configurations, or differences between microarchitectures. Apple has P-cores and E-cores, which may be different microarchitecture families, or different configurations of the same basic microarchitecture family. Qualcomm has just the Oryon family for now. ARM now sells 4 kinds of cores (Nano, Pro, Premium, Ultra), where the Nano is an in-order microarchitecture, and the others are OoO. The OoO ones may be configurations of the same basic microarchitecture for different area and power budgets, or maybe they split their OoO architecture into different families at one point. Only the Apple microarchitectures and Qualcomm are in the laptop market; Nvidia is entering it with ARM-based microarchitectures in the RTX Spark CPU (9-10 X925 + 9-10 X725, predecessors of the C1 and C2 line), which is slightly slower in single-core performance than the fastest AMD CPU and slightly faster than the fastest Intel CPU in the review <https://www.computerbase.de/artikel/notebooks/nvidia-rtx-spark-n1x-test.99679/seite-3>. >Still, it is likely >that there is very small number of microarchitecures for top >performing models. Possibly 1 microarchitecure in normal >time and 2 when there is transition between microarchitecures. >If that is true one can expect essentially random fluctuations >of comparative performance, depending on which team gets more >aspects right. According to <https://www.computerbase.de/artikel/notebooks/nvidia-rtx-spark-n1x-test.99679/seite-3>, we see the following single-core (actually single-threaded) ratings (larger is better): 844 M6 (Apple 2026) 763 M5 (Apple 2025) 663 X2E-84-100 (Qualcomm 2026) 583 Ryzen AI 9 HX 370 (AMD 2024) 576 RTX Spark (ARM 2024) 565 Core Ultra X7 358H (Intel 2026) The fact that two ARM A64 microarchitectures beat all of the AMD64 microarchitectures, and in case of Apple by a wide margin, and a third ARM A64 microarchitecture is head-to-head with the best Intel and AMD microarchtiectures looks to be more than a random fluctuation to me. AFAICT, AMD has not dropped the ball, and neither has Intel (Intel has manufacturing problems, but works around that by manufacturing at TSMC). Given that, there may be some systematic thing at work here that makes it harder to speed up Intel and AMD microarchitectures than ARM A64 microarchitectures. >So beside underlying architecture there are two factors that >can explain good performance of ARM64: one in large influx of >money, the other is luck. There is still enough money in the AMD64 laptop, desktop and server markets for AMD and Intel to fund microarchitectural developments, even two teams in the case of Intel. >> Maybe Intel's APX (32 GPRs, 3-address encoding) is a reaction to Apple >> M1 having better IPC, and maybe we will see better IPC on Intel >> machines with APX. I would not bet on it, though. > >When looking at technical factors I think that one aspect is >how much work is done by a single microinstruction. The other >is how much resources go into single microinstruction. That >is microinstruction which reads many registers and writes >many registers may do a lot of work, but needs more execution >resources. So, determining right complexity of >microinstructions needs tricky compromise. This compromise >is affected by architecture. For example, decoders may >fuse load and index increment into autoindexing, but in >case of architectural preincrement exception is just at >start of the instruction, while in fused case exception in >in the middle of synthetised instruction. I am not sure >how much this specific case matters, but it illustrates >that even with fusion and splitting architectural instruction >set forces differences at microarchitectural level. This particular case is probably not relevant, because I have not read about Intel or AMD doing such fusion even for the post-increment case. What Intel has done, however, is to perform small (up to 11 bits of range, with a total sum of 13 bits) constant adds in the renamer with a perceived latency of 0. >ARM64 >is relatively new instruction set, so ARM should have >looked at interactions between architecture and >microarchitecture and optimize them. They certainly designed it for using a single instruction width (32 bits), and putting as much functionality in these 32 bits as can be efficiently implemented. The fact that some of their instructions read and/or write a significant number of registers looks like a possible problem, but obviously the microarchitects have overcome that. >I have impression that ARM64 code is bigger, so probably >also needs more instructions. Text size numbers from <2025Jun17.161742@mips.complang.tuwien.ac.at>: |Debian numbers from <2024Jan4.101941@mips.complang.tuwien.ac.at>: | | bash grep gzip | 595204 107636 46744 armhf | 599832 101102 46898 riscv64 | 796501 144926 57729 amd64 <--- | 829776 134784 56868 arm64 <--- | 853892 152068 61124 i386 | 891128 158544 68500 armel | 892688 168816 64664 s390x | 1020720 170736 71088 mips64el | 1168104 194900 83332 ppc64el | | |NetBSD numbers from <2025Mar4.093916@mips.complang.tuwien.ac.at>: | | libc ksh pax ed | 1102054 124726 66218 26226 riscv-riscv32 | 1077192 127050 62748 26550 riscv-riscv64 | 1030288 150686 79852 31492 mvme68k | 779393 155764 75795 31813 vax | 1302254 171505 83249 35085 amd64 <--- | 1229032 178332 89180 36876 evbarm-aarch64 <--- | 1539052 179055 82280 34717 amd64-daily <--- | 1374961 184458 96971 37218 i386 | 1247476 185792 96728 42028 evbarm-earmv7hf | 1333952 187452 96328 39472 sparc | 1586608 204032 106896 45408 evbppc | 1536144 204320 106768 43232 hppa | 1397024 216832 109792 48512 sparc64 | 1538536 222336 107776 44912 evbmips-mips64eb | 1623952 243008 122096 50640 evbmips-mipseb | 1689920 251376 120672 51168 alpha | 2324752 2259984 1378000 ia64 So the text sizes seem to be pretty similar between ARM A64 and AMD64. One would have to compare the number of executed instructions for the same task to get a better idea about the effectiveness per instruction. >But I would expect more >possibilites for fusing and since instructions have fixed >length and more regular encoding fusing should be easier >to implement than for AMD64. So number of microinstructions >to execute may be smaller. IIUC AMD64 for fast decoding >depends on predecode bits in cache. Assuming single >predecode bit per byte, AMD64 probably needs more cache >bits than ARM64. In K7 (1999) and its offspring, AMD stored predecode bits in the caches, reusing ECC bits for parity and predecoding. But AFAIK that has not been done by anyone for a while. AMD Zen...Zen6 cores and Intel P cores since Sandy bridge (2011) use a microop cache (and already the Pentium 4 family did that), but the Intel E-Cores do not use that, but instead decode instructions with three 3-wide decoders at the same time. AMD has introduced 2 4-wide decoders and managed to get them to work on the same thread with Zen6, but that's only needed on a microop cache miss. High-end ARM cores used to have microop caches, but are abandoning them in recent years, probably because they no longer decode ARM A32, ARM T32 (variable-length) and ARM A64, but just ARM A64. Decoding a variable-length instruction set with many instruction lengths certainly costs, but Intel and AMD seem to know how to deal with it, so it's probably not what holds back the performance. >Concerning specific features, ARM64 sets flags only on >demand, which reduces dependencies between instructions. The fact that more instructions write registers in AMD64 mainly means that more rename resources have to be spent on flags on AMD64 than on ARM A64. Another disadvantage of AMD64 in this area is that it has instructions which do not set C, O, or both, meaning that C, O and NZP all have to be renamed separately. I have read that Intel's E-Cores only have one set of rename registers for flags. I wonder how that works; dependence chains between partial-update instructions until finally a full-update instruction comes along that breaks the chain? Anyway, they seem to have some working ideas here, because Skymont has a good IPC (I have measured a better IPC than Lion Cove (the P-core of the same generation) once. Intel and AMD also know how to deal with flags, but it may indeed be the case that the combined load of having to implement variable-length instructions and AMD64 flag semantics means that they cannot advance as easily as the ARM A64 microarchitects. Now if ARM A64 had not designed the flags into their architecture, but put them into the GPRs <https://www.complang.tuwien.ac.at/anton/tmp/carry.pdf>, they would not have to do rename resources for the flags at all, which might have helped them getting an even greater lead. >Autoincrement/autodecrement allow doing more work in >single instruction than AMD64. It appears that the renamer is the bottleneck (that's certainly the idea behind microarchitectural top-down analysis), and that the number of written registers is what costs in the renamer (branches are free, and xchg reg, reg has half throughput even when the renamer handles it, and on Zen3-5). In such a scenario auto-increment/decrement don't help, and if these addressing modes seduce programmers or compiler to uses more auto-increment rather than fewer larger increments (e.g., when pushing a series of items on a stack), that could be a disadvantage. I have not measured the performance of auto-increment addressing on ARM A64 implementations, though. >Concerning constants, by using ADRP in many cases it is >possible to get effect of 32-bit PC-relative address using >2 instructions. ARM64 can load 32 bit constant into >register using 2 instructions and can load 64 bit constant >into register using 4 intruction sequence. 2 instructions >are easily fusable, fusing 4 intructions needs more effort >but it is not clear if it is harder than decoding AMD64 >instructions. So from my point of view main drawback >is need to use extra register, but since ARM64 has >significantly more registers this can not tip the balace >in favour of AMD64. The large constants also mean that the micorops become wider (or the microarchitecture breaks them into pieces again). PC-relative addresses mean that 64-bit addresses have to be embedded into the microops. Or alternatively, one needs to represent the PC in the rename register file, or have a data path from wherever the PC resides in the ROB (for mispreduction and exception handling) to the functional units. Concerning your idea, it seems to me that it is better to use a fixed, but otherwise regular register than a new register. That avoids the need to save the new register across exceptions and interrupts. And it is better to make the clearing explicit rather than implicit (e.g., have an instruction that sets the middle bits and sets all the other bits to zero, and an instruction that ors the immediate operand with the high bits of the fixed register). This costs encoding space, but the register can be used for other things when it is not used for a large constant. Alternatively, if you are really tight on encoding space, use just one opcode, make every instruction that reads from the constant register implicitly clear the register (I assume that one can do that in the renamer without requiring the resources of writing to a register), and have one instruction that shifts the register left by 26 bits and inserts the immediate bits of the instruction into bit 12-37. - anton -- 'Anyone trying for "industrial quality" ISA should avoid undefined behavior.' Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>
Technical Details
Message-ID:
<2026Nov17.073543@mips.complang.tuwien.ac.at>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11d76uq$11cdc$1@paganini.bofh.team> <11d7ct8$17akn$1@dont-email.me> <11d7ih2$11orr$1@paganini.bofh.team> <11d9d0d$1rsce$1@dont-email.me> <11d9tq8$1b9c1$2@paganini.bofh.team> <2026Nov14.201017@mips.complang.tuwien.ac.at> <6af911ea.18530156@news.eternal-september.org> <2026Nov15.173606@mips.complang.tuwien.ac.at> <11dgnf5$26qqi$1@paganini.bofh.team>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: anton@mips.complang.tuwien.ac.at (Anton Ertl) Newsgroups: comp.arch Subject: Architectural influence on performance (was: Large constants in RISC) Date: Tue, 17 Nov 2026 06:35:43 GMT Organization: Institut fuer Computersprachen, Technische Universitaet Wien Lines: 322 Message-ID: <2026Nov17.073543@mips.complang.tuwien.ac.at> References: <11d76uq$11cdc$1@paganini.bofh.team> <11d7ct8$17akn$1@dont-email.me> <11d7ih2$11orr$1@paganini.bofh.team> <11d9d0d$1rsce$1@dont-email.me> <11d9tq8$1b9c1$2@paganini.bofh.team> <2026Nov14.201017@mips.complang.tuwien.ac.at> <6af911ea.18530156@news.eternal-september.org> <2026Nov15.173606@mips.complang.tuwien.ac.at> <11dgnf5$26qqi$1@paganini.bofh.team> Injection-Date: Tue, 17 Nov 2026 09:58:07 +0000 (UTC) Injection-Info: dont-email.me; logging-data="333841"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+yQJ5vnTUppKzZxdcBndr/"; posting-host="816031ead108429935bc5aa587fc45a9" Cancel-Lock: sha1:qChL3u6wLYMfBsObPmOhr7djlPg= sha256:76YBRooKxp5urAV554R2AkQ1RC6rM2rWT8+GY2Z/DMs= sha1:j/tf+hxLggUwLD9UGaT7qKjZ2uA= sha256:YZT+fAsjpsG8fYpVF0AYz6rin4cFR55zen74bZnP7FM= X-newsreader: xrn 10.11