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

Go to the source code of this file.

Functions

float16_t ui64_to_f16 (uint64_t a)
 

Function Documentation

◆ ui64_to_f16()

float16_t ui64_to_f16 ( uint64_t a)

Definition at line 42 of file ui64_to_f16.c.

43{
44 int_fast8_t shiftDist;
45 union ui16_f16 u;
46 uint_fast16_t sig;
47
48 shiftDist = softfloat_countLeadingZeros64( a ) - 53;
49 if ( 0 <= shiftDist ) {
50 u.ui =
51 a ? packToF16UI(
52 0, 0x18 - shiftDist, (uint_fast16_t) a<<shiftDist )
53 : 0;
54 return u.f;
55 } else {
56 shiftDist += 4;
57 sig =
58 (shiftDist < 0) ? softfloat_shortShiftRightJam64( a, -shiftDist )
59 : (uint_fast16_t) a<<shiftDist;
60 return softfloat_roundPackToF16( 0, 0x1C - shiftDist, sig );
61 }
62
63}
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
float16_t softfloat_roundPackToF16(bool, int_fast16_t, uint_fast16_t)
#define packToF16UI(sign, exp, sig)
Definition internals.h:86
uint64_t softfloat_shortShiftRightJam64(uint64_t a, uint_fast8_t dist)
#define softfloat_countLeadingZeros64
uint16_t uint_fast16_t
Definition stdint.h:155
int8_t int_fast8_t
Definition stdint.h:150
Here is the call graph for this function: