← Back to context

Comment by CalChris

2 years ago

"If you generate code that looks like what the C compiler would do - which passes on the stack surprisingly often, especially if you’re MSVC - then you hit the CPU’s sweet spot somehow."

The FA is mostly about x86 and Intel indeed did an amazing amount of clever engineering over decades to allow your ugly x86 code to run fast on their silicon that you buy.

Still, does your point about the empirical benefit of passing on the stack continue to apply with a transition to register rich ARMV8 CPUs or RISC-V?

Yes.

If you flatten big structs into registers to pass them you have a bad time on armv8.

I tried. That was an llvm experiment. Ahead of time compiler for a modified version of C.