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

Go to the source code of this file.

Functions

float128_t ui64_to_f128 (uint64_t a)
 

Function Documentation

◆ ui64_to_f128()

float128_t ui64_to_f128 ( uint64_t a)

Definition at line 42 of file ui64_to_f128.c.

43{
44 uint_fast64_t uiZ64, uiZ0;
45 int_fast8_t shiftDist;
46 struct uint128 zSig;
47 union ui128_f128 uZ;
48
49 if ( ! a ) {
50 uiZ64 = 0;
51 uiZ0 = 0;
52 } else {
53 shiftDist = softfloat_countLeadingZeros64( a ) + 49;
54 if ( 64 <= shiftDist ) {
55 zSig.v64 = a<<(shiftDist - 64);
56 zSig.v0 = 0;
57 } else {
58 zSig = softfloat_shortShiftLeft128( 0, a, shiftDist );
59 }
60 uiZ64 = packToF128UI64( 0, 0x406E - shiftDist, zSig.v64 );
61 uiZ0 = zSig.v0;
62 }
63 uZ.ui.v64 = uiZ64;
64 uZ.ui.v0 = uiZ0;
65 return uZ.f;
66
67}
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
#define softfloat_countLeadingZeros64
struct uint128 softfloat_shortShiftLeft128(uint64_t a64, uint64_t a0, uint_fast8_t dist)
uint64_t uint_fast64_t
Definition stdint.h:157
int8_t int_fast8_t
Definition stdint.h:150