D-Programming-Language/dmd — pull request #1383 by donc (2012-12-18 08:50:55+00:00)
Title: 9170 CTFE: Allow reinterpret casts float <-> int

This a special-case extension to CTFE at Walter's request, to allow the implementation of HalfFloat to be completed. Up to now there has been no way in CTFE to peek into the raw bits of a floating-point type to extract the exponent, etc.

This adds the special case *(cast(U*))&e, where e is an expression
of type T, T.sizeof == U.sizeof, one type is integral (int, uint, long, ulong) and the other is floating point (float,double, ifloat, idouble).

More general situations will be added later. (Note that there is still no way to extract the components of an 80-bit real).