aboutsummaryrefslogtreecommitdiff
path: root/softfloat/s_f64UIToCommonNaN.c
blob: 84d8ca0e1e3f11998d65720e97eb3064f1fd3db6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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;

}