Googles appar
Huvudmeny

Post a Comment On: cbloom rants

"08-06-10 - More SPU"

3 Comments -

1 – 3 of 3
Blogger Krzysztof Narkowicz said...

6. Maybe you should try splitting loads and calculations (http://cellperformance.beyond3d.com/articles/2006/04/a-practical-gcc-trick-to-use-during-optimization.html)? Although from my small experience, SPU compiler is so bad, that any random and strange code change can lead to increased performance :).

August 8, 2010 at 10:57 PM

Blogger ryg said...

"Right now my code is 5-10% faster with a few scheduling barriers manually inserted (19 clocks per symbol vs 21). That's fucking bananas, it means the compiler's scheduler is fucking up somehow."
The GCC scheduler isn't very good.

There's SPA (SPU Pipelining Assembler) which does pretty good register allocation, unrolling and scheduling (software pipelining to work around latencies). But it doesn't integrate well with C code at all, if you want to try it, you basically have to port that function and everything below it to SPA, which is a maintenance nightmare for code that you occasionally want to touch. It's particularly bad if you're targeting multiple platforms so you absolutely positively need the C++ code version alongside.

That said, once you've distilled your code down to relatively simple loops, it works a lot better to just write it in ASM without worrying about scheduling and unrolling, then let SPA figure out the rest. It's a lot less frustrating than tweaking C++ code in obscure ways to get the compiler to do what you want, anyway.

August 8, 2010 at 11:08 PM

Blogger cbloom said...

" Maybe you should try splitting loads and calculations (http://cellperformance.beyond3d.com/articles/2006/04/a-practical-gcc-trick-to-use-during-optimization.html)"

To be clear : Mike's post is about using the GCC scheduling trick to make it easier to read the assembly so that you can see what's going on and then optimize it.

That's what I was doing when I discovered that it had randomly gotten faster.

August 9, 2010 at 12:28 AM

You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.