spinn_common 7.3.1
Support code for SpiNNaker applications.
Loading...
Searching...
No Matches
Macros | Functions
round.h File Reference

Fixed-point multiplication with controlled rounding. More...

#include <stdfix-full-iso.h>
#include <random.h>
#include <sark.h>
#include "utils.h"
#include <stdfix.h>

Go to the source code of this file.

Macros

#define RANDOM()   sark_rand()
 
#define ROUNDING_STOCHASTIC
 The rounding mode of all multiplications.
 
High-level interface macros

Set up various multiplication macros depending on the rounding method chosen above. These are the highest level of macros that the users should use.

FX_MUL returns an s1615, FX_MUL_SHORT_ACCUM returns an s87, FX_MUL_FRACT32 returns an s031, and FX_MUL_FRACT16 returns an s015.

#define FX_MUL(x, y)   MULT_ROUND_STOCHASTIC_ACCUM(x, y)
 Multiply two s1615 values with rounding.
 
#define FX_MUL_SHORT_ACCUM(x, y)   MULT_ROUND_STOCHASTIC_SHORT_ACCUM(x, y)
 Multiply two s87 values with rounding.
 
#define FX_MUL_FRACT32(x, y)   MULT_ROUND_STOCHASTIC_FRACT32(x, y)
 Multiply two s031 values with rounding.
 
#define FX_MUL_FRACT16(x, y)   MULT_ROUND_STOCHASTIC_FRACT16(x, y)
 Multiply two s015 values with rounding.
 
Low-level interface macros

The following macros choose a correct multiplication function depending on the types of arguments.

#define MULT_NO_ROUND_GCC(x, y)
 Multiply with whatever the compiler deigns to pick for us.
 
#define MULT_NO_ROUND_CUSTOM_ACCUM(x, y)
 Multiply fixed point numbers to make s1615; no rounding.
 
#define MULT_NO_ROUND_CUSTOM_SHORT_ACCUM(x, y)
 Multiply fixed point numbers to make s87; no rounding.
 
#define MULT_NO_ROUND_CUSTOM_FRACT32(x, y)
 Multiply fixed point numbers to make s031; no rounding.
 
#define MULT_NO_ROUND_CUSTOM_FRACT16(x, y)
 Multiply fixed point numbers to make s015; no rounding.
 
#define MULT_ROUND_NEAREST_ACCUM(x, y)
 Multiply fixed point numbers to make s1615; round to nearest.
 
#define MULT_ROUND_NEAREST_SHORT_ACCUM(x, y)
 Multiply fixed point numbers to make s87; round to nearest.
 
#define MULT_ROUND_NEAREST_FRACT32(x, y)
 Multiply fixed point numbers to make s031; round to nearest.
 
#define MULT_ROUND_NEAREST_FRACT16(x, y)
 Multiply fixed point numbers to make s015; round to nearest.
 
#define MULT_ROUND_STOCHASTIC_ACCUM(x, y)
 Multiply fixed point numbers to make s1615; stochastic rounding.
 
#define MULT_ROUND_STOCHASTIC_SHORT_ACCUM(x, y)
 Multiply fixed point numbers to make s87; stochastic rounding.
 
#define MULT_ROUND_STOCHASTIC_FRACT32(x, y)
 Multiply fixed point numbers to make s031; stochastic rounding.
 
#define MULT_ROUND_STOCHASTIC_FRACT16(x, y)
 Multiply fixed point numbers to make s015; stochastic rounding.
 
High-level rounding macros
#define STOCHASTIC_ROUND_S64(x, n)
 Round a signed 64-bit number stochastically to a given number of bits and return a 32-bit integer.
 
#define STOCHASTIC_ROUND_U64(x, n)
 Round an unsigned 64-bit number stochastically to a given number of bits and return a 32-bit integer.
 
#define NEAREST_ROUND_S64(x, n)
 Round a signed 64-bit number to a nearest given number of bits and return a 32-bit integer.
 
#define NEAREST_ROUND_U64(x, n)
 Round an unsigned 64-bit number to a nearest given number of bits and return a 32-bit integer.
 
#define ROUND_DOWN_S64(x, n)
 Round a 64-bit number down on a given number of bits and return a 32-bit integer.
 

