[sim] added riscv folder to softfloat
[riscv-isa-sim.git] / softfloat / SoftFloat-3 / source / riscv / s_commonNaNToF64UI.c
diff --git a/softfloat/SoftFloat-3/source/riscv/s_commonNaNToF64UI.c b/softfloat/SoftFloat-3/source/riscv/s_commonNaNToF64UI.c
new file mode 100755 (executable)
index 0000000..474ceee
--- /dev/null
@@ -0,0 +1,19 @@
+
+#include <stdint.h>
+#include "platform.h"
+#include "specialize.h"
+
+/*----------------------------------------------------------------------------
+| Returns the result of converting the canonical NaN `a' to the double-
+| precision floating-point format.
+*----------------------------------------------------------------------------*/
+
+uint_fast64_t softfloat_commonNaNToF64UI( struct commonNaN a )
+{
+
+    return
+        (uint_fast64_t) a.sign<<63 | UINT64_C( 0x7FF8000000000000 )
+            | a.v64>>12;
+
+}
+