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

Go to the source code of this file.

Functions

uint_fast64_t extF80_to_ui64 (extFloat80_t a, uint_fast8_t roundingMode, bool exact)
 

Function Documentation

◆ extF80_to_ui64()

uint_fast64_t extF80_to_ui64 ( extFloat80_t a,
uint_fast8_t roundingMode,
bool exact )

Definition at line 45 of file extF80_to_ui64.c.

46{
47 union { struct extFloat80M s; extFloat80_t f; } uA;
48 uint_fast16_t uiA64;
49 bool sign;
50 int_fast32_t exp;
51 uint_fast64_t sig;
52 int_fast32_t shiftDist;
53 uint_fast64_t sigExtra;
54 struct uint64_extra sig64Extra;
55
56 /*------------------------------------------------------------------------
57 *------------------------------------------------------------------------*/
58 uA.f = a;
59 uiA64 = uA.s.signExp;
60 sign = signExtF80UI64( uiA64 );
61 exp = expExtF80UI64( uiA64 );
62 sig = uA.s.signif;
63 /*------------------------------------------------------------------------
64 *------------------------------------------------------------------------*/
65 shiftDist = 0x403E - exp;
66 if ( shiftDist < 0 ) {
68 return
69 (exp == 0x7FFF) && (sig & UINT64_C( 0x7FFFFFFFFFFFFFFF ))
72 }
73 /*------------------------------------------------------------------------
74 *------------------------------------------------------------------------*/
75 sigExtra = 0;
76 if ( shiftDist ) {
77 sig64Extra = softfloat_shiftRightJam64Extra( sig, 0, shiftDist );
78 sig = sig64Extra.v;
79 sigExtra = sig64Extra.extra;
80 }
81 return softfloat_roundToUI64( sign, sig, sigExtra, roundingMode, exact );
82
83}
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
void softfloat_raiseFlags(uint_fast8_t flags)
#define ui64_fromPosOverflow
Definition specialize.h:65
#define ui64_fromNegOverflow
Definition specialize.h:66
#define ui64_fromNaN
Definition specialize.h:67
#define expExtF80UI64(a64)
Definition internals.h:147
#define signExtF80UI64(a64)
Definition internals.h:146
@ softfloat_flag_invalid
Definition softfloat.h:89
uint_fast64_t softfloat_roundToUI64(bool sign, uint_fast64_t sig, uint_fast64_t sigExtra, uint_fast8_t roundingMode, bool exact)
struct uint64_extra softfloat_shiftRightJam64Extra(uint64_t a, uint64_t extra, uint_fast32_t dist)
uint16_t uint_fast16_t
Definition stdint.h:155
uint64_t uint_fast64_t
Definition stdint.h:157
#define UINT64_C(val)
Definition stdint.h:284
int32_t int_fast32_t
Definition stdint.h:152
char * s
Here is the call graph for this function: