[sim] integrated SoftFloat-3 with ISA sim; removed SoftFloat-2b
[riscv-isa-sim.git] / softfloat / 8086 / s_f32UIToCommonNaN.c
diff --git a/softfloat/8086/s_f32UIToCommonNaN.c b/softfloat/8086/s_f32UIToCommonNaN.c
new file mode 100755 (executable)
index 0000000..067e8da
--- /dev/null
@@ -0,0 +1,25 @@
+\r
+#include <stdint.h>\r
+#include "platform.h"\r
+#include "specialize.h"\r
+#include "softfloat.h"\r
+\r
+/*----------------------------------------------------------------------------\r
+| Returns the result of converting the single-precision floating-point NaN\r
+| `a' to the canonical NaN format.  If `a' is a signaling NaN, the invalid\r
+| exception is raised.\r
+*----------------------------------------------------------------------------*/\r
+struct commonNaN softfloat_f32UIToCommonNaN( uint_fast32_t uiA )\r
+{\r
+    struct commonNaN z;\r
+\r
+    if ( softfloat_isSigNaNF32UI( uiA ) ) {\r
+        softfloat_raiseFlags( softfloat_flag_invalid );\r
+    }\r
+    z.sign = uiA>>31;\r
+    z.v64 = (uint_fast64_t) uiA<<41;\r
+    z.v0 = 0;\r
+    return z;\r
+\r
+}\r
+\r