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

Go to the source code of this file.

Functions

void i32_to_f128M (int32_t a, float128_t *zPtr)
 

Function Documentation

◆ i32_to_f128M()

void i32_to_f128M ( int32_t a,
float128_t * zPtr )

Definition at line 53 of file i32_to_f128M.c.

54{
55 uint32_t *zWPtr;
56 uint32_t uiZ96, uiZ64;
57 bool sign;
58 uint32_t absA;
59 int_fast8_t shiftDist;
60 uint64_t normAbsA;
61
62 zWPtr = (uint32_t *) zPtr;
63 uiZ96 = 0;
64 uiZ64 = 0;
65 if ( a ) {
66 sign = (a < 0);
67 absA = sign ? -(uint32_t) a : (uint32_t) a;
68 shiftDist = softfloat_countLeadingZeros32( absA ) + 17;
69 normAbsA = (uint64_t) absA<<shiftDist;
70 uiZ96 = packToF128UI96( sign, 0x402E - shiftDist, normAbsA>>32 );
71 uiZ64 = normAbsA;
72 }
73 zWPtr[indexWord( 4, 3 )] = uiZ96;
74 zWPtr[indexWord( 4, 2 )] = uiZ64;
75 zWPtr[indexWord( 4, 1 )] = 0;
76 zWPtr[indexWord( 4, 0 )] = 0;
77
78}
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
#define packToF128UI96(sign, exp, sig96)
Definition internals.h:250
#define indexWord(total, n)
#define softfloat_countLeadingZeros32
unsigned int uint32_t
Definition stdint.h:126
int8_t int_fast8_t
Definition stdint.h:150
unsigned __int64 uint64_t
Definition stdint.h:136