Remix.run Logo
▲ bajard a day ago

I can't believe x86 is half a century old, and we're still using it.

▲throwa356262 a day ago | parent | next [-]

I belive what we today see as x86 started with the 386, from 1985-ish. Not 8008 which is a completely different architecture and ISA.

Todays PCs run AMD x64, which some people call x86-64. But again this is a completely different beast compared to the good old x86. It was introduced in 2000 after Intels 64 architecture proposal failed miserably.

▲adrian_b 20 hours ago | parent [-]

Most instructions of 8008 are still implemented by the latest Intel-AMD CPUs, even if for most of them there is normally no reason to use them, especially in a 64-bit program, where operations with 8-bit registers should be avoided.

Intel 8080 has changed some instruction encodings and it has replaced a few instructions, but it has retained almost all the 8008 instruction set as a subset. Intel 8086 has changed completely the instruction encodings, but again it has retained almost all the 8080 instruction set as a subset. The Intel 8086 instruction set is still implemented completely by the most recent Intel-AMD CPUs, remaining assembly-code compatible with 8080 and even with much of the 8008 assembly code.

In 64-bit mode, a few of the 8086 instructions are removed and for the others, if they reference memory, the 64-bit addressing modes are used instead of the 16-bit addressing modes, but otherwise they still work like in 8086, or even like in 8080 or 8008, if they belong to those subsets.

▲bajard 16 hours ago | parent | next [-]

Insufficient support for operations with 8-bit registers is a bottleneck even in 64-bit CPUs.

For example, let's suppose that you have a for loop. You could update 8 uint8 values simultaneously by packing them into a uint64 and adding a constant. But when you need to unpack those 8 bytes to actually use them as indexes, the unpacking costs a lot of CPU cycles, so you lose the advantage you gained by avoiding 8 separate additions.

All you can do is access AH and AL (or `SIL`, `DIL`, `BPL`, `SPL`, etc.), but this does not take just 1 CPU cycle. It takes many cycles, and only the lowest bytes can be accessed. There is a lot of performance left on the table because of insufficient support for small registers inside larger registers.

▲RetroTechie 15 hours ago | parent | prev | next [-]

Lacking modularity of the ISA, I can understand why many of those instructions were carried forward.

But all the legacy operating modes too? A modern x86 cpu should only have 2:

# Full-on 64 bit, legacy cruft cleared out as much as possible

# A compatibility mode to run application code written for 32-bit protected mode OSes like Win2k/XP etc

And even that last mode could be optional. Any other legacy support is just waste of transistors imho (however 'few').

Intel made a move in that direction years ago (X86S). Sadly that went nowhere.

▲throwa356262 19 hours ago | parent | prev [-]

Just because they can execute some similar instructions it doesnt mean they are the same. 8008 came from a common-bus design with an accumulator-centric ISA, which is miles aways from today's x64.

Besides, ISA is just the CPU frontend and does not reflect the uarch. You can probably make a Ryzen execute ARM or MIPS code by changing a few frontend opcode / fw tables.

▲stinkbeetle 20 hours ago | parent | prev [-]

Well the computer is 80 years old and we're still using those.