News for hackers. Stuff that matters.
Re:Intel's Redwood Cove: Baby Steps Are Still Steps by pclmulqdq on Monday September 23, 2024 @01:17AM (#41622576)
Giving them another shot. Pentium 4 had them, but there were some skill issues on the part of programmers using them, and so code quality rose when CPUs started ignoring them.
Re:Intel's Redwood Cove: Baby Steps Are Still Steps by TrainedMonkey on Monday September 23, 2024 @12:43PM (#41627967)
Arguably on P4 they were required to get any kind of throughput due to an incredibly long execution pipeline Intel contrived to keep pushing clock frequency up. Branch mispredictions were extremely costly on that architecture.
Re:Intel's Redwood Cove: Baby Steps Are Still Steps by pclmulqdq on Monday September 23, 2024 @12:48PM (#41628028)
Yes, the Pentium 4 pipeline was ~32 cycles long, which meant that a branch misprediction carried a huge penalty. Processors today have settled on using a ~15-cycle pipeline.
Re:Intel's Redwood Cove: Baby Steps Are Still Steps by magicalhippo on Monday September 23, 2024 @07:33PM (#41631677)
I've probably read about it and forgotten, but what on earth was it doing in all those pipeline stages?

Were there a lot of idle/no-op stages for simple instructions? Or did most instructions, even simple ones, actually get some useful work done for each of those 32ish stages?

Re:Intel's Redwood Cove: Baby Steps Are Still Steps by pclmulqdq on Monday September 23, 2024 @11:03PM (#41632748)
Here's a good source for the earliest Pentium 4, which had a 20-cycle pipeline: https://courses.cs.washington.edu/courses/cse378/10au/lectur...

Mostly the stages you expect from an out-of-order core all had their own pipeline slot in order to go super fast, and some were split into two stages. For example, you have two stages to calculate the next instruction (branch prediction), two stages to fetch, a stage to redrive a value from the memory bus, etc. From there, the ALUs could only do a 16-bit add in one cycle, so even an addition took at least 3 cycles. The later Pentium 4's took this subdivision even further with the goal of reaching 4-5 GHz clocks in 2005.

The whole chip was hand-laid-out, so it was possible to put pipeline registers in places that would have been weird to do in Verilog.

Re:Intel's Redwood Cove: Baby Steps Are Still Steps by rayiner on Monday September 23, 2024 @01:36PM (#41628546)
I don’t think it’s a skill issue. It’s that they’re really only useful with profile guided optimization—so you can have hints that reflect actual branch probabilities. But most developers don’t seem to bother to do that.
Re:Intel's Redwood Cove: Baby Steps Are Still Steps by acdha on Monday September 23, 2024 @06:53PM (#41631439)
If memory serves, wasn't that a bit of a tool minefield back then, too? It’s been a while but I thought I remembered a few colleagues trying GCC’s version which involved building a new version of GCC, slowing down the builds a fair amount, and then seeing only a small benefit – far less than they got switching to the first AMD Opteron when it came out a year later.
Re:Intel's Redwood Cove: Baby Steps Are Still Steps by pcwalton on Monday September 23, 2024 @10:27PM (#41632573)
I wouldn't say that PGO is necessary to predict branches correctly. Lots of branches are exceptional control flow (error checks, bounds checks, etc.) and compilers will almost always correctly statically predict not taken for them. Any branch with a target that's postdominated by a throw or a process abort can basically be safely predicted not taken (after all, if you got it wrong, the penalty is going to be minuscule compared to the cost of the exception).
Re:Intel's Redwood Cove: Baby Steps Are Still Steps by eigenform on Monday September 23, 2024 @11:28PM (#41632882)
The hardware itself is already very good at predicting the direction. I think the point about PGO here is that you need it to find infrequently-occuring biased-taken branches.

When you encounter a biased-taken branch that isn't currently being tracked by the machine, you're always condemned to pay the cost of a misprediction because the default prediction is "not-taken". The hinting here is supposed to indicate "when encountering this branch, don't predict not-taken by default."