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

Go to the source code of this file.

Functions

void i64_to_f128M (int64_t a, float128_t *zPtr)
 

Function Documentation

◆ i64_to_f128M()

void i64_to_f128M ( int64_t a,
float128_t * zPtr )

Definition at line 53 of file i64_to_f128M.c.

54{
55 uint32_t *zWPtr;
56 uint32_t uiZ96, uiZ64;
57 bool sign;
58 uint64_t absA;
59 uint_fast8_t shiftDist;
60 uint32_t *ptr;
61
62 zWPtr = (uint32_t *) zPtr;
63 uiZ96 = 0;
64 uiZ64 = 0;
65 zWPtr[indexWord( 4, 1 )] = 0;
66 zWPtr[indexWord( 4, 0 )] = 0;
67 if ( a ) {
68 sign = (a < 0);
69 absA = sign ? -(uint64_t) a : (uint64_t) a;
70 shiftDist = softfloat_countLeadingZeros64( absA ) + 17;
71 if ( shiftDist < 32 ) {
72 ptr = zWPtr + indexMultiwordHi( 4, 3 );
73 ptr[indexWord( 3, 2 )] = 0;
74 ptr[indexWord( 3, 1 )] = absA>>32;
75 ptr[indexWord( 3, 0 )] = absA;
76 softfloat_shortShiftLeft96M( ptr, shiftDist, ptr );
77 ptr[indexWordHi( 3 )] =
79 sign, 0x404E - shiftDist, ptr[indexWordHi( 3 )] );
80 return;
81 }
82 absA <<= shiftDist - 32;
83 uiZ96 = packToF128UI96( sign, 0x404E - shiftDist, absA>>32 );
84 uiZ64 = absA;
85 }
86 zWPtr[indexWord( 4, 3 )] = uiZ96;
87 zWPtr[indexWord( 4, 2 )] = uiZ64;
88
89}
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
unsigned __int64 uint64_t
Definition stdint.h:136