SIMD tuning with ASM pt. 1 - Stars & Constellations

ASM? You mean assembly language? I haven't looked at that since my senior project! How arcane! And compilers are so smart anymore, why should I care?

I used to feel the same way...albeit with a latent desire to learn it as I wish I knew Latin. Then one day I found myself out of options on my SIMD code generation project. The compilers were great, but making progress was like building a ship in the bottle. I was playing a game I know you've played too: "Let's Guess What the Compiler Will Do"!

I got tired of that game and bit the bullet. I did ASM dumps and tried to understand them. At first it appeared to me as a chaotic mess...like stars to someone who's never learned the constellations. As time went on though I found Orion! And Ursa Major too! Sideribus apparuit! That is, the patterns jumped out and became easy. Before I knew it, diving into ASM became part of my routine.

I want to share my know-how with you. Each post I'll give you a program and take apart the ASM that we care about using the Intel® C++ Compiler for Linux*. I guess I'll expect you to have a basic understanding of ASM, registers and the like...though I won't expect much. Stay tuned!

For more complete information about compiler optimizations, see our Optimization Notice.

2 comments

Top
anonymous's picture

Nice, I look forward to following you on this one.

I love assembly language. But, thus far, havent gone through the C++ dumps to see what can be further optimised.

anonymous's picture

Sounds like very cool stuff. I've been looking into ARM for a side project I'm working on (basic quantum nanostructure calculations), particularly NEON, so it'll be very interesting to learn more about Intel's offerings.

So far on x86, I've usually left it up to the compiler. Usually. But I love the nitty-gritty details, and in particular where I should use hand-crafted ASM to gain a performance edge.

Now to make it complete, how about comparing it with PTX... ;)

Add a Comment

Have a technical question? Visit our forums. Have site or software product issues? Contact support.