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

Go to the source code of this file.

Functions

float64_t i32_to_f64 (int32_t a)
 

Function Documentation

◆ i32_to_f64()

float64_t i32_to_f64 ( int32_t a)

Definition at line 43 of file i32_to_f64.c.

44{
45 uint_fast64_t uiZ;
46 bool sign;
47 uint_fast32_t absA;
48 int_fast8_t shiftDist;
49 union ui64_f64 uZ;
50
51 if ( ! a ) {
52 uiZ = 0;
53 } else {
54 sign = (a < 0);
55 absA = sign ? -(uint_fast32_t) a : (uint_fast32_t) a;
56 shiftDist = softfloat_countLeadingZeros32( absA ) + 21;
57 uiZ =
59 sign, 0x432 - shiftDist, (uint_fast64_t) absA<<shiftDist );
60 }
61 uZ.ui = uiZ;
62 return uZ.f;
63
64}
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
#define packToF64UI(sign, exp, sig)
Definition internals.h:128
#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
uint64_t ui
Definition internals.h:47