d3dx9: Implement D3DXFloat16to32Array and D3DXFloat32to16Array.

David Laight david at l8s.co.uk
Fri Feb 11 15:39:05 CST 2011

On Fri, Feb 11, 2011 at 10:20:10PM +0100, Stefan D?singer wrote:
> Am Freitag 11 Februar 2011, 20:48:58 schrieb Misha Koshelev:
> > +    if (*((unsigned int *)&in) == 0x00000000) return 0x0000;
> > +    if (*((unsigned int *)&in) == 0x80000000) return 0x8000;
> Thinking about it, there's something about this line that is not so nice: It 
> relies on the actual encoding of the float, which may technically be platform 
> specific if there's a CPU that implements non-IEEE- 754 floats.

The 'usual' non-IEEE fp systems are vax (you probably can't put enough
memory in a vax to run wine!) and some arm systems where the two 32bit
words of a double aren't stored in the expected order!

Some embedded systems might not bother with denormalised encodings
for values near zero. I don't know if anything uses an abolute offset
to avoid that gap (the main difference between aLaw anf uLaw audio).

It also requires that the compiler use stricter data aliasing rules
than are required by the C standard.
Using a union is ok (but you must write and read a union variable,
not just cast to a union type.


David Laight: david at l8s.co.uk

More information about the wine-devel mailing list