This isn’t completely true. Even a basic instruction like ADD has multiple versions once decoded depending on the memory used. For example, if the memory being operated on is in RAM, then the ADD needs to be decoded to include a fetch operand before it can be used.
Comment on Intel CPU Temperature Monitoring Driver For Linux Now Unmaintained After Layoffs
Mihies@programming.dev 1 day agoFrom what I remember one of problems with CISC is that it has variable length instructions and these are harder to predict since you have to analyze all instructions up to the current one wheres for RISC you exactly know where is each instruction in memory/cache.
Eknz@lemmy.eknz.org 1 day ago
Mihies@programming.dev 1 day ago
Yes, but RISC knows the exact position of that instruction in cache and how many instructions fit the instructions cache or pipeline. Like you said, it doesn’t help with data cache.
Eknz@lemmy.eknz.org 1 day ago
Are you sure there’s a significant difference in machine code between RISC and CISC after instructions are decoded?
The assembly in RISC is just an abstraction of the machine code, as it also is in CISC. If the underlying CPU has the same capabilities then it doesn’t really matter what the assembly looks like?
Of course, the underlying CPUs aren’t the same and that’s the real point of differentiation.
Mihies@programming.dev 1 day ago
The_Decryptor@aussie.zone 1 day ago
RISC systems also have variable length instructions, they’re just a bit stricter with the implementation that alleviates a lot of the issues (ARM instructions are always either 16-bits or 32-bits, while RISC-V is always a multiple of 16-bits and self-describing, similar to UTF-8)
Mihies@programming.dev 1 day ago
I was thinking about Apple’s M CPUs that have fixed length and they benefit out of it. It was explained on Anandtech years ago, here is a brief paragraph on the topic. Sadly Anandtech article(s) isn’t available anymore.
The_Decryptor@aussie.zone 22 hours ago
Ahh, yep it turns out ARM actually removed Thumb support with their 64-bit transition, so their instruction length is fixed now, and Thumb never made it into the M* SoCs.