Functions

static uint32_t cheap_generator (void)
 Cheap PRNG from "Numerical Recipes in C", page 284.
 
Stochastic rounding routines.

Inputs are signed/unsigned integers of various lengths and the number of bits to round. The output is the rounded integer number.

static int64_t __stdfix_stochastic_round_s64 (int64_t x, int n)
 Stochastic rounding: signed 64-bit.
 
static int64_t __stdfix_stochastic_round_s64_alternative (int64_t x, int n)
 Alternative algorithm for __stdfix_stochastic_round_s64().
 
static int32_t __stdfix_stochastic_round_s32 (int32_t x, int n)
 Stochastic rounding: signed 32-bit.
 
static int16_t __stdfix_stochastic_round_s16 (int16_t x, int n)
 Stochastic rounding: signed 16-bit.
 
static uint64_t __stdfix_stochastic_round_u64 (uint64_t x, int n)
 Stochastic rounding: unsigned 64-bit.
 
static uint32_t __stdfix_stochastic_round_u32 (uint32_t x, int n)
 Stochastic rounding: unsigned 32-bit.
 
static uint16_t __stdfix_stochastic_round_u16 (uint16_t x, int n)
 Stochastic rounding: unsigned 16-bit.
 
32-bit multiplication routines with rounding.
static int32_t __stdfix_smul_k_round_nearest (int32_t x, int32_t y)
 Multiply two integer representations of s1615 and return an integer representation of an s1615 answer, rounded to the nearest s1615.
 
static int32_t __stdfix_smul_k_round_stochastic (int32_t x, int32_t y)
 Multiply two integer representations of s1615 and return an integer representation of an s1615 answer, rounded to a neighbouring s1615 stochastically.
 
static uint32_t __stdfix_smul_ulr_round_nearest (uint32_t x, uint32_t y)
 Multiply two integer representations of u032 and return an integer representation of an s031 answer, rounded to the nearest s1615.
 
static uint32_t __stdfix_smul_ulr_round_stochastic (uint32_t x, uint32_t y)
 Multiply two integer representations of u032 and return an integer representation of an s031 answer, rounded to a neighbouring s031 stochastically.
 
16-bit multiplications.
static int32_t __stdfix_smul_hk_round_nearest (int32_t x, int32_t y)
 Multiply two integer representations of s87 and return an integer representation of an s87 answer, rounded to the nearest s87.
 
static int32_t __stdfix_smul_hk_round_stochastic (int32_t x, int32_t y)
 Multiply two integer representations of s87 and return an integer representation of an s87 answer, rounded to a neighbouring s87 stochastically.
 
static uint32_t __stdfix_smul_ur_round_nearest (uint32_t x, uint32_t y)
 Multiply two integer representations of u016 and return an integer representation of an s015 answer, rounded to the nearest s015.
 
static uint32_t __stdfix_smul_ur_round_stochastic (uint32_t x, uint32_t y)
 Multiply two integer representations of u016 and return an integer representation of an s015 answer, rounded to a neighbouring s015 stochastically.
 
Mixed format multiplications

The following functions do mixed format multiplications. Most of them are reworked from Dave Lester's original implementation accum_times_long_fract() and so have a different format than a set of functions above.

Todo:
Make these functions take integer representations and use the naming conventions to be consistent with the functions above and in stdfix-full-iso.h
static s1615 accum_times_long_fract (s1615 x, s031 y)
 Multiply an s1615 and an s031 and return an s1615 answer, without rounding.
 
static s1615 accum_times_long_fract_nearest (s1615 x, s031 y)
 Multiply an s1615 and an s031 and return an s1615 answer rounded to the nearest s1615.
 
static s1615 accum_times_long_fract_stochastic (s1615 x, s031 y)
 Multiply s1615 and an s031 and return an s1615 answer rounded to a neighbouring s1615 stochastically.
 
static s1615 accum_times_u_long_fract (s1615 x, u032 y)
 Multiply s1615 and an u032 and return an s1615 answer, without rounding.
 
static s1615 accum_times_u_long_fract_nearest (s1615 x, u032 y)
 Multiply s1615 and an u032 and return an s1615 answer rounded to the nearest s1615.
 
static s1615 accum_times_u_long_fract_stochastic (s1615 x, u032 y)
 Multiply s1615 and an u032 and return an s1615 answer rounded to a neighbouring s1615 stochastically.
 
static s031 long_fract_times_u_long_fract (s031 x, u032 y)
 Multiply an s031 and an u032 and return a s031 answer, without rounding.
 
static s031 long_fract_times_u_long_fract_nearest (s031 x, u032 y)
 Multiply an s031 and an u032 and return a s031 answer rounded to the nearest s031.
 
static s031 long_fract_times_u_long_fract_stochastic (s031 x, u032 y)
 Multiply an s031 and an u032 and return a s031 answer rounded to a neighbouring s031 stochastically.
 
static s87 short_accum_times_fract (s87 x, s015 y)
 Multiply two s87 numbers and return an s87 answer without rounding.
 
static s87 short_accum_times_fract_nearest (s87 x, s015 y)
 Multiply two s87 values and return an s87 answer rounded to the nearest s87.
 
static s87 short_accum_times_fract_stochastic (s87 x, s015 y)
 Multiply two s87 values and return an s87 answer rounded to a neighbouring s87 stochastically.
 
static s87 short_accum_times_u_fract (s87 x, u016 y)
 Multiply an s87 and an u016 and return an s87 answer without rounding.
 
static s87 short_accum_times_u_fract_nearest (s87 x, u016 y)
 Multiply an s87 and an u016 and return an s87 answer rounded to the nearest s87.
 
static s87 short_accum_times_u_fract_stochastic (s87 x, u016 y)
 Multiply an s87 and an u016 and return an s87 answer rounded to a neighbouring s87 stochastically.
 
static s015 fract_times_u_fract (s015 x, u016 y)
 Multiply an u016 and an s015 and return an s015 answer without rounding.
 
static s015 fract_times_u_fract_nearest (s015 x, u016 y)
 Multiply an u016 and an s015 and return an s015 answer rounded to the nearest s015.
 
static s015 fract_times_u_fract_stochastic (s015 x, u016 y)
 Multiply an u016 and an s015 and return an s015 answer with stochastic rounding.
 

Detailed Description

Fixed-point multiplication with controlled rounding.

This file complements stdfix-full-iso.h to add various rounding routines and mixed-format fixed-point multiplication routines.

Note that GCC currently does not implement rounding on such operations like fixed-point multiplication and conversion (e.g. decimal to fixed-point). Some more background in https://arxiv.org/abs/1904.11263

Author
manta.nosp@m.s.mi.nosp@m.kaiti.nosp@m.s@ma.nosp@m.nches.nosp@m.ter..nosp@m.ac.uk
Date
2019 August.

Macro Definition Documentation

◆ RANDOM

#define RANDOM ( )    sark_rand()

Choose random number generator that is used for the multiplications with stochastic rounding

◆ MULT_NO_ROUND_GCC

#define MULT_NO_ROUND_GCC (   x,
  y 
)

Multiply with whatever the compiler deigns to pick for us.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ MULT_NO_ROUND_CUSTOM_ACCUM

#define MULT_NO_ROUND_CUSTOM_ACCUM (   x,
  y 
)

Multiply fixed point numbers to make s1615; no rounding.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ MULT_NO_ROUND_CUSTOM_SHORT_ACCUM

#define MULT_NO_ROUND_CUSTOM_SHORT_ACCUM (   x,
  y 
)

Multiply fixed point numbers to make s87; no rounding.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ MULT_NO_ROUND_CUSTOM_FRACT32

#define MULT_NO_ROUND_CUSTOM_FRACT32 (   x,
  y 
)

Multiply fixed point numbers to make s031; no rounding.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ MULT_NO_ROUND_CUSTOM_FRACT16

#define MULT_NO_ROUND_CUSTOM_FRACT16 (   x,
  y 
)

Multiply fixed point numbers to make s015; no rounding.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ MULT_ROUND_NEAREST_ACCUM

#define MULT_ROUND_NEAREST_ACCUM (   x,
  y 
)

Multiply fixed point numbers to make s1615; round to nearest.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ MULT_ROUND_NEAREST_SHORT_ACCUM

#define MULT_ROUND_NEAREST_SHORT_ACCUM (   x,
  y 
)

Multiply fixed point numbers to make s87; round to nearest.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ MULT_ROUND_NEAREST_FRACT32

#define MULT_ROUND_NEAREST_FRACT32 (   x,
  y 
)

Multiply fixed point numbers to make s031; round to nearest.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ MULT_ROUND_NEAREST_FRACT16

#define MULT_ROUND_NEAREST_FRACT16 (   x,
  y 
)

Multiply fixed point numbers to make s015; round to nearest.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ MULT_ROUND_STOCHASTIC_ACCUM

#define MULT_ROUND_STOCHASTIC_ACCUM (   x,
  y 
)

Multiply fixed point numbers to make s1615; stochastic rounding.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ MULT_ROUND_STOCHASTIC_SHORT_ACCUM

#define MULT_ROUND_STOCHASTIC_SHORT_ACCUM (   x,
  y 
)

Multiply fixed point numbers to make s87; stochastic rounding.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ MULT_ROUND_STOCHASTIC_FRACT32

#define MULT_ROUND_STOCHASTIC_FRACT32 (   x,
  y 
)

Multiply fixed point numbers to make s031; stochastic rounding.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ MULT_ROUND_STOCHASTIC_FRACT16

#define MULT_ROUND_STOCHASTIC_FRACT16 (   x,
  y 
)

Multiply fixed point numbers to make s015; stochastic rounding.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ STOCHASTIC_ROUND_S64

#define STOCHASTIC_ROUND_S64 (   x,
 
)

Round a signed 64-bit number stochastically to a given number of bits and return a 32-bit integer.

Parameters
[in]xThe value to have rounding applied to it.
[in]nThe number of least-significant bits to remove via rounding. For efficiency, should be a constant.
Returns
The rounded value

◆ STOCHASTIC_ROUND_U64

#define STOCHASTIC_ROUND_U64 (   x,
 
)

Round an unsigned 64-bit number stochastically to a given number of bits and return a 32-bit integer.

Parameters
[in]xThe value to have rounding applied to it.
[in]nThe number of least-significant bits to remove via rounding. For efficiency, should be a constant.
Returns
The rounded value

◆ NEAREST_ROUND_S64

#define NEAREST_ROUND_S64 (   x,
 
)

Round a signed 64-bit number to a nearest given number of bits and return a 32-bit integer.

Parameters
[in]xThe value to have rounding applied to it.
[in]nThe number of least-significant bits to remove via rounding. For efficiency, should be a constant.
Returns
The rounded value

◆ NEAREST_ROUND_U64

#define NEAREST_ROUND_U64 (   x,
 
)

Round an unsigned 64-bit number to a nearest given number of bits and return a 32-bit integer.

Parameters
[in]xThe value to have rounding applied to it.
[in]nThe number of least-significant bits to remove via rounding. For efficiency, should be a constant.
Returns
The rounded value

◆ ROUND_DOWN_S64

#define ROUND_DOWN_S64 (   x,
 
)

Round a 64-bit number down on a given number of bits and return a 32-bit integer.

Parameters
[in]xThe value to have rounding applied to it.
[in]nThe number of least-significant bits to remove via rounding. For efficiency, should be a constant.
Returns
The rounded value

Function Documentation

◆ cheap_generator()

static uint32_t cheap_generator ( void  )
inlinestatic

Cheap PRNG from "Numerical Recipes in C", page 284.

Returns
A random number
Warning
Use of this function is not advised.

◆ __stdfix_stochastic_round_s64()

static int64_t __stdfix_stochastic_round_s64 ( int64_t  x,
int  n 
)
static

Stochastic rounding: signed 64-bit.

Parameters
[in]xThe value to have rounding applied to it.
[in]nThe number of least-significant bits to remove via rounding. For efficiency, should be a constant.
Returns
The rounded value

◆ __stdfix_stochastic_round_s64_alternative()

static int64_t __stdfix_stochastic_round_s64_alternative ( int64_t  x,
int  n 
)
static

Alternative algorithm for __stdfix_stochastic_round_s64().

Parameters
[in]xThe value to have rounding applied to it.
[in]nThe number of least-significant bits to remove via rounding. For efficiency, should be a constant.
Returns
The rounded value

◆ __stdfix_stochastic_round_s32()

static int32_t __stdfix_stochastic_round_s32 ( int32_t  x,
int  n 
)
inlinestatic

Stochastic rounding: signed 32-bit.

Parameters
[in]xThe value to have rounding applied to it.
[in]nThe number of least-significant bits to remove via rounding. For efficiency, should be a constant.
Returns
The rounded value

◆ __stdfix_stochastic_round_s16()

static int16_t __stdfix_stochastic_round_s16 ( int16_t  x,
int  n 
)
inlinestatic

Stochastic rounding: signed 16-bit.

Parameters
[in]xThe value to have rounding applied to it.
[in]nThe number of least-significant bits to remove via rounding. For efficiency, should be a constant.
Returns
The rounded value

◆ __stdfix_stochastic_round_u64()

static uint64_t __stdfix_stochastic_round_u64 ( uint64_t  x,
int  n 
)
inlinestatic

Stochastic rounding: unsigned 64-bit.

Parameters
[in]xThe value to have rounding applied to it.
[in]nThe number of least-significant bits to remove via rounding. For efficiency, should be a constant.
Returns
The rounded value

◆ __stdfix_stochastic_round_u32()

static uint32_t __stdfix_stochastic_round_u32 ( uint32_t  x,
int  n 
)
inlinestatic

Stochastic rounding: unsigned 32-bit.

Parameters
[in]xThe value to have rounding applied to it.
[in]nThe number of least-significant bits to remove via rounding. For efficiency, should be a constant.
Returns
The rounded value

◆ __stdfix_stochastic_round_u16()

static uint16_t __stdfix_stochastic_round_u16 ( uint16_t  x,
int  n 
)
inlinestatic

Stochastic rounding: unsigned 16-bit.

Parameters
[in]xThe value to have rounding applied to it.
[in]nThe number of least-significant bits to remove via rounding. For efficiency, should be a constant.
Returns
The rounded value

◆ __stdfix_smul_k_round_nearest()

static int32_t __stdfix_smul_k_round_nearest ( int32_t  x,
int32_t  y 
)
inlinestatic

Multiply two integer representations of s1615 and return an integer representation of an s1615 answer, rounded to the nearest s1615.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ __stdfix_smul_k_round_stochastic()

static int32_t __stdfix_smul_k_round_stochastic ( int32_t  x,
int32_t  y 
)
inlinestatic

Multiply two integer representations of s1615 and return an integer representation of an s1615 answer, rounded to a neighbouring s1615 stochastically.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ __stdfix_smul_ulr_round_nearest()

static uint32_t __stdfix_smul_ulr_round_nearest ( uint32_t  x,
uint32_t  y 
)
inlinestatic

Multiply two integer representations of u032 and return an integer representation of an s031 answer, rounded to the nearest s1615.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ __stdfix_smul_ulr_round_stochastic()

static uint32_t __stdfix_smul_ulr_round_stochastic ( uint32_t  x,
uint32_t  y 
)
inlinestatic

Multiply two integer representations of u032 and return an integer representation of an s031 answer, rounded to a neighbouring s031 stochastically.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ __stdfix_smul_hk_round_nearest()

static int32_t __stdfix_smul_hk_round_nearest ( int32_t  x,
int32_t  y 
)
inlinestatic

Multiply two integer representations of s87 and return an integer representation of an s87 answer, rounded to the nearest s87.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ __stdfix_smul_hk_round_stochastic()

static int32_t __stdfix_smul_hk_round_stochastic ( int32_t  x,
int32_t  y 
)
inlinestatic

Multiply two integer representations of s87 and return an integer representation of an s87 answer, rounded to a neighbouring s87 stochastically.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ __stdfix_smul_ur_round_nearest()

static uint32_t __stdfix_smul_ur_round_nearest ( uint32_t  x,
uint32_t  y 
)
inlinestatic

Multiply two integer representations of u016 and return an integer representation of an s015 answer, rounded to the nearest s015.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ __stdfix_smul_ur_round_stochastic()

static uint32_t __stdfix_smul_ur_round_stochastic ( uint32_t  x,
uint32_t  y 
)
inlinestatic

Multiply two integer representations of u016 and return an integer representation of an s015 answer, rounded to a neighbouring s015 stochastically.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ accum_times_long_fract()

static s1615 accum_times_long_fract ( s1615  x,
s031  y 
)
inlinestatic

Multiply an s1615 and an s031 and return an s1615 answer, without rounding.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ accum_times_long_fract_nearest()

static s1615 accum_times_long_fract_nearest ( s1615  x,
s031  y 
)
inlinestatic

Multiply an s1615 and an s031 and return an s1615 answer rounded to the nearest s1615.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ accum_times_long_fract_stochastic()

static s1615 accum_times_long_fract_stochastic ( s1615  x,
s031  y 
)
inlinestatic

Multiply s1615 and an s031 and return an s1615 answer rounded to a neighbouring s1615 stochastically.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ accum_times_u_long_fract()

static s1615 accum_times_u_long_fract ( s1615  x,
u032  y 
)
inlinestatic

Multiply s1615 and an u032 and return an s1615 answer, without rounding.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ accum_times_u_long_fract_nearest()

static s1615 accum_times_u_long_fract_nearest ( s1615  x,
u032  y 
)
inlinestatic

Multiply s1615 and an u032 and return an s1615 answer rounded to the nearest s1615.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ accum_times_u_long_fract_stochastic()

static s1615 accum_times_u_long_fract_stochastic ( s1615  x,
u032  y 
)
inlinestatic

Multiply s1615 and an u032 and return an s1615 answer rounded to a neighbouring s1615 stochastically.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ long_fract_times_u_long_fract()

static s031 long_fract_times_u_long_fract ( s031  x,
u032  y 
)
inlinestatic

Multiply an s031 and an u032 and return a s031 answer, without rounding.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ long_fract_times_u_long_fract_nearest()

static s031 long_fract_times_u_long_fract_nearest ( s031  x,
u032  y 
)
inlinestatic

Multiply an s031 and an u032 and return a s031 answer rounded to the nearest s031.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ long_fract_times_u_long_fract_stochastic()

static s031 long_fract_times_u_long_fract_stochastic ( s031  x,
u032  y 
)
inlinestatic

Multiply an s031 and an u032 and return a s031 answer rounded to a neighbouring s031 stochastically.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ short_accum_times_fract()

static s87 short_accum_times_fract ( s87  x,
s015  y 
)
inlinestatic

Multiply two s87 numbers and return an s87 answer without rounding.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ short_accum_times_fract_nearest()

static s87 short_accum_times_fract_nearest ( s87  x,
s015  y 
)
inlinestatic

Multiply two s87 values and return an s87 answer rounded to the nearest s87.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ short_accum_times_fract_stochastic()

static s87 short_accum_times_fract_stochastic ( s87  x,
s015  y 
)
inlinestatic

Multiply two s87 values and return an s87 answer rounded to a neighbouring s87 stochastically.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ short_accum_times_u_fract()

static s87 short_accum_times_u_fract ( s87  x,
u016  y 
)
inlinestatic

Multiply an s87 and an u016 and return an s87 answer without rounding.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ short_accum_times_u_fract_nearest()

static s87 short_accum_times_u_fract_nearest ( s87  x,
u016  y 
)
inlinestatic

Multiply an s87 and an u016 and return an s87 answer rounded to the nearest s87.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ short_accum_times_u_fract_stochastic()

static s87 short_accum_times_u_fract_stochastic ( s87  x,
u016  y 
)
inlinestatic

Multiply an s87 and an u016 and return an s87 answer rounded to a neighbouring s87 stochastically.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ fract_times_u_fract()

static s015 fract_times_u_fract ( s015  x,
u016  y 
)
inlinestatic

Multiply an u016 and an s015 and return an s015 answer without rounding.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ fract_times_u_fract_nearest()

static s015 fract_times_u_fract_nearest ( s015  x,
u016  y 
)
inlinestatic

Multiply an u016 and an s015 and return an s015 answer rounded to the nearest s015.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.

◆ fract_times_u_fract_stochastic()

static s015 fract_times_u_fract_stochastic ( s015  x,
u016  y 
)
inlinestatic

Multiply an u016 and an s015 and return an s015 answer with stochastic rounding.

Parameters
[in]xThe first value
[in]yThe second value
Returns
The product.