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

Go to the source code of this file.

Functions

float16_t softfloat_normRoundPackToF16 (bool sign, int_fast16_t exp, uint_fast16_t sig)
 

Function Documentation

◆ softfloat_normRoundPackToF16()

float16_t softfloat_normRoundPackToF16 ( bool sign,
int_fast16_t exp,
uint_fast16_t sig )

Definition at line 43 of file s_normRoundPackToF16.c.

44{
45 int_fast8_t shiftDist;
46 union ui16_f16 uZ;
47
48 shiftDist = softfloat_countLeadingZeros16( sig ) - 1;
49 exp -= shiftDist;
50 if ( (4 <= shiftDist) && ((unsigned int) exp < 0x1D) ) {
51 uZ.ui = packToF16UI( sign, sig ? exp : 0, sig<<(shiftDist - 4) );
52 return uZ.f;
53 } else {
54 return softfloat_roundPackToF16( sign, exp, sig<<shiftDist );
55 }
56
57}
float16_t softfloat_roundPackToF16(bool, int_fast16_t, uint_fast16_t)
#define packToF16UI(sign, exp, sig)
Definition internals.h:86
#define softfloat_countLeadingZeros16
int8_t int_fast8_t
Definition stdint.h:150