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

Go to the source code of this file.

Functions

void ui64_to_f128M (uint64_t a, float128_t *zPtr)
 

Function Documentation

◆ ui64_to_f128M()

void ui64_to_f128M ( uint64_t a,
float128_t * zPtr )

Definition at line 53 of file ui64_to_f128M.c.

54{
55 uint32_t *zWPtr, uiZ96, uiZ64;
56 uint_fast8_t shiftDist;
57 uint32_t *ptr;
58
59 zWPtr = (uint32_t *) zPtr;
60 uiZ96 = 0;
61 uiZ64 = 0;
62 zWPtr[indexWord( 4, 1 )] = 0;
63 zWPtr[indexWord( 4, 0 )] = 0;
64 if ( a ) {
65 shiftDist = softfloat_countLeadingZeros64( a ) + 17;
66 if ( shiftDist < 32 ) {
67 ptr = zWPtr + indexMultiwordHi( 4, 3 );
68 ptr[indexWord( 3, 2 )] = 0;
69 ptr[indexWord( 3, 1 )] = a>>32;
70 ptr[indexWord( 3, 0 )] = a;
71 softfloat_shortShiftLeft96M( ptr, shiftDist, ptr );
72 ptr[indexWordHi( 3 )] =
73 packToF128UI96( 0, 0x404E - shiftDist, ptr[indexWordHi( 3 )] );
74 return;
75 }
76 a <<= shiftDist - 32;
77 uiZ96 = packToF128UI96( 0, 0x404E - shiftDist, a>>32 );
78 uiZ64 = a;
79 }
80 zWPtr[indexWord( 4, 3 )] = uiZ96;
81 zWPtr[indexWord( 4, 2 )] = uiZ64;
82
83}
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
#define packToF128UI96(sign, exp, sig96)
Definition internals.h:250
#define indexMultiwordHi(total, n)
#define indexWord(total, n)
#define indexWordHi(total)
#define softfloat_shortShiftLeft96M(aPtr, dist, zPtr)
Definition primitives.h:695
#define softfloat_countLeadingZeros64
unsigned int uint32_t
Definition stdint.h:126
uint8_t uint_fast8_t
Definition stdint.h:154