r/AskComputerScience • u/biggboss83 • Jan 17 '17
How much progress is being held back by backwards compatibility?
The x86 architecture is quite old measured in computer years. Could performance be better if designed from scratch? How much better? Any other areas where more gains could be had?
Just asking theoretically, assume you could magically replace all hardware.
4
u/dmazzoni Jan 17 '17
In addition to what others said, keep in mind that pretty much every x86 machine you have today is actually x86-64. The 64-bit instructions in x86-64 are relatively new and modern, they were designed from scratch to be efficient and flexible and without any of the limitations of x86, but in a way that allows them to coexist with 32-bit x86 instructions.
3
u/BonzoESC Jan 17 '17
All of it and none of it.
Intel does spend a lot of engineering hours on microcode and compatibility with existing software. On the other hand, developers of bytecode-level software tools (i.e. compiler backends like the LLVM IR to x86-64 stage, cross-platform emulators like qemu-i386-static, analysis tools like angr or Binary Ninja) don't have to start from scratch when supporting this year's x86-64 CPUs.
I'd rather a CPU instruction set make some performance and efficiency compromises to work with existing software than have to chase down a new software stack every few years.
2
u/Chandon Jan 17 '17
As others have said, the x86_64 instruction set is actually pretty decent.
If I were looking for things to change that are blocked by backwards compatibility, I'd consider things like the standard 4k page size. That may not be a good design tradeoff anymore.
1
11
u/IgnorantPlatypus Jan 17 '17
x86 CPU doesn't actually execute x86 instructions. They're turned into Microcode which is then executed out-of-order by the CPU as it can. And microcode instructions are even less expressive generally than a RISC instruction set. So it's not the assembly that really affects performance, it's things like speculative execution, branch prediction, etc.