News for hackers. Stuff that matters.
Re:Playstation 3 Architecture by shaggie76 on Wednesday October 20, 2021 @05:23PM (#28936850)
I worked on PS3 titles that used SPUs and I can't tell you how relieved I was to find that the PS4 did away with them. The fear that the next PS would have "64 SPUs and a marginally faster PPU" was real.

The analogy I gave to my friends at the time was working in a restaurant kitchen with a tiny stovetop and 2-dozen microwave ovens; does some things really fast, but only if you can cut them up into small pieces that are microwave-friendly.

Re:Playstation 3 Architecture by NikolaeVarius on Wednesday October 20, 2021 @06:04PM (#28937384)
Im not an expert at all, but I seem to recall issues also arising from the inability to do out of order execution.
Re:Playstation 3 Architecture by corysama on Wednesday October 20, 2021 @07:03PM (#28937988)
Both the PS3 and X360 CPUs featured no out of order execution, no speculative execution, no automatic prefetch, and a 500 cycle latency for hitting main mem outside of cache.

The hardware design was based on 1) This is currently the only way to hit that clock rate at this cost 2) Hyperthreading effectively halve all latencies 3) It's a fixed platform, the compiler should know exactly what to do. 3 was pretty laughable. It is only technically possible if you have huge linear code blocks without branching or dynamic addressing.

I would remind junior programmers that the PS2 ran at 300Mhz and had a 50 cycle memory latency and the PS3 ran at 3Ghz but had a 500 cycle latency. So, if you are missing cache, your PS3 game runs like it's on a PS2.

On the other hand, a lot of people overreacted to the manual DMA situation of SPU programming. DMAs from main mem into SPU mem had a latency of.... 500 cycles! Once people put 2 and 2 together, SPU programming became less scary. Still a pain in the ass. And, a lot of work to reach peak performance. But, more approachable for sub-optimal tasks.

Re:Playstation 3 Architecture by monocasa on Wednesday October 20, 2021 @08:13PM (#28938581)
Also that damn load hit store penalty. PPEs and Xenon cores could only detect and stall if a read was for an address that was currently being flushed out of the write buffers. Most sane uarchs will bypass out of the store queue, but those cores needed to flush all of the way out to L1 and read it back in.

Also, IIRC, shift by variable amount was microcoded and would take a cycle for each bit distance shifted.

Re:Playstation 3 Architecture by pcwalton on Wednesday October 20, 2021 @11:41PM (#28939944)
> Also, IIRC, shift by variable amount was microcoded and would take a cycle for each bit distance shifted.

Wait, it was possible to ship a CPU in 2006 without a barrel shifter? ARM1 was from 1985!

If it was something silly like "only constant bit shifts use the barrel shifter", I'm surprised that compilers didn't compile variable shifts as a jump table to a bunch of constant shift instructions... :)

Re:Playstation 3 Architecture by monocasa on Thursday October 21, 2021 @01:23AM (#28940633)
>Wait, it was possible to ship a CPU in 2006 without a barrel shifter? ARM1 was from 1985!

I was absolutely floored too.

And it made very little sense to me either. PowerPC has probably my favorite main ISA bit manipulation instructions out there: rwlimi

https://www.ibm.com/docs/en/aix/7.2?topic=is-rlwimi-rlimi-ro...

Any logical shift, rotate, bit field extract (by constant) and more all in one single cycle instruction that's been included since the earliest POWER days. They had a barrel rotater in the core for that instruction.

The only thing that makes any sense to me is that somehow it would have been too expensive to rig up another register file read port to that sh input, so they just pump it as many times needed with sh fixed to 1. They seemed to be on some gate count crusade that might have payed off if they were able to clock it faster at the end of the day. It took the industry a bit to figure out that ubiquitous 10Ghz chips weren't going to happen, and the hardest lessons would have been right in that design cycle. : \

> If it was something silly like "only constant bit shifts use the barrel shifter", I'm surprised that compilers didn't compile variable shifts as a jump table to a bunch of constant shift instructions... :)

Variable shift isn't the most common op in the world, so as far as I know it was just listed as something to avoid if you're writing tight loops.

Re:Playstation 3 Architecture by jiggawatts on Wednesday October 20, 2021 @09:36PM (#28939249)
The SPU approach is pretty much what a GPU does, but instead of 64 they have hundreds if not thousands.

I think the main issue with the Cell design was that it was too "middle road" and wasn't specialised enough in either direction.

Re:Playstation 3 Architecture by unsigner on Wednesday October 20, 2021 @11:53PM (#28940027)
It really isn’t - the individual elements in a GPU can access RAM directly, while you needed to wheelbarrow data (and code!) to and from SPUs manually. This was the major pain point, not the extreme (for that time) parallelism or the weird-ish instruction set.
Re:Playstation 3 Architecture by pandaman on Thursday October 21, 2021 @08:32AM (#28943462)
It depends on what you mean by "access RAM directly", both SPUs and GPUs (at least on PS4) can read/write system memory. Both do this asynchronously. If you want random access to system memory you will die on a GPU even sooner than on an SPU since latencies are much bigger.

So there is not much difference imho and the GP is correct.

Re:Playstation 3 Architecture by unsigner on Friday October 22, 2021 @04:32AM (#28954878)
SPUs read memory asynchronously by requesting a DMA; GPUs read memory asynchronously too, but this is not explicitly visible to the programmer, and serious infrastructure is devoted to hiding that latency. The problem with SPUs was never that they are slow, rather than they are outright programmer-hostile.
Re:Playstation 3 Architecture by pandaman on Friday October 22, 2021 @08:30AM (#28956437)
>but this is not explicitly visible to the programmer , and serious infrastructure is devoted to hiding that latency

What do you mean? You can hide latency on SPU by double-buffering the DMA but in a shader there is no infrastructure at all and no way to hide unlike SPU, you just block until the memory fetch completes before you need the data.

> they are outright programmer-hostile

Depends on the programmer I guess, I enjoyed programming SPUs, don't know personally anybody who had complaints. Only read about the "insanely hard to program PS3" on the internet and wonder "who are those people?". It's especially funny because the RSX was a pitiful piece of crap with crappy tooling [+] from NVidia yet nobody complaining about SPUs mentions that.

[+] Not an exaggeration. For example, the Cg compiler would produce different code if you +0/*1 random scalars in your shader and not necessarily slower code too! So one of the release steps was bruteforcing this to shave off few clocks from the shaders.

Re:Playstation 3 Architecture by pcwalton on Wednesday October 20, 2021 @11:34PM (#28939899)
> The SPU approach is pretty much what a GPU does, but instead of 64 they have hundreds if not thousands.

Eh, only if you count every SIMD lane as a separate "core" like GPU manufacturer marketing does. More realistically, you should count what NVIDIA calls SMs, where the numbers are more comparable (GeForce RTX 3080 has 80, for example).

Re:Playstation 3 Architecture by pandaman on Thursday October 21, 2021 @08:36AM (#28943493)
PS3 6 SPUs(1 is system reserved) 4-way SIMD

PS4 - 18 GCN CUs, each has four 16-ways SIMDs for 72 SIMDs but each is 4 times wider so PS4 has the same number of ways as in 288 4-ways SPUs.