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

Go to the source code of this file.

Functions

uint_fast32_t f128M_to_ui32_r_minMag (const float128_t *aPtr, bool exact)
 

Function Documentation

◆ f128M_to_ui32_r_minMag()

uint_fast32_t f128M_to_ui32_r_minMag ( const float128_t * aPtr,
bool exact )

Definition at line 55 of file f128M_to_ui32_r_minMag.c.

56{
57 const uint32_t *aWPtr;
58 uint32_t uiA96;
59 int32_t exp;
60 uint64_t sig64;
61 int32_t shiftDist;
62 bool sign;
63 uint32_t z;
64
65 /*------------------------------------------------------------------------
66 *------------------------------------------------------------------------*/
67 aWPtr = (const uint32_t *) aPtr;
68 uiA96 = aWPtr[indexWordHi( 4 )];
69 exp = expF128UI96( uiA96 );
70 sig64 = (uint64_t) fracF128UI96( uiA96 )<<32 | aWPtr[indexWord( 4, 2 )];
71 if ( aWPtr[indexWord( 4, 1 )] | aWPtr[indexWord( 4, 0 )] ) sig64 |= 1;
72 /*------------------------------------------------------------------------
73 *------------------------------------------------------------------------*/
74 shiftDist = 0x402F - exp;
75 if ( 49 <= shiftDist ) {
76 if ( exact && (exp | sig64) ) {
78 }
79 return 0;
80 }
81 /*------------------------------------------------------------------------
82 *------------------------------------------------------------------------*/
83 sign = signF128UI96( uiA96 );
84 if ( sign || (shiftDist < 17) ) {
86 return
87 (exp == 0x7FFF) && sig64 ? ui32_fromNaN
89 }
90 /*------------------------------------------------------------------------
91 *------------------------------------------------------------------------*/
92 sig64 |= UINT64_C( 0x0001000000000000 );
93 z = sig64>>shiftDist;
94 if ( exact && ((uint64_t) z<<shiftDist != sig64) ) {
96 }
97 return z;
98
99}
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 fracF128UI96(a96)
Definition internals.h:249
#define signF128UI96(a96)
Definition internals.h:247
#define expF128UI96(a96)
Definition internals.h:248
#define indexWord(total, n)
#define indexWordHi(total)
@ softfloat_flag_invalid
Definition softfloat.h:89
@ softfloat_flag_inexact
Definition softfloat.h:85
THREAD_LOCAL uint_fast8_t softfloat_exceptionFlags
unsigned int uint32_t
Definition stdint.h:126
#define UINT64_C(val)
Definition stdint.h:284
signed int int32_t
Definition stdint.h:123
unsigned __int64 uint64_t
Definition stdint.h:136
Here is the call graph for this function: