Merge softfloat_riscv into softfloat
[riscv-isa-sim.git] / softfloat / s_propagateNaNF32UI.c
diff --git a/softfloat/s_propagateNaNF32UI.c b/softfloat/s_propagateNaNF32UI.c
new file mode 100755 (executable)
index 0000000..d8738d1
--- /dev/null
@@ -0,0 +1,25 @@
+\r
+/*** UPDATE COMMENTS. ***/\r
+\r
+#include <stdbool.h>\r
+#include <stdint.h>\r
+#include "platform.h"\r
+#include "internals.h"\r
+#include "specialize.h"\r
+#include "softfloat.h"\r
+\r
+/*----------------------------------------------------------------------------\r
+| Takes two single-precision floating-point values `a' and `b', one of which\r
+| is a NaN, and returns the appropriate NaN result.  If either `a' or `b' is a\r
+| signaling NaN, the invalid exception is raised.\r
+*----------------------------------------------------------------------------*/\r
+\r
+uint_fast32_t\r
+ softfloat_propagateNaNF32UI( uint_fast32_t uiA, uint_fast32_t uiB )\r
+{\r
+    if ( softfloat_isSigNaNF32UI( uiA ) | softfloat_isSigNaNF32UI( uiB ) ) {\r
+        softfloat_raiseFlags( softfloat_flag_invalid );\r
+    }\r
+    return defaultNaNF32UI;\r
+}\r
+\r