Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
i64_to_extF80.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include "platform.h"
#include "internals.h"
#include "softfloat.h"
Include dependency graph for i64_to_extF80.c:

Go to the source code of this file.

Functions

extFloat80_t i64_to_extF80 (int64_t a)
 

Function Documentation

◆ i64_to_extF80()

extFloat80_t i64_to_extF80 ( int64_t a)

Definition at line 43 of file i64_to_extF80.c.

44{
45 uint_fast16_t uiZ64;
46 uint_fast64_t absA;
47 bool sign;
48 int_fast8_t shiftDist;
49 union { struct extFloat80M s; extFloat80_t f; } uZ;
50
51 uiZ64 = 0;
52 absA = 0;
53 if ( a ) {
54 sign = (a < 0);
55 absA = sign ? -(uint_fast64_t) a : (uint_fast64_t) a;
56 shiftDist = softfloat_countLeadingZeros64( absA );
57 uiZ64 = packToExtF80UI64( sign, 0x403E - shiftDist );
58 absA <<= shiftDist;
59 }
60 uZ.s.signExp = uiZ64;
61 uZ.s.signif = absA;
62 return uZ.f;
63
64}
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
#define packToExtF80UI64(sign, exp)
Definition internals.h:148
#define softfloat_countLeadingZeros64
uint16_t uint_fast16_t
Definition stdint.h:155
uint64_t uint_fast64_t
Definition stdint.h:157
int8_t int_fast8_t
Definition stdint.h:150
char * s