[PATCH 2/5] d3dx9_36: Implemented ID3DXConstantTable_SetIntArray and ID3DXConstantTable_SetInt (Try 5)

David Laight david at l8s.co.uk
Mon Mar 28 13:47:20 CDT 2011

> Ints and floats are represented differently and so, if we want to put
> an integer array into floating point registers, we need to have casts.
> If you were to simply call SetFloatArray, you would get nonsense
> values in the floating point registers.

Even using casts will fall foul of the C aliasing rules - which
mean that the compiler can assume that a read of type will not be
modified by a write to a different type so can be reorderd (unless 
one of the types is 'char').

Not only that, but there are systems that will fault is an invalid
FP bit pattern is loaded into an FP register.


David Laight: david at l8s.co.uk

More information about the wine-devel mailing list