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

Go to the source code of this file.

Functions

int_fast64_t extF80M_to_i64 (const extFloat80_t *aPtr, uint_fast8_t roundingMode, bool exact)
 

Function Documentation

◆ extF80M_to_i64()

int_fast64_t extF80M_to_i64 ( const extFloat80_t * aPtr,
uint_fast8_t roundingMode,
bool exact )

Definition at line 58 of file extF80M_to_i64.c.

60{
61 const struct extFloat80M *aSPtr;
62 uint_fast16_t uiA64;
63 bool sign;
64 int32_t exp;
65 uint64_t sig;
66 int32_t shiftDist;
67 uint32_t extSig[3];
68
69 /*------------------------------------------------------------------------
70 *------------------------------------------------------------------------*/
71 aSPtr = (const struct extFloat80M *) aPtr;
72 uiA64 = aSPtr->signExp;
73 sign = signExtF80UI64( uiA64 );
74 exp = expExtF80UI64( uiA64 );
75 sig = aSPtr->signif;
76 /*------------------------------------------------------------------------
77 *------------------------------------------------------------------------*/
78 shiftDist = 0x403E - exp;
79 if ( shiftDist < 0 ) {
81 return
82 (exp == 0x7FFF) && (sig & UINT64_C( 0x7FFFFFFFFFFFFFFF ))
85 }
86 /*------------------------------------------------------------------------
87 *------------------------------------------------------------------------*/
88 extSig[indexWord( 3, 2 )] = sig>>32;
89 extSig[indexWord( 3, 1 )] = sig;
90 extSig[indexWord( 3, 0 )] = 0;
91 if ( shiftDist ) softfloat_shiftRightJam96M( extSig, shiftDist, extSig );
92 return softfloat_roundMToI64( sign, extSig, roundingMode, exact );
93
94}
void softfloat_raiseFlags(uint_fast8_t flags)
#define i64_fromNaN
Definition specialize.h:70
#define i64_fromNegOverflow
Definition specialize.h:69
#define i64_fromPosOverflow
Definition specialize.h:68
#define expExtF80UI64(a64)
Definition internals.h:147
#define signExtF80UI64(a64)
Definition internals.h:146
int_fast64_t softfloat_roundMToI64(bool, uint32_t *, uint_fast8_t, bool)
#define indexWord(total, n)
#define softfloat_shiftRightJam96M(aPtr, dist, zPtr)
Definition primitives.h:873
@ softfloat_flag_invalid
Definition softfloat.h:89
unsigned int uint32_t
Definition stdint.h:126
uint16_t uint_fast16_t
Definition stdint.h:155
#define UINT64_C(val)
Definition stdint.h:284
signed int int32_t
Definition stdint.h:123
unsigned __int64 uint64_t
Definition stdint.h:136
uint64_t signif
uint16_t signExp
Here is the call graph for this function: