Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
f128_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 f128_to_ui32_r_minMag.c:

Go to the source code of this file.

Functions

uint_fast32_t f128_to_ui32_r_minMag (float128_t a, bool exact)
 

Function Documentation

◆ f128_to_ui32_r_minMag()

uint_fast32_t f128_to_ui32_r_minMag ( float128_t a,
bool exact )

Definition at line 44 of file f128_to_ui32_r_minMag.c.

45{
46 union ui128_f128 uA;
47 uint_fast64_t uiA64, uiA0;
48 int_fast32_t exp;
49 uint_fast64_t sig64;
50 int_fast32_t shiftDist;
51 bool sign;
53
54 /*------------------------------------------------------------------------
55 *------------------------------------------------------------------------*/
56 uA.f = a;
57 uiA64 = uA.ui.v64;
58 uiA0 = uA.ui.v0;
59 exp = expF128UI64( uiA64 );
60 sig64 = fracF128UI64( uiA64 ) | (uiA0 != 0);
61 /*------------------------------------------------------------------------
62 *------------------------------------------------------------------------*/
63 shiftDist = 0x402F - exp;
64 if ( 49 <= shiftDist ) {
65 if ( exact && (exp | sig64) ) {
67 }
68 return 0;
69 }
70 /*------------------------------------------------------------------------
71 *------------------------------------------------------------------------*/
72 sign = signF128UI64( uiA64 );
73 if ( sign || (shiftDist < 17) ) {
75 return
76 (exp == 0x7FFF) && sig64 ? ui32_fromNaN
78 }
79 /*------------------------------------------------------------------------
80 *------------------------------------------------------------------------*/
81 sig64 |= UINT64_C( 0x0001000000000000 );
82 z = sig64>>shiftDist;
83 if ( exact && ((uint_fast64_t) z<<shiftDist != sig64) ) {
85 }
86 return z;
87
88}
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
@ 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
int32_t int_fast32_t
Definition stdint.h:152
Here is the call graph for this function: