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

Go to the source code of this file.

Functions

float128_t i32_to_f128 (int32_t a)
 

Function Documentation

◆ i32_to_f128()

float128_t i32_to_f128 ( int32_t a)

Definition at line 42 of file i32_to_f128.c.

43{
44 uint_fast64_t uiZ64;
45 bool sign;
46 uint_fast32_t absA;
47 int_fast8_t shiftDist;
48 union ui128_f128 uZ;
49
50 uiZ64 = 0;
51 if ( a ) {
52 sign = (a < 0);
53 absA = sign ? -(uint_fast32_t) a : (uint_fast32_t) a;
54 shiftDist = softfloat_countLeadingZeros32( absA ) + 17;
55 uiZ64 =
56 packToF128UI64(
57 sign, 0x402E - shiftDist, (uint_fast64_t) absA<<shiftDist );
58 }
59 uZ.ui.v64 = uiZ64;
60 uZ.ui.v0 = 0;
61 return uZ.f;
62
63}
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
#define softfloat_countLeadingZeros32
uint64_t uint_fast64_t
Definition stdint.h:157
int8_t int_fast8_t
Definition stdint.h:150
uint32_t uint_fast32_t
Definition stdint.h:156
Here is the caller graph for this function: