News for hackers. Stuff that matters.
Re:Why does the Commodore C128 perform poorly when running C... by rbanffy on Friday December 09, 2022 @03:20PM (#33926012)
It's a horrible architecture. Every iteration on top of it made it even more hideous. It's a unnatural thing that should have never been. Every time an x86 powers up, it cries in despair and begs to be killed.
Re:Why does the Commodore C128 perform poorly when running C... by robocat on Friday December 09, 2022 @04:44PM (#33926773)
Your complaint is the designer’s lament, regrets because fast iterations will usually beat a cohesive development, the struggle to accept that the imperfect delivered today wins versus the perfect delivered tomorrow. A good engineer chooses their battles, fights for the right compromises, and grudgingly accepts that the evolutionary remnants in all our engineering artefacts are the price we pay for the results of iterative path dependency. For example, Intel didn’t design the x64 ISA.

  Practice beats perfection
  The engineer’s game we play
  Make do with what we've got
  And make it work today
If you watch Jim Keller talk about microprocessor design, he seems to say that designs converge due to real world constraints and factors. Human designers are imperfect, which Jim seems to be very good at acknowledging. Every now and then we get to refactor, and remove some limiting kludge. But the number of kludges increases with complexity, and kludges are the result of compromises forced by externalities, so the nirvana of a kludge-free world can only be reached in engineer’s fairy tales. Disclaimer: I was an engineer type, but turned dark by the desire for the fruits of capitalism. (Edited)
Re:Why does the Commodore C128 perform poorly when running C... by tssva on Friday December 09, 2022 @03:30PM (#33926118)
> unfortunately, doubled down with the 286, then 386 and here we are.

It may be a horrible architecture but the fact that we are here is a pretty good testament to it not being a dead end.

Re:Why does the Commodore C128 perform poorly when running C... by skissane on Friday December 09, 2022 @04:48PM (#33926804)
> Every time an x86 powers up, it cries in despair and begs to be killed.

Intel/AMD could make their new CPUs start in protected mode, even long mode - and nowadays, likely nobody other than BIOS developers would ever notice. Why don’t they? I guess it would be a fair amount of work with no clear benefit.

One thing they could do - legacy features (real mode, 16-bit protected mode, V86 mode, etc) are now an optional feature for which you have to pay a premium. They could just have a mode which disables them, and fuse that mode on in the factory. With Microsoft’s cooperation, Windows 11 could be made to run on such a CPU without much work. Likely few would demand the optional feature, and it would soon disappear

Re:Why does the Commodore C128 perform poorly when running C... by pcwalton on Friday December 09, 2022 @05:41PM (#33927382)
> One thing they could do - legacy features (real mode, 16-bit protected mode, V86 mode, etc) are now an optional feature for which you have to pay a premium. They could just have a mode which disables them, and fuse that mode on in the factory. With Microsoft’s cooperation, Windows 11 could be made to run on such a CPU without much work.

Customers who need them could just emulate them. Almost everyone already does anyway (DOSBox, etc.)

Though, honestly, I highly suspect the die space spent to support those features is pretty small, and power dissipation concerns mean that it's quite possible there aren't much better uses for that silicon area.

Re:Why does the Commodore C128 perform poorly when running C... by skissane on Friday December 09, 2022 @05:57PM (#33927549)
It inevitably has a cost though, even if at design-time than runtime.

Consider a code base filled with numerous legacy features which almost nobody ever uses. Their presence in the code and documentation means it takes longer for people to understand. Adding new features takes more time, because you have to consider how they interact with the legacy ones, and the risk of introducing regressions or security vulnerabilities through those obscure interactions. You need tests for all these legacy features, which makes testing take more time and be more expensive, and people working on newer features break the legacy tests and have to deal with that. Technical debt has a real cost - and why would that be any less true for a CPU defined in Verilog/VHDL than for a programming language?

And a feature flag is a good way to get rid of legacy features. First add the flag but leave it on. Then start turning it off by default but let people turn it back on for free. Then start charging people money to have it on. Then remove it entirely, and all the legacy features it gates. It works for software-I can’t see why it couldn’t work for hardware too.

Re:Why does the Commodore C128 perform poorly when running C... by rep_lodsb on Friday December 09, 2022 @06:25PM (#33927858)
Why charge money for leaving the legacy features enabled (other than "because they can" / cyberpunk dystopia)?

If they really are such a security risk, surely enterprise customers would rather pay for the ability to turn them off.

Re:Why does the Commodore C128 perform poorly when running C... by skissane on Friday December 09, 2022 @06:38PM (#33927984)
Realistically, they probably won’t charge more money just for this feature. Just limit it to higher priced SKUs.

There must be dies being thrown away right now because they work perfectly except for one of these legacy features. If they had SKUs with legacy features fused off, suddenly those dies might become usable.

Having lower-end SKUs with some features fused off allows you to use dies in which those features are broken. But, it means you have to fuse them off even on the dies in which they work. Buying a low end CPU and finding that some of them randomly have higher-end features would just be too confusing for everyone.

Re:Why does the Commodore C128 perform poorly when running C... by rep_lodsb on Friday December 09, 2022 @07:18PM (#33928287)
Most of a modern x86 die is cache, same as for every other architecture. It's unlikely that there are many dies that have some defect in the legacy microcode and nowhere else.

Fundamentally changing the instruction format might save a little bit of space, but then it wouldn't be compatible with x86-64 anymore either.

Re:Why does the Commodore C128 perform poorly when running C... by skissane on Friday December 09, 2022 @10:13PM (#33929481)
Are all these legacy features pure microcode? I'm sure they mostly are exactly that, but I would not be surprised if some of the hardwired circuitry's behaviour is influenced by mode bits for legacy features. It seems conceivable that a hardwired circuit could have a flaw which caused it to malfunction when it gets some "legacy mode enabled" signal but otherwise work correctly.

You may well be right, that a die being damaged in exactly that way, is rare enough, that the additional yield from being able to use such dies is rather marginal. But I think it would be hard for anyone to know for sure without non-public info.

> Fundamentally changing the instruction format might save a little bit of space, but then it wouldn't be compatible with x86-64 anymore either.

I wasn't talking about that. A CPU which didn't support real mode, 16-bit segments, etc, would still have the same instruction format, so instruction decode would be largely unchanged.

I wonder if we'll ever see a CPU which supports executing both x86 and ARM code, through separate instruction decoders but with a shared execution engine. Of course, there are lots of differences between the two architectures beyond just the instruction decoding, yet in some ways those differences are shrinking (when you look at features like Apple Silicon TSO mode, and Windows 11 ARM64EC architecture).

Re:Why does the Commodore C128 perform poorly when running C... by jabl on Friday December 09, 2022 @05:59PM (#33927570)
Meh. Just hold your nose when the processor boots until it gets into protected or long mode and you're good to go. If ARM or RISC-V eventually take over the x86 market, it will be due to business model reasons and not the superiority of the ISA.
Re:Why does the Commodore C128 perform poorly when running C... by snvzz on Saturday December 10, 2022 @02:35AM (#33930764)
Reasoning for the take-over aside, they're still superior ISAs.

If it is RISC-V, I will celebrate it.

Re:Why does the Commodore C128 perform poorly when running C... by pcwalton on Friday December 09, 2022 @04:39PM (#33926729)
It's funny to see this sentiment wax and wane with Intel's market fortunes. In the early 2010s on this site, with Intel riding high, you'd see lots of comments talking about how x86 was just months away from killing ARM for good on account of a better technical design. Now it's the reverse: people are treating x86 as a horrible dinosaur of an architecture that's on its last legs.

Personally, I think x86 is pretty ugly, but both compilers and chip designers have done an admirable job taming it, so it's not that bad. Process/fabrication concerns tend to dominate nowadays.