Part 5 : Math Optimizations1. Rewriting simple maths expressions for performance.I'll just list a few of the things you can do, that may seem very obvious, but you shouldn't pass over!
I am sure there are more, you can always suggest these to me, so I can add them to this article. 2. Taking advantage of the architecture.Say you're working on that nice PentiumIII of yours. You have 32bit registers, but you are performing operations on 16bit numbers. In some cases, depending on the operation and the chance of overflow, you could perform two operations in one register, at once. This is what SIMD (Single Instruction, Multiple Data - exactly what we were talking about), like SSE, 3DNow! and MMX were designed for - allowing this kind of thing. I'm by no means an expert, so I can't give you specific examples, but I thought I'd give you a general idea on how you might be able to use it - sometimes even without MMX or SSE.
|
|||||||||||