News for hackers. Stuff that matters.
Re:What do RISC and CISC mean in 2020? by dragontamer on Friday November 20, 2020 @04:24PM (#25165167)
The main issue with linking a discussion from 25 years ago, is that the discussion from is almost irrelevant in today's environment.

The Apple M1 has over 600 reorder buffer registers (while Skylake and Zen are around 200ish). The 16 or 32 architectural registers of the ISA are pretty much irrelevant compared to the capabilities of the out-of-order engine on modern chips.

A 200, 300, or 600+ register ISA is unfathomable to those from 1995. Not only that, but the way we got our software to scale to such "shadow register" sets is due to an improvement in compiler technology over the last 20 years.

Modern compilers write code differently (aka: "dependency cutting"). Modern chips take advantage of those dependency cuts, and use them to "malloc" those reorder buffer registers, and as a basis for out-of-order execution.

While the tech existed back in the 90s for this... it wasn't widespread yet. Even the best posts from back then would be unable to predict what technologies came out 25 years into the future.

Re:What do RISC and CISC mean in 2020? by temac on Friday November 20, 2020 @04:55PM (#25165526)
If I remember correctly the M1 has around 600 reorder buffer entries, and I just checked and Anantech estimate the int register file at around 354 entries. That's still big, but not 600.
Re:What do RISC and CISC mean in 2020? by dragontamer on Friday November 20, 2020 @05:09PM (#25165666)
Ah hah, but there's also 300 FP registers!!

Okay, you got me. I somehow confused the register file with the reorder buffer in the above post. But I think I may still manage to be "technically correct" thanks to the FP register file (even though its not really fair to count those).

Re:What do RISC and CISC mean in 2020? by _chris_ on Friday November 20, 2020 @06:12PM (#25166261)
>The 16 or 32 architectural registers of the ISA are pretty much irrelevant compared to the capabilities of the out-of-order engine on modern chips.

This can have a big effect on memory traffic due to unnecessary moves and stack pops/pushes.

Re:What do RISC and CISC mean in 2020? by dragontamer on Friday November 20, 2020 @06:15PM (#25166288)
All register moves are just renames.

On x86 systems like Skylake or Zen3, it doesn't even use an execution pipeline. Literally zero resources used, aside from the decoder.

Heck, you can perform "xor rax, rax" as much as you'd like, because that's also a rename. It doesn't use any pipeline at all either.

Register renaming (aka: "malloc" a register) is the fastest operation on modern CPUs. That's xor blah,blah, or mov foo, bar, etc. etc.

----------

Its only really an issue if you somehow need more width ("Instruction-level parallelism") than what the architectural registers provide.

And even then... I'm not sure if it matters. There's store-to-load forwarding. So any register you write to L1 cache (that is read back in later on) will be store-to-load forwarded, and the whole memory read will be bypassed anyway.

And even then, L1 cache is 4-clock ticks latency, and issued at the full speed of the chip's load/store units. Even if store-to-load forwarding failed for some reason, L1 cache is damn near the speed of a register.

Re:What do RISC and CISC mean in 2020? by _chris_ on Friday November 20, 2020 @07:15PM (#25166722)
Register moves aren't free, even if you do renaming tricks. They take up fetch bytes, they take up decode slots, they take up a lot more resources than just Regfile/ALU bandwidth.
Re:What do RISC and CISC mean in 2020? by FullyFunctional on Friday November 20, 2020 @07:25PM (#25166772)
You seem to misunderstand. With too few registers you may have to spill to the stack. You can't turn those into register moves in the presence of stores without a very advanced memory disambiguation.
Re:What do RISC and CISC mean in 2020? by gpderetta on Friday November 20, 2020 @08:26PM (#25167136)
technically Zen2 does exactly that. They do still use store/load bandwidth though. I guess that counts as very advanced memory disambiguation.
Re:What do RISC and CISC mean in 2020? by FullyFunctional on Friday November 20, 2020 @09:08PM (#25167340)
All high-end processors do it, but that doesn't come for free (design/verification effort + silicon area/power). Also, the capacity for this is limited to the size of the store buffer so without the needless spills, you can apply all this expensive machinery to more real memory ops.

(A similarly but different debate could be had over all the save/reloads we incur on function entry/exits. 29k and SPARC's register windows were attempts at avoiding those).

Re:What do RISC and CISC mean in 2020? by FullyFunctional on Saturday November 21, 2020 @12:59AM (#25168098)
I failed to add that the stores aren't eliminated by this either so we are also incurring increased memory traffic unnecessarily.
Re:What do RISC and CISC mean in 2020? by jcranmer on Saturday November 21, 2020 @01:24AM (#25168175)
We're talking about stores to the stack, which is likely to not be used by other threads/processors, so all of the values are being modified in a cache entry helpfully held in the Modified state and incurring no bus traffic. It will use up the traffic to/from the cache, though.
Re:What do RISC and CISC mean in 2020? by FullyFunctional on Saturday November 21, 2020 @02:31AM (#25168346)
Yes I did mean cache traffic, poor choice of words, but the point is the same (filling up the store buffers etc).
Re:What do RISC and CISC mean in 2020? by gpderetta on Friday November 20, 2020 @08:24PM (#25167115)
> A 200, 300, or 600+ register ISA is unfathomable to

In addition to the confusion between ROB and register file, register renaming (and the distinction between architectural registers and register files) was already well established in 1995.