How important are denormalized floats in GPUs? For graphics, I would expect very little. For GPGPU, it might matter.
The reason I ask pertains to floating point multiplies. If you want to multiply by denormalized numbers, then the number of bits you have to process may be more. Let's think about what kinds of results you can get from a multiply and how this applies to shifting. If you multiply any two denormalized numbers, you'll get an underflow simply because of the exponent. If you multiply any two normalized numbers, then the smallest result (ignoring the exponent) is 1.0, requiring no shift or adjustment to the exponent. The largest result you can get is 3.999..., which requires the exponent (the sum of the operand exponents) to be increased by 1 and the mantissa to be shifted right by 1. (But to be clear, since these are 24-bit numbers, their product is 47 bits, and you have to discard the lower 23 bits (with rounding) to get back to 24. Then you may shift some more.) If you multiply a normalized number by a denormalized number, then things get complicated. To get the most accurate possible result, you have to look at all 47 bits of the raw product and attempt to shift left to normalize. For OGP, we care more about graphics, so we could just not bother. If we get a denormal, we special-case it or feed the pipeline so that it naturally gives us a zero result. Sugestions? Thoughts? On a related note, I was reading about modern CPU handling of denormalized floats. On Nehalem and most other processors, denormalized numbers cause the FPU to drop to microcode, making operations hundreds of times slower. On Sandy Bridge, there is no such penalty. (One of the many interesting enhancements from Sandy Bridge that Intel's enigmatic marketing department decided not to take advantage of.) -- Timothy Normand Miller http://www.cse.ohio-state.edu/~millerti Open Graphics Project _______________________________________________ Open-graphics mailing list [email protected] http://lists.duskglow.com/mailman/listinfo/open-graphics List service provided by Duskglow Consulting, LLC (www.duskglow.com)
