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

Go to the source code of this file.

Functions

int_fast64_t extF80_to_i64_r_minMag (extFloat80_t a, bool exact)
 

Function Documentation

◆ extF80_to_i64_r_minMag()

int_fast64_t extF80_to_i64_r_minMag ( extFloat80_t a,
bool exact )

Definition at line 44 of file extF80_to_i64_r_minMag.c.

45{
46 union { struct extFloat80M s; extFloat80_t f; } uA;
47 uint_fast16_t uiA64;
48 int_fast32_t exp;
49 uint_fast64_t sig;
50 int_fast32_t shiftDist;
51 bool sign;
52 int_fast64_t absZ;
53
54 /*------------------------------------------------------------------------
55 *------------------------------------------------------------------------*/
56 uA.f = a;
57 uiA64 = uA.s.signExp;
58 exp = expExtF80UI64( uiA64 );
59 sig = uA.s.signif;
60 /*------------------------------------------------------------------------
61 *------------------------------------------------------------------------*/
62 shiftDist = 0x403E - exp;
63 if ( 64 <= shiftDist ) {
64 if ( exact && (exp | sig) ) {
66 }
67 return 0;
68 }
69 /*------------------------------------------------------------------------
70 *------------------------------------------------------------------------*/
71 sign = signExtF80UI64( uiA64 );
72 if ( shiftDist <= 0 ) {
73 if (
74 (uiA64 == packToExtF80UI64( 1, 0x403E ))
75 && (sig == UINT64_C( 0x8000000000000000 ))
76 ) {
77 return -INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1;
78 }
80 return
81 (exp == 0x7FFF) && (sig & UINT64_C( 0x7FFFFFFFFFFFFFFF ))
84 }
85 /*------------------------------------------------------------------------
86 *------------------------------------------------------------------------*/
87 absZ = sig>>shiftDist;
88 if ( exact && (uint64_t) (sig<<(-shiftDist & 63)) ) {
90 }
91 return sign ? -absZ : absZ;
92
93}
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
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 packToExtF80UI64(sign, exp)
Definition internals.h:148
#define expExtF80UI64(a64)
Definition internals.h:147
#define signExtF80UI64(a64)
Definition internals.h:146
@ softfloat_flag_invalid
Definition softfloat.h:89
@ softfloat_flag_inexact
Definition softfloat.h:85
THREAD_LOCAL uint_fast8_t softfloat_exceptionFlags
#define INT64_C(val)
Definition stdint.h:279
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
unsigned __int64 uint64_t
Definition stdint.h:136
int64_t int_fast64_t
Definition stdint.h:153
char * s
Here is the call graph for this function: