Numworks Epsilon  1.4.1
Graphing Calculator Operating System
internals.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include "primitives.h"
#include "softfloat_types.h"

Go to the source code of this file.

Classes

union  ui16_f16
 
union  ui32_f32
 
union  ui64_f64
 
struct  exp8_sig16
 
struct  exp16_sig32
 
struct  exp16_sig64
 

Macros

#define signF16UI(a)   ((bool) ((uint16_t) (a)>>15))
 
#define expF16UI(a)   ((int_fast8_t) ((a)>>10) & 0x1F)
 
#define fracF16UI(a)   ((a) & 0x03FF)
 
#define packToF16UI(sign, exp, sig)   (((uint16_t) (sign)<<15) + ((uint16_t) (exp)<<10) + (sig))
 
#define isNaNF16UI(a)   (((~(a) & 0x7C00) == 0) && ((a) & 0x03FF))
 
#define signF32UI(a)   ((bool) ((uint32_t) (a)>>31))
 
#define expF32UI(a)   ((int_fast16_t) ((a)>>23) & 0xFF)
 
#define fracF32UI(a)   ((a) & 0x007FFFFF)
 
#define packToF32UI(sign, exp, sig)   (((uint32_t) (sign)<<31) + ((uint32_t) (exp)<<23) + (sig))
 
#define isNaNF32UI(a)   (((~(a) & 0x7F800000) == 0) && ((a) & 0x007FFFFF))
 
#define signF64UI(a)   ((bool) ((uint64_t) (a)>>63))
 
#define expF64UI(a)   ((int_fast16_t) ((a)>>52) & 0x7FF)
 
#define fracF64UI(a)   ((a) & UINT64_C( 0x000FFFFFFFFFFFFF ))
 
#define packToF64UI(sign, exp, sig)   ((uint64_t) (((uint_fast64_t) (sign)<<63) + ((uint_fast64_t) (exp)<<52) + (sig)))
 
#define isNaNF64UI(a)   (((~(a) & UINT64_C( 0x7FF0000000000000 )) == 0) && ((a) & UINT64_C( 0x000FFFFFFFFFFFFF )))
 
#define signExtF80UI64(a64)   ((bool) ((uint16_t) (a64)>>15))
 
#define expExtF80UI64(a64)   ((a64) & 0x7FFF)
 
#define packToExtF80UI64(sign, exp)   ((uint_fast16_t) (sign)<<15 | (exp))
 
#define isNaNExtF80UI(a64, a0)   ((((a64) & 0x7FFF) == 0x7FFF) && ((a0) & UINT64_C( 0x7FFFFFFFFFFFFFFF )))
 
#define signF128UI96(a96)   ((bool) ((uint32_t) (a96)>>31))
 
#define expF128UI96(a96)   ((int32_t) ((a96)>>16) & 0x7FFF)
 
#define fracF128UI96(a96)   ((a96) & 0x0000FFFF)
 
#define packToF128UI96(sign, exp, sig96)   (((uint32_t) (sign)<<31) + ((uint32_t) (exp)<<16) + (sig96))
 

Enumerations

enum  { softfloat_mulAdd_subC = 1, softfloat_mulAdd_subProd = 2 }
 

Functions

uint_fast32_t softfloat_roundToUI32 (bool, uint_fast64_t, uint_fast8_t, bool)
 
uint_fast64_t softfloat_roundMToUI64 (bool, uint32_t *, uint_fast8_t, bool)
 
int_fast32_t softfloat_roundToI32 (bool, uint_fast64_t, uint_fast8_t, bool)
 
int_fast64_t softfloat_roundMToI64 (bool, uint32_t *, uint_fast8_t, bool)
 
struct exp8_sig16 softfloat_normSubnormalF16Sig (uint_fast16_t)
 
float16_t softfloat_roundPackToF16 (bool, int_fast16_t, uint_fast16_t)
 
float16_t softfloat_normRoundPackToF16 (bool, int_fast16_t, uint_fast16_t)
 
float16_t softfloat_addMagsF16 (uint_fast16_t, uint_fast16_t)
 
float16_t softfloat_subMagsF16 (uint_fast16_t, uint_fast16_t)
 
float16_t softfloat_mulAddF16 (uint_fast16_t, uint_fast16_t, uint_fast16_t, uint_fast8_t)
 
struct exp16_sig32 softfloat_normSubnormalF32Sig (uint_fast32_t)
 
float32_t softfloat_roundPackToF32 (bool, int_fast16_t, uint_fast32_t)
 
float32_t softfloat_normRoundPackToF32 (bool, int_fast16_t, uint_fast32_t)
 
float32_t softfloat_addMagsF32 (uint_fast32_t, uint_fast32_t)
 
float32_t softfloat_subMagsF32 (uint_fast32_t, uint_fast32_t)
 
float32_t softfloat_mulAddF32 (uint_fast32_t, uint_fast32_t, uint_fast32_t, uint_fast8_t)
 
struct exp16_sig64 softfloat_normSubnormalF64Sig (uint_fast64_t)
 
float64_t softfloat_roundPackToF64 (bool, int_fast16_t, uint_fast64_t)
 
float64_t softfloat_normRoundPackToF64 (bool, int_fast16_t, uint_fast64_t)
 
float64_t softfloat_addMagsF64 (uint_fast64_t, uint_fast64_t, bool)
 
float64_t softfloat_subMagsF64 (uint_fast64_t, uint_fast64_t, bool)
 
float64_t softfloat_mulAddF64 (uint_fast64_t, uint_fast64_t, uint_fast64_t, uint_fast8_t)
 
bool softfloat_tryPropagateNaNExtF80M (const struct extFloat80M *, const struct extFloat80M *, struct extFloat80M *)
 
void softfloat_invalidExtF80M (struct extFloat80M *)
 
int softfloat_normExtF80SigM (uint64_t *)
 
void softfloat_roundPackMToExtF80M (bool, int32_t, uint32_t *, uint_fast8_t, struct extFloat80M *)
 
void softfloat_normRoundPackMToExtF80M (bool, int32_t, uint32_t *, uint_fast8_t, struct extFloat80M *)
 
void softfloat_addExtF80M (const struct extFloat80M *, const struct extFloat80M *, struct extFloat80M *, bool)
 
int softfloat_compareNonnormExtF80M (const struct extFloat80M *, const struct extFloat80M *)
 
bool softfloat_isNaNF128M (const uint32_t *)
 
bool softfloat_tryPropagateNaNF128M (const uint32_t *, const uint32_t *, uint32_t *)
 
void softfloat_invalidF128M (uint32_t *)
 
int softfloat_shiftNormSigF128M (const uint32_t *, uint_fast8_t, uint32_t *)
 
void softfloat_roundPackMToF128M (bool, int32_t, uint32_t *, uint32_t *)
 
void softfloat_normRoundPackMToF128M (bool, int32_t, uint32_t *, uint32_t *)
 
void softfloat_addF128M (const uint32_t *, const uint32_t *, uint32_t *, bool)
 
void softfloat_mulAddF128M (const uint32_t *, const uint32_t *, const uint32_t *, uint32_t *, uint_fast8_t)
 

Macro Definition Documentation

◆ expExtF80UI64

#define expExtF80UI64 (   a64)    ((a64) & 0x7FFF)

Definition at line 147 of file internals.h.

◆ expF128UI96

#define expF128UI96 (   a96)    ((int32_t) ((a96)>>16) & 0x7FFF)

Definition at line 248 of file internals.h.

◆ expF16UI

#define expF16UI (   a)    ((int_fast8_t) ((a)>>10) & 0x1F)

Definition at line 84 of file internals.h.

◆ expF32UI

#define expF32UI (   a)    ((int_fast16_t) ((a)>>23) & 0xFF)

Definition at line 105 of file internals.h.

◆ expF64UI

#define expF64UI (   a)    ((int_fast16_t) ((a)>>52) & 0x7FF)

Definition at line 126 of file internals.h.

◆ fracF128UI96

#define fracF128UI96 (   a96)    ((a96) & 0x0000FFFF)

Definition at line 249 of file internals.h.

◆ fracF16UI

#define fracF16UI (   a)    ((a) & 0x03FF)

Definition at line 85 of file internals.h.

◆ fracF32UI

#define fracF32UI (   a)    ((a) & 0x007FFFFF)

Definition at line 106 of file internals.h.

◆ fracF64UI

#define fracF64UI (   a)    ((a) & UINT64_C( 0x000FFFFFFFFFFFFF ))

Definition at line 127 of file internals.h.

◆ isNaNExtF80UI

#define isNaNExtF80UI (   a64,
  a0 
)    ((((a64) & 0x7FFF) == 0x7FFF) && ((a0) & UINT64_C( 0x7FFFFFFFFFFFFFFF )))

Definition at line 150 of file internals.h.

◆ isNaNF16UI

#define isNaNF16UI (   a)    (((~(a) & 0x7C00) == 0) && ((a) & 0x03FF))

Definition at line 88 of file internals.h.

◆ isNaNF32UI

#define isNaNF32UI (   a)    (((~(a) & 0x7F800000) == 0) && ((a) & 0x007FFFFF))

Definition at line 109 of file internals.h.

◆ isNaNF64UI

#define isNaNF64UI (   a)    (((~(a) & UINT64_C( 0x7FF0000000000000 )) == 0) && ((a) & UINT64_C( 0x000FFFFFFFFFFFFF )))

Definition at line 130 of file internals.h.

◆ packToExtF80UI64

#define packToExtF80UI64 (   sign,
  exp 
)    ((uint_fast16_t) (sign)<<15 | (exp))

Definition at line 148 of file internals.h.

◆ packToF128UI96

#define packToF128UI96 (   sign,
  exp,
  sig96 
)    (((uint32_t) (sign)<<31) + ((uint32_t) (exp)<<16) + (sig96))

Definition at line 250 of file internals.h.

◆ packToF16UI

#define packToF16UI (   sign,
  exp,
  sig 
)    (((uint16_t) (sign)<<15) + ((uint16_t) (exp)<<10) + (sig))

Definition at line 86 of file internals.h.

◆ packToF32UI

#define packToF32UI (   sign,
  exp,
  sig 
)    (((uint32_t) (sign)<<31) + ((uint32_t) (exp)<<23) + (sig))

Definition at line 107 of file internals.h.

◆ packToF64UI

#define packToF64UI (   sign,
  exp,
  sig 
)    ((uint64_t) (((uint_fast64_t) (sign)<<63) + ((uint_fast64_t) (exp)<<52) + (sig)))

Definition at line 128 of file internals.h.

◆ signExtF80UI64

#define signExtF80UI64 (   a64)    ((bool) ((uint16_t) (a64)>>15))

Definition at line 146 of file internals.h.

◆ signF128UI96

#define signF128UI96 (   a96)    ((bool) ((uint32_t) (a96)>>31))

Definition at line 247 of file internals.h.

◆ signF16UI

#define signF16UI (   a)    ((bool) ((uint16_t) (a)>>15))

Definition at line 83 of file internals.h.

◆ signF32UI

#define signF32UI (   a)    ((bool) ((uint32_t) (a)>>31))

Definition at line 104 of file internals.h.

◆ signF64UI

#define signF64UI (   a)    ((bool) ((uint64_t) (a)>>63))

Definition at line 125 of file internals.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
softfloat_mulAdd_subC 
softfloat_mulAdd_subProd 

Definition at line 54 of file internals.h.

Function Documentation

◆ softfloat_addExtF80M()

void softfloat_addExtF80M ( const struct extFloat80M ,
const struct extFloat80M ,
struct extFloat80M ,
bool   
)

◆ softfloat_addF128M()

void softfloat_addF128M ( const uint32_t ,
const uint32_t ,
uint32_t ,
bool   
)

◆ softfloat_addMagsF16()

float16_t softfloat_addMagsF16 ( uint_fast16_t  ,
uint_fast16_t   
)

◆ softfloat_addMagsF32()

float32_t softfloat_addMagsF32 ( uint_fast32_t  ,
uint_fast32_t   
)

◆ softfloat_addMagsF64()

float64_t softfloat_addMagsF64 ( uint_fast64_t  ,
uint_fast64_t  ,
bool   
)

Definition at line 44 of file s_addMagsF64.c.

◆ softfloat_compareNonnormExtF80M()

int softfloat_compareNonnormExtF80M ( const struct extFloat80M ,
const struct extFloat80M  
)

◆ softfloat_invalidExtF80M()

void softfloat_invalidExtF80M ( struct extFloat80M )

◆ softfloat_invalidF128M()

void softfloat_invalidF128M ( uint32_t )

◆ softfloat_isNaNF128M()

bool softfloat_isNaNF128M ( const uint32_t )

◆ softfloat_mulAddF128M()

void softfloat_mulAddF128M ( const uint32_t ,
const uint32_t ,
const uint32_t ,
uint32_t ,
uint_fast8_t   
)

◆ softfloat_mulAddF16()

float16_t softfloat_mulAddF16 ( uint_fast16_t  ,
uint_fast16_t  ,
uint_fast16_t  ,
uint_fast8_t   
)

◆ softfloat_mulAddF32()

float32_t softfloat_mulAddF32 ( uint_fast32_t  ,
uint_fast32_t  ,
uint_fast32_t  ,
uint_fast8_t   
)

◆ softfloat_mulAddF64()

float64_t softfloat_mulAddF64 ( uint_fast64_t  ,
uint_fast64_t  ,
uint_fast64_t  ,
uint_fast8_t   
)

◆ softfloat_normExtF80SigM()

int softfloat_normExtF80SigM ( uint64_t )

◆ softfloat_normRoundPackMToExtF80M()

void softfloat_normRoundPackMToExtF80M ( bool  ,
int32_t  ,
uint32_t ,
uint_fast8_t  ,
struct extFloat80M  
)

◆ softfloat_normRoundPackMToF128M()

void softfloat_normRoundPackMToF128M ( bool  ,
int32_t  ,
uint32_t ,
uint32_t  
)

◆ softfloat_normRoundPackToF16()

float16_t softfloat_normRoundPackToF16 ( bool  ,
int_fast16_t  ,
uint_fast16_t   
)

◆ softfloat_normRoundPackToF32()

float32_t softfloat_normRoundPackToF32 ( bool  ,
int_fast16_t  ,
uint_fast32_t   
)

◆ softfloat_normRoundPackToF64()

float64_t softfloat_normRoundPackToF64 ( bool  ,
int_fast16_t  ,
uint_fast64_t   
)

Definition at line 43 of file s_normRoundPackToF64.c.

◆ softfloat_normSubnormalF16Sig()

struct exp8_sig16 softfloat_normSubnormalF16Sig ( uint_fast16_t  )

◆ softfloat_normSubnormalF32Sig()

struct exp16_sig32 softfloat_normSubnormalF32Sig ( uint_fast32_t  )

Definition at line 41 of file s_normSubnormalF32Sig.c.

◆ softfloat_normSubnormalF64Sig()

struct exp16_sig64 softfloat_normSubnormalF64Sig ( uint_fast64_t  )

Definition at line 41 of file s_normSubnormalF64Sig.c.

◆ softfloat_roundMToI64()

int_fast64_t softfloat_roundMToI64 ( bool  ,
uint32_t ,
uint_fast8_t  ,
bool   
)

◆ softfloat_roundMToUI64()

uint_fast64_t softfloat_roundMToUI64 ( bool  ,
uint32_t ,
uint_fast8_t  ,
bool   
)

◆ softfloat_roundPackMToExtF80M()

void softfloat_roundPackMToExtF80M ( bool  ,
int32_t  ,
uint32_t ,
uint_fast8_t  ,
struct extFloat80M  
)

◆ softfloat_roundPackMToF128M()

void softfloat_roundPackMToF128M ( bool  ,
int32_t  ,
uint32_t ,
uint32_t  
)

◆ softfloat_roundPackToF16()

float16_t softfloat_roundPackToF16 ( bool  ,
int_fast16_t  ,
uint_fast16_t   
)

◆ softfloat_roundPackToF32()

float32_t softfloat_roundPackToF32 ( bool  ,
int_fast16_t  ,
uint_fast32_t   
)

Definition at line 44 of file s_roundPackToF32.c.

◆ softfloat_roundPackToF64()

float64_t softfloat_roundPackToF64 ( bool  ,
int_fast16_t  ,
uint_fast64_t   
)

Definition at line 44 of file s_roundPackToF64.c.

◆ softfloat_roundToI32()

int_fast32_t softfloat_roundToI32 ( bool  ,
uint_fast64_t  ,
uint_fast8_t  ,
bool   
)

◆ softfloat_roundToUI32()

uint_fast32_t softfloat_roundToUI32 ( bool  ,
uint_fast64_t  ,
uint_fast8_t  ,
bool   
)

◆ softfloat_shiftNormSigF128M()

int softfloat_shiftNormSigF128M ( const uint32_t ,
uint_fast8_t  ,
uint32_t  
)

◆ softfloat_subMagsF16()

float16_t softfloat_subMagsF16 ( uint_fast16_t  ,
uint_fast16_t   
)

◆ softfloat_subMagsF32()

float32_t softfloat_subMagsF32 ( uint_fast32_t  ,
uint_fast32_t   
)

◆ softfloat_subMagsF64()

float64_t softfloat_subMagsF64 ( uint_fast64_t  ,
uint_fast64_t  ,
bool   
)

Definition at line 45 of file s_subMagsF64.c.

◆ softfloat_tryPropagateNaNExtF80M()

bool softfloat_tryPropagateNaNExtF80M ( const struct extFloat80M ,
const struct extFloat80M ,
struct extFloat80M  
)

◆ softfloat_tryPropagateNaNF128M()

bool softfloat_tryPropagateNaNF128M ( const uint32_t ,
const uint32_t ,
uint32_t  
)