diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-03-12 17:38:04 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-03-12 17:38:04 -0700 |
commit | 6517fe26a2a0c89c3112f4a383c601572c71d64a (patch) | |
tree | d37eea7ae6f3e15eee94afb5c9c749a4cd800577 /softfloat/s_f64UIToCommonNaN.c | |
parent | a4ae7da6ef0c09c2616a0b82f7f569e4e134f75c (diff) | |
download | riscv-pk-6517fe26a2a0c89c3112f4a383c601572c71d64a.zip riscv-pk-6517fe26a2a0c89c3112f4a383c601572c71d64a.tar.gz riscv-pk-6517fe26a2a0c89c3112f4a383c601572c71d64a.tar.bz2 |
Update to new privileged spec
Diffstat (limited to 'softfloat/s_f64UIToCommonNaN.c')
-rwxr-xr-x | softfloat/s_f64UIToCommonNaN.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/softfloat/s_f64UIToCommonNaN.c b/softfloat/s_f64UIToCommonNaN.c new file mode 100755 index 0000000..84d8ca0 --- /dev/null +++ b/softfloat/s_f64UIToCommonNaN.c @@ -0,0 +1,25 @@ +
+#include <stdint.h>
+#include "platform.h"
+#include "specialize.h"
+#include "softfloat.h"
+
+/*----------------------------------------------------------------------------
+| Returns the result of converting the double-precision floating-point NaN
+| `a' to the canonical NaN format. If `a' is a signaling NaN, the invalid
+| exception is raised.
+*----------------------------------------------------------------------------*/
+struct commonNaN softfloat_f64UIToCommonNaN( uint_fast64_t uiA )
+{
+ struct commonNaN z;
+
+ if ( softfloat_isSigNaNF64UI( uiA ) ) {
+ softfloat_raiseFlags( softfloat_flag_invalid );
+ }
+ z.sign = uiA>>63;
+ z.v64 = (uint_fast64_t) 0xFFFFFFFFFFFFF <<12;
+ z.v0 = 0;
+ return z;
+
+}
+
|