--- /dev/null
+\r
+#include <stdbool.h>\r
+#include <stdint.h>\r
+#include "platform.h"\r
+#include "primitives.h"\r
+#include "internals.h"\r
+#include "softfloat.h"\r
+\r
+float64_t i32_to_f64( int_fast32_t a )\r
+{\r
+ uint_fast64_t uiZ;\r
+ bool sign;\r
+ uint_fast32_t absA;\r
+ int shiftCount;\r
+ union ui64_f64 uZ;\r
+\r
+ if ( ! a ) {\r
+ uiZ = 0;\r
+ } else {\r
+ sign = ( a < 0 );\r
+ absA = sign ? - a : a;\r
+ shiftCount = softfloat_countLeadingZeros32( absA ) + 21;\r
+ uiZ =\r
+ packToF64UI(\r
+ sign, 0x432 - shiftCount, (uint_fast64_t) absA<<shiftCount );\r
+ }\r
+ uZ.ui = uiZ;\r
+ return uZ.f;\r
+\r
+}\r
+\r