2 ms·
>And in fact C/C++ can be as fast, or even faster than hand-rolled assembly most of the time (with few exception) This is generally true, but to be fair the re
by Arizhel 10y ago
>And in fact C/C++ can be as fast, or even faster than hand-rolled assembly most of the time (with few exception)
This is generally true, but to be fair the reason is because we design CPUs differently these days. Modern CPUs use instruction sets that are specifically designed to work well with compilers, and aren't meant to be programmed in hand-coded assembly except for a few critical bits deep within OS code. Older CPUs weren't like this.
It still might be possible to write hand-rolled assembly that beats modern compilers, but you probably need to have seriously super-human mental abilities to do it.
- gpderetta 10y ago> the reason is because we design CPUs differently these days. Modern CPUs use instruction sets that are specifically designed to work well with compilers You got the causality wrong. Assembly programmer-friendly CPUs died because CPUs which weren't as friendly were faster and cheaper; those same CPUs were instead more amenable as compiler targets.