Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
f64_to_ui32_r_minMag.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include "platform.h"
#include "internals.h"
#include "specialize.h"
#include "softfloat.h"
Include dependency graph for f64_to_ui32_r_minMag.c:

Go to the source code of this file.

Functions

uint_fast32_t f64_to_ui32_r_minMag (float64_t a, bool exact)
 

Function Documentation

◆ f64_to_ui32_r_minMag()

uint_fast32_t f64_to_ui32_r_minMag ( float64_t a,
bool exact )

Definition at line 44 of file f64_to_ui32_r_minMag.c.

45{
46 union ui64_f64 uA;
47 uint_fast64_t uiA;
48 int_fast16_t exp;
49 uint_fast64_t sig;
50 int_fast16_t shiftDist;
51 bool sign;
53
54 /*------------------------------------------------------------------------
55 *------------------------------------------------------------------------*/
56 uA.f = a;
57 uiA = uA.ui;
58 exp = expF64UI( uiA );
59 sig = fracF64UI( uiA );
60 /*------------------------------------------------------------------------
61 *------------------------------------------------------------------------*/
62 shiftDist = 0x433 - exp;
63 if ( 53 <= shiftDist ) {
64 if ( exact && (exp | sig) ) {
66 }
67 return 0;
68 }
69 /*------------------------------------------------------------------------
70 *------------------------------------------------------------------------*/
71 sign = signF64UI( uiA );
72 if ( sign || (shiftDist < 21) ) {
74 return
75 (exp == 0x7FF) && sig ? ui32_fromNaN
77 }
78 /*------------------------------------------------------------------------
79 *------------------------------------------------------------------------*/
80 sig |= UINT64_C( 0x0010000000000000 );
81 z = sig>>shiftDist;
82 if ( exact && ((uint_fast64_t) z<<shiftDist != sig) ) {
84 }
85 return z;
86
87}
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
void softfloat_raiseFlags(uint_fast8_t flags)
#define ui32_fromNegOverflow
Definition specialize.h:55
#define ui32_fromPosOverflow
Definition specialize.h:54
#define ui32_fromNaN
Definition specialize.h:56
#define signF64UI(a)
Definition internals.h:125
#define expF64UI(a)
Definition internals.h:126
#define fracF64UI(a)
Definition internals.h:127
@ softfloat_flag_invalid
Definition softfloat.h:89
@ softfloat_flag_inexact
Definition softfloat.h:85
THREAD_LOCAL uint_fast8_t softfloat_exceptionFlags
uint64_t uint_fast64_t
Definition stdint.h:157
#define UINT64_C(val)
Definition stdint.h:284
uint32_t uint_fast32_t
Definition stdint.h:156
int16_t int_fast16_t
Definition stdint.h:151
float64_t f
Definition internals.h:47
Here is the call graph for this function: