47#ifndef __STDFIX_FULL_ISO_H__
48#define __STDFIX_FULL_ISO_H__
59#define min(a, b) (((a)<(b)) ? (a) : (b))
67#define __stdfix_max(a, b) \
68 (((a)<(b)) ? (b) : (a))
75#define __stdfix_use(a) \
76 do {} while ((a)!=(a))
82#define __stdfix_abs(a) \
83 (((a)<0) ? -(a) : (a))
89#define __stdfix_ms_u32(x) \
96#define __stdfix_ls_u32(x) \
165#ifdef ECLIPSE_CDT_INDEXER_HACK
190typedef unsigned short fract
u08;
196typedef unsigned long fract
u032;
199typedef unsigned short accum
u88;
213typedef int32_t
s1615;
214typedef int64_t
s3231;
217typedef uint16_t
u016;
218typedef uint32_t
u032;
220typedef uint32_t
u1616;
221typedef uint64_t
u3232;
553#define __I(x) ((int) (x))
555#define __I32(x) ((int32_t) (x))
557#define __I64(x) ((int64_t) (x))
559#define __LI(x) ((long int) (x))
561#define __U32(x) ((uint32_t) (x))
563#define __U64(x) ((uint64_t) (x))
565#define __UI(x) ((unsigned int) (x))
567#define __ULI(x) ((unsigned long int) (x))
677 if (x > UINT16_MAX) {
691 if (x > UINT32_MAX) {
705 if (x > UINT16_MAX) {
719 if (x > UINT32_MAX) {
873#ifdef __ARM_FEATURE_DSP
889#ifdef __ARM_FEATURE_DSP
903#ifdef __ARM_FEATURE_DSP
939 if (x == INT8_MIN && y == INT8_MIN) {
955 if (x == INT16_MIN && y == INT16_MIN) {
971 if (x == INT32_MIN && y == INT32_MIN) {
987 if (x == INT16_MIN && y == INT16_MIN) {
1003 if (x == INT32_MIN && y == INT32_MIN) {
1310 int64_t k =
__I64(n) * (r >> 31);
1311 int64_t c = (
__I64(n) * (r & INT64_C(0x7FFFFFF))) >> 31;
1480 unsigned long int n,
1506 unsigned long int n,
1510 uint64_t k =
__U64(n) * (r >> 32);
1511 uint64_t c = (
__U64(n) * (r & INT64_C(0xFFFFFFF))) >> 32;
1513 return __ULI(k + c);
1536 unsigned long int n,
1562 unsigned long int n,
1587 unsigned long int i,
1588 unsigned long int j)
1612 unsigned long int i,
1613 unsigned long int j)
1687 r = (r == INT8_MIN) ? INT8_MAX : -r;
1703 r = (r == INT16_MIN) ? INT16_MAX : -r;
1719 r = (r == INT32_MIN) ? INT32_MAX : -r;
1735 r = (r == INT16_MIN) ? INT16_MAX : -r;
1751 r = (r == INT32_MIN) ? INT32_MAX : -r;
1767 r = (r == INT64_MIN) ? INT64_MAX : -r;
1800 register uint8_t r, c;
1802 c = (x >> (n-1)) & 0x1;
1819 register uint16_t r, c;
1821 c = (x >> (n-1)) & 0x1;
1838 register uint32_t r, c;
1840 c = (x >> (n-1)) & 0x1;
1857 register uint64_t r, c;
1859 c = (x >> (n-1)) & 0x1;
1876 register int8_t r, c;
1878 c = (x >> (n-1)) & 0x1;
1895 register int16_t r, c;
1897 c = (x >> (n-1)) & 0x1;
1914 register int32_t r, c;
1916 c = (x >> (n-1)) & 0x1;
1933 register int64_t r, c;
1935 c = (x >> (n-1)) & 0x1;
2129 return __builtin_clrsb(n) - 24;
2145 return __builtin_clrsb(n) - 16;
2162 return __builtin_clrsb(n);
2179 return __builtin_clrsb(n) - 16;
2195 return __builtin_clrsb(n);
2212 return __builtin_clrsbll(n);
2229 return __builtin_clz(n) - 24;
2246 return __builtin_clz(n) - 16;
2263 return __builtin_clz(n);
2280 return __builtin_clz(n) - 16;
2297 return __builtin_clz(n);
2314 return __builtin_clzll(n);
2358#define roundfx(f, n) \
2360 s07: roundhr(f, n), \
2361 s015: roundr(f, n), \
2362 s031: roundlr(f, n), \
2363 s87: roundhk(f, n), \
2364 s1615: roundk(f, n), \
2365 s3231: roundlk(f, n), \
2366 u08: rounduhr(f, n), \
2367 u016: roundur(f, n), \
2368 u032: roundulr(f, n), \
2369 u88: rounduhk(f, n), \
2370 u1616: rounduk(f, n), \
2371 u3232: roundulk(f, n), \
2380#define countlsfx(f) \
2382 s07: countlshr(f), \
2383 s015: countlsr(f), \
2384 s031: countlslr(f), \
2385 s87: countlshk(f), \
2386 s1615: countlsk(f), \
2387 s3231: countlslk(f), \
2388 u08: countlsuhr(f), \
2389 u016: countlsur(f), \
2390 u032: countlsulr(f), \
2391 u88: countlsuhk(f), \
2392 u1616: countlsuk(f), \
2393 u3232: countlsulk(f), \
2462s07 strtofxhr (
const char *restrict nptr,
char **restrict endptr);
2463s015 strtofxr (
const char *restrict nptr,
char **restrict endptr);
2464s031 strtofxlr (
const char *restrict nptr,
char **restrict endptr);
2465s87 strtofxhk (
const char *restrict nptr,
char **restrict endptr);
2466s1615 strtofxk (
const char *restrict nptr,
char **restrict endptr);
2467s3231 strtofxlk (
const char *restrict nptr,
char **restrict endptr);
2469u08 strtofxuhr(
const char *restrict nptr,
char **restrict endptr);
2470u016 strtofxur (
const char *restrict nptr,
char **restrict endptr);
2471u032 strtofxulr(
const char *restrict nptr,
char **restrict endptr);
2472u88 strtofxuhk(
const char *restrict nptr,
char **restrict endptr);
2473u1616 strtofxuk (
const char *restrict nptr,
char **restrict endptr);
2474u3232 strtofxulk(
const char *restrict nptr,
char **restrict endptr);
static unsigned long int muliulr(unsigned long int n, u032 x)
Multiplies an unsigned long integer by an unsigned long fract giving an unsigned integer answer.
Definition stdfix-full-iso.h:1479
short fract s07
An alternative name for the signed short fract type.
Definition stdfix-full-iso.h:172
static uint32_t __stdfix_sadd_ur(uint32_t x, uint32_t y)
Saturated addition of the underlying unsigned integer representations.
Definition stdfix-full-iso.h:1049
int16_t int_r_t
This is the integer type into which signed fract can be converted.
Definition stdfix-full-iso.h:117
static s3231 lkbits(const int_lk_t n)
Converts a signed integer into a signed long accum.
Definition stdfix-full-iso.h:463
void __stdfix_64x64_128(uint64_t *hi, uint64_t *lo, uint64_t x, uint64_t y)
Multiplies two 64-bit unsigned integers returning a 128-bit result in hi and lo.
static long int divilk(long int n, s3231 x)
Divides an integer by a long accum giving a long integer answer.
Definition stdfix-full-iso.h:1357
static u3232 roundulk(u3232 f, int n)
This function rounds the input unsigned long accum to a number of bits, returning an unsigned long ac...
Definition stdfix-full-iso.h:2091
uint64_t __stdfix_sadd_ulk(uint64_t x, uint64_t y)
Saturated addition of the underlying unsigned integer representations.
static uint_uhk_t bitsuhk(const u88 f)
Converts an unsigned short accum into an integer.
Definition stdfix-full-iso.h:354
static unsigned int diviuk(unsigned int n, u1616 x)
Divides an unsigned integer by an unsigned accum giving an unsigned integer answer.
Definition stdfix-full-iso.h:1548
static int countlsuhr(u08 f)
This function counts the number of leading zeros of an unsigned short fract.
Definition stdfix-full-iso.h:2220
uint32_t uint_ulr_t
This is the unsigned integer type into which unsigned long fract can be converted.
Definition stdfix-full-iso.h:144
static int countlsulr(u032 f)
This function counts the number of leading zeros of an unsigned long fract.
Definition stdfix-full-iso.h:2254
static u032 ulrbits(const uint_ulr_t n)
Converts an unsigned integer into an unsigned long fract.
Definition stdfix-full-iso.h:502
static int countlsuk(u1616 f)
This function counts the number of leading zeros of an unsigned accum.
Definition stdfix-full-iso.h:2288
#define __UI(x)
Cast to unsigned int.
Definition stdfix-full-iso.h:565
static int divik(int n, s1615 x)
Divides an integer by an accum giving an integer answer.
Definition stdfix-full-iso.h:1345
static int countlsk(s1615 f)
This function counts the number of leading sign-bits of an accum.
Definition stdfix-full-iso.h:2186
static s031 lrbits(const int_lr_t n)
Converts a signed integer into a signed long fract.
Definition stdfix-full-iso.h:424
static int_hr_t bitshr(const s07 f)
Converts a short fract into an integer.
Definition stdfix-full-iso.h:237
static uint32_t __stdfix_smul_ulr(uint32_t x, uint32_t y)
Saturated multiplication of the underlying unsigned integer representations.
Definition stdfix-full-iso.h:1202
static s07 roundhr(s07 f, int n)
This function rounds the input short fract to a number of bits, returning a short fract.
Definition stdfix-full-iso.h:1948
unsigned fract u016
An alternative name for the unsigned fract type.
Definition stdfix-full-iso.h:193
int64_t __stdfix_ssub_lk(int64_t x, int64_t y)
Saturated subtraction of the underlying integer representations.
unsigned accum u1616
An alternative name for the unsigned accum type.
Definition stdfix-full-iso.h:202
static int mulik(int n, s1615 x)
Multiplies an integer by an accum giving an integer answer.
Definition stdfix-full-iso.h:1292
static int32_t __stdfix_ssub_hr(int_hr_t x, int_hr_t y)
Saturated subtraction of the underlying integer representations.
Definition stdfix-full-iso.h:745
static int countlsur(u016 f)
This function counts the number of leading zeros of an unsigned fract.
Definition stdfix-full-iso.h:2237
static int countlsr(s015 f)
This function counts the number of leading sign-bits of a fract.
Definition stdfix-full-iso.h:2136
uint8_t uint_uhr_t
This is the unsigned integer type into which unsigned short accum can be converted.
Definition stdfix-full-iso.h:136
static int countlshr(s07 f)
This function counts the number of leading sign-bits of a short fract.
Definition stdfix-full-iso.h:2120
static int countlslr(s031 f)
This function counts the number of leading sign-bits of a long fract.
Definition stdfix-full-iso.h:2153
static uint32_t __stdfix_sadd_uk(uint32_t x, uint32_t y)
Saturated addition of the underlying unsigned integer representations.
Definition stdfix-full-iso.h:1127
static uint32_t __stdfix_smul_uhr(uint32_t x, uint32_t y)
Saturated multiplication of the underlying unsigned integer representations.
Definition stdfix-full-iso.h:1172
static int_lr_t bitslr(const s031 f)
Converts a long fract into an integer.
Definition stdfix-full-iso.h:263
static int mulir(int n, s015 x)
Multiplies an integer by a fract giving an integer answer.
Definition stdfix-full-iso.h:1268
uint16_t uint_ur_t
This is the unsigned integer type into which unsigned fract can be converted.
Definition stdfix-full-iso.h:140
long accum s3231
An alternative name for the signed long accum type.
Definition stdfix-full-iso.h:187
static long int idivlk(s3231 x, s3231 y)
Divides two long accums giving a long integer answer.
Definition stdfix-full-iso.h:1453
int16_t int_hk_t
This is the integer type into which signed short accum can be converted.
Definition stdfix-full-iso.h:125
static u016 roundur(u016 f, int n)
This function rounds the input unsigned fract to a number of bits, returning an unsigned fract.
Definition stdfix-full-iso.h:2039
static uint_uk_t bitsuk(const u1616 f)
Converts an unsigned accum into an integer.
Definition stdfix-full-iso.h:367
static int divir(int n, s015 x)
Divides an integer by a fract giving an integer answer.
Definition stdfix-full-iso.h:1321
static int32_t __stdfix_ssub_r(int32_t x, int32_t y)
Saturated subtraction of the underlying integer representations.
Definition stdfix-full-iso.h:779
static unsigned int muliur(unsigned int n, u016 x)
Multiplies an unsigned integer by an unsigned fract giving an unsigned integer answer.
Definition stdfix-full-iso.h:1466
static s015 roundr(s015 f, int n)
This function rounds the input fract to a number of bits, returning a fract.
Definition stdfix-full-iso.h:1961
int8_t int_hr_t
This is the integer type into which signed short fract can be converted.
Definition stdfix-full-iso.h:114
static u032 ulrdivi(unsigned long int i, unsigned long int j)
Divides two unsigned long integers giving an unsigned long fract answer.
Definition stdfix-full-iso.h:1586
static u1616 ukdivi(unsigned int i, unsigned int j)
Divides two unsigned integers giving an unsigned accum answer.
Definition stdfix-full-iso.h:1598
#define __U32(x)
Cast to uint32_t.
Definition stdfix-full-iso.h:561
static int32_t __stdfix_sat_hr(const int32_t x)
Saturates an integer to 8 bits.
Definition stdfix-full-iso.h:575
static uint32_t __stdfix_ssub_uhk(uint32_t x, uint32_t y)
Saturated subtraction of the underlying unsigned integer representations.
Definition stdfix-full-iso.h:1114
static unsigned long int idivulr(u032 x, u032 y)
Divides two unsigned long fracts giving an unsigned long integer answer.
Definition stdfix-full-iso.h:1636
static u08 uhrbits(const uint_uhr_t n)
Converts an unsigned integer into an unsigned short fract.
Definition stdfix-full-iso.h:476
fract s015
An alternative name for the signed fract type.
Definition stdfix-full-iso.h:175
static uint32_t __stdfix_sat_ur(const uint32_t x)
Saturates an unsigned integer to 16 bits.
Definition stdfix-full-iso.h:674
int64_t __stdfix_sneg_lk(int64_t x)
Saturated negation of the underlying integer representations.
static uint32_t __stdfix_sadd_uhk(uint32_t x, uint32_t y)
Saturated addition of the underlying unsigned integer representations.
Definition stdfix-full-iso.h:1101
#define __U64(x)
Cast to uint64_t.
Definition stdfix-full-iso.h:563
uint32_t uint_uk_t
This is the unsigned integer type into which unsigned accum can be converted.
Definition stdfix-full-iso.h:152
uint64_t __stdfix_ssub_ulk(uint64_t x, uint64_t y)
Saturated subtraction of the underlying unsigned integer representations.
uint64_t __stdfix_smul_ulk(uint64_t x, uint64_t y)
Saturated multiplication of the underlying unsigned integer representations.
static u08 rounduhr(u08 f, int n)
This function rounds the input unsigned short fract to a number of bits, returning an unsigned short ...
Definition stdfix-full-iso.h:2026
static uint_uhr_t bitsuhr(const u08 f)
Converts an unsigned short fract into an integer.
Definition stdfix-full-iso.h:315
static int_k_t bitsk(const s1615 f)
Converts an accum into an integer.
Definition stdfix-full-iso.h:289
static int32_t __stdfix_sneg_k(int32_t x)
Saturated negation of the underlying integer representations.
Definition stdfix-full-iso.h:900
static unsigned int idivuk(u1616 x, u1616 y)
Divides two unsigned accums giving an unsigned integer answer.
Definition stdfix-full-iso.h:1648
static uint16_t __stdfix_round_u16(uint16_t x, int n)
This function rounds the input unsigned 16-bit integer to a number of bits, returning a 16-bit intege...
Definition stdfix-full-iso.h:1815
static unsigned long int diviulk(unsigned long int n, u3232 x)
Divides a long unsigned integer by a long unsigned accum giving an unsigned integer answer.
Definition stdfix-full-iso.h:1561
static int32_t __stdfix_smul_hk(int32_t x, int32_t y)
Saturated multiplication of the underlying integer representations.
Definition stdfix-full-iso.h:983
static long int mulilk(long int n, s3231 x)
Multiplies a long integer by a long accum giving a long integer answer.
Definition stdfix-full-iso.h:1305
int32_t int_lr_t
This is the integer type into which signed long fract can be converted.
Definition stdfix-full-iso.h:121
static s3231 roundlk(s3231 f, int n)
This function rounds the input long accum to a number of bits, returning a long accum.
Definition stdfix-full-iso.h:2013
static int16_t __stdfix_round_s16(int16_t x, int n)
This function rounds the input signed 16-bit integer to a number of bits, returning a 16-bit integer.
Definition stdfix-full-iso.h:1891
static int32_t __stdfix_smul_hr(int32_t x, int32_t y)
Saturated multiplication of the underlying integer representations.
Definition stdfix-full-iso.h:935
static int32_t __stdfix_sadd_r(int32_t x, int32_t y)
Saturated addition of the underlying integer representations.
Definition stdfix-full-iso.h:767
unsigned short fract u08
An alternative name for the unsigned short fract type.
Definition stdfix-full-iso.h:190
static int32_t __stdfix_sadd_lr(int32_t x, int32_t y)
Saturated addition of the underlying integer representations.
Definition stdfix-full-iso.h:801
static u88 uhkbits(const uint_uhk_t n)
Converts an unsigned integer into an unsigned short accum.
Definition stdfix-full-iso.h:515
static uint_ulk_t bitsulk(const u3232 f)
Converts an unsigned long accum into an integer.
Definition stdfix-full-iso.h:380
static int32_t __stdfix_sat_k(const int64_t x)
Saturates a 64-bit integer to 32-bits.
Definition stdfix-full-iso.h:643
static s1615 absk(s1615 f)
This function returns the absolute value of an accum.
Definition stdfix-full-iso.h:1745
static unsigned long int muliulk(unsigned long int n, u3232 x)
Multiplies an unsigned long integer by an unsigned long accum giving an unsigned long integer answer.
Definition stdfix-full-iso.h:1505
static int32_t __stdfix_smul_k(int32_t x, int32_t y)
Saturated multiplication of the underlying integer representations.
Definition stdfix-full-iso.h:999
static uint32_t __stdfix_smul_uhk(uint32_t x, uint32_t y)
Saturated multiplication of the underlying unsigned integer representations.
Definition stdfix-full-iso.h:1218
static s031 roundlr(s031 f, int n)
This function rounds the input long fract to a number of bits, returning a long fract.
Definition stdfix-full-iso.h:1974
static s3231 abslk(s3231 f)
This function returns the absolute value of a long accum.
Definition stdfix-full-iso.h:1761
static uint32_t __stdfix_sat_ulr(const uint64_t x)
Saturates an unsigned 64-bit integer to 32 bits.
Definition stdfix-full-iso.h:688
static s87 abshk(s87 f)
This function returns the absolute value of a short accum.
Definition stdfix-full-iso.h:1729
static int32_t __stdfix_sat_hk(const int32_t x)
Saturates an integer to 16 bits.
Definition stdfix-full-iso.h:626
static uint32_t __stdfix_round_u32(uint32_t x, int n)
This function rounds the input unsigned 32-bit integer to a number of bits, returning a 32-bit intege...
Definition stdfix-full-iso.h:1834
static int idivk(s1615 x, s1615 y)
Divides two accums giving an integer answer.
Definition stdfix-full-iso.h:1441
#define __I(x)
Cast to int.
Definition stdfix-full-iso.h:553
static int32_t __stdfix_ssub_hk(int32_t x, int32_t y)
Saturated subtraction of the underlying integer representations.
Definition stdfix-full-iso.h:847
static int_r_t bitsr(const s015 f)
Converts a fract into an integer.
Definition stdfix-full-iso.h:250
static int32_t __stdfix_sneg_hk(int32_t x)
Saturated negation of the underlying integer representations.
Definition stdfix-full-iso.h:858
int64_t int_lk_t
This is the integer type into which signed long accum can be converted.
Definition stdfix-full-iso.h:132
static unsigned int muliuk(unsigned int n, u1616 x)
Multiplies an unsigned integer by an unsigned accum giving an unsigned integer answer.
Definition stdfix-full-iso.h:1492
static int countlshk(s87 f)
This function counts the number of leading sign-bits of a short accum.
Definition stdfix-full-iso.h:2170
static uint32_t __stdfix_sadd_ulr(uint32_t x, uint32_t y)
Saturated addition of the underlying unsigned integer representations.
Definition stdfix-full-iso.h:1075
uint16_t uint_uhk_t
This is the unsigned integer type into which unsigned short accum can be converted.
Definition stdfix-full-iso.h:148
static uint32_t __stdfix_ssub_ur(uint32_t x, uint32_t y)
Saturated subtraction of the underlying unsigned integer representations.
Definition stdfix-full-iso.h:1062
static uint_ur_t bitsur(const u016 f)
Converts an unsigned fract into an integer.
Definition stdfix-full-iso.h:328
static int32_t __stdfix_sadd_hk(int32_t x, int32_t y)
Saturated addition of the underlying integer representations.
Definition stdfix-full-iso.h:835
static int countlsulk(u3232 f)
This function counts the number of leading zeros of an unsigned long accum.
Definition stdfix-full-iso.h:2305
static unsigned int diviur(unsigned int n, u016 x)
Divides an unsigned integer by an unsigned fract giving an unsigned integer answer.
Definition stdfix-full-iso.h:1522
static int32_t __stdfix_sadd_hr(int_hr_t x, int_hr_t y)
Saturated addition of the underlying integer representations.
Definition stdfix-full-iso.h:733
static u016 urdivi(unsigned int i, unsigned int j)
Divides two unsigned integers giving an unsigned fract answer.
Definition stdfix-full-iso.h:1573
static u016 urbits(const uint_ur_t n)
Converts an unsigned integer into an unsigned fract.
Definition stdfix-full-iso.h:489
static int32_t __stdfix_sneg_r(int32_t x)
Saturated negation of the underlying integer representations.
Definition stdfix-full-iso.h:790
int64_t __stdfix_sadd_lk(int64_t x, int64_t y)
Saturated addition of the underlying integer representations.
static uint_ulr_t bitsulr(const u032 f)
Converts an unsigned long fract into an integer.
Definition stdfix-full-iso.h:341
int64_t __stdfix_smul_lk(int64_t x, int64_t y)
Saturated multiplication of the underlying integer representations.
static s031 abslr(s031 f)
This function returns the absolute value of a long fract.
Definition stdfix-full-iso.h:1713
static uint64_t __stdfix_round_u64(uint64_t x, int n)
This function rounds the input unsigned 64-bit integer to a number of bits, returning a 64-bit intege...
Definition stdfix-full-iso.h:1853
static uint8_t __stdfix_round_u8(uint8_t x, int n)
This function rounds the input unsigned 8-bit integer to a number of bits, returning an 8-bit integer...
Definition stdfix-full-iso.h:1796
static u88 rounduhk(u88 f, int n)
This function rounds the input unsigned short accum to a number of bits, returning an unsigned short ...
Definition stdfix-full-iso.h:2065
int32_t int_k_t
This is the integer type into which signed accum can be converted.
Definition stdfix-full-iso.h:128
static int32_t __stdfix_sat_r(const int32_t x)
Saturates an integer to 16 bits.
Definition stdfix-full-iso.h:592
#define __ULI(x)
Cast to unsigned long int.
Definition stdfix-full-iso.h:567
static u032 roundulr(u032 f, int n)
This function rounds the input unsigned long fract to a number of bits, returning an unsigned long fr...
Definition stdfix-full-iso.h:2052
static s87 roundhk(s87 f, int n)
This function rounds the input short accum to a number of bits, returning a short accum.
Definition stdfix-full-iso.h:1987
long fract s031
An alternative name for the signed long fract type.
Definition stdfix-full-iso.h:178
static int32_t __stdfix_ssub_lr(int32_t x, int32_t y)
Saturated subtraction of the underlying integer representations.
Definition stdfix-full-iso.h:813
static s3231 lkdivi(long int i, long int j)
Divides two integers giving a long accum answer.
Definition stdfix-full-iso.h:1405
static uint32_t __stdfix_ssub_ulr(uint32_t x, uint32_t y)
Saturated subtraction of the underlying unsigned integer representations.
Definition stdfix-full-iso.h:1088
static unsigned long int idivulk(u3232 x, u3232 y)
Divides two unsigned long accums giving an unsigned long integer answer.
Definition stdfix-full-iso.h:1660
static uint32_t __stdfix_ssub_uk(uint32_t x, uint32_t y)
Saturated subtraction of the underlying unsigned integer representations.
Definition stdfix-full-iso.h:1140
static u1616 rounduk(u1616 f, int n)
This function rounds the input unsigned accum to a number of bits, returning an unsigned accum.
Definition stdfix-full-iso.h:2078
short accum s87
An alternative name for the signed short accum type.
Definition stdfix-full-iso.h:181
unsigned short accum u88
An alternative name for the unsigned short accum type.
Definition stdfix-full-iso.h:199
#define __LI(x)
Cast to long int.
Definition stdfix-full-iso.h:559
static int64_t __stdfix_round_s64(int64_t x, int n)
This function rounds the input signed 64-bit integer to a number of bits, returning a 64-bit integer.
Definition stdfix-full-iso.h:1929
accum s1615
An alternative name for the signed accum type.
Definition stdfix-full-iso.h:184
static u3232 ulkbits(const uint_ulk_t n)
Converts an unsigned integer into an unsigned long accum.
Definition stdfix-full-iso.h:541
static int32_t __stdfix_sneg_lr(int32_t x)
Saturated negation of the underlying integer representations.
Definition stdfix-full-iso.h:824
static int32_t __stdfix_smul_r(int32_t x, int32_t y)
Saturated multiplication of the underlying integer representations.
Definition stdfix-full-iso.h:951
static unsigned int idivur(u016 x, u016 y)
Divides two unsigned fracts giving an unsigned integer answer.
Definition stdfix-full-iso.h:1623
static s015 rbits(const int_r_t n)
Converts a signed integer into a signed fract.
Definition stdfix-full-iso.h:411
static int_hk_t bitshk(const s87 f)
Converts a short accum into an integer.
Definition stdfix-full-iso.h:276
static long int mulilr(long int n, s031 x)
Multiplies a long integer by a long fract giving an integer answer.
Definition stdfix-full-iso.h:1280
static unsigned long int diviulr(unsigned long int n, u032 x)
Divides a long unsigned integer by a long unsigned fract giving an unsigned integer answer.
Definition stdfix-full-iso.h:1535
static long int idivlr(s031 x, s031 y)
Divides two long fracts giving a long integer answer.
Definition stdfix-full-iso.h:1429
static u1616 ukbits(const uint_uk_t n)
Converts an unsigned integer into an unsigned accum.
Definition stdfix-full-iso.h:528
static uint32_t __stdfix_sat_uhk(const uint32_t x)
Saturates an unsigned integer to 16 bits.
Definition stdfix-full-iso.h:702
static int8_t __stdfix_round_s8(int8_t x, int n)
This function rounds the input signed 8-bit integer to a number of bits, returning an 8-bit integer.
Definition stdfix-full-iso.h:1872
static uint32_t __stdfix_smul_ur(uint32_t x, uint32_t y)
Saturated multiplication of the underlying unsigned integer representations.
Definition stdfix-full-iso.h:1186
static int32_t __stdfix_ssub_k(int32_t x, int32_t y)
Saturated subtraction of the underlying integer representations.
Definition stdfix-full-iso.h:885
static int countlsuhk(u88 f)
This function counts the number of leading zeros of an unsigned short accum.
Definition stdfix-full-iso.h:2271
static uint32_t __stdfix_sadd_uhr(uint32_t x, uint32_t y)
Saturated addition of the underlying unsigned integer representations.
Definition stdfix-full-iso.h:1023
static s07 hrbits(const int_hr_t n)
Converts a signed integer into a signed short fract.
Definition stdfix-full-iso.h:398
static s015 absr(s015 f)
This function returns the absolute value of a fract.
Definition stdfix-full-iso.h:1697
static s87 hkbits(const int_hk_t n)
Converts a signed integer into a signed short accum.
Definition stdfix-full-iso.h:437
static u3232 ulkdivi(unsigned long int i, unsigned long int j)
Divides two unsigned long integers giving an unsigned long accum answer.
Definition stdfix-full-iso.h:1611
unsigned long fract u032
An alternative name for the unsigned long fract type.
Definition stdfix-full-iso.h:196
uint64_t uint_ulk_t
This is the unsigned integer type into which unsigned long accum can be converted.
Definition stdfix-full-iso.h:156
static long int divilr(long int n, s031 x)
Divides a long integer by a long fract giving a long integer answer.
Definition stdfix-full-iso.h:1333
static s031 lrdivi(long int i, long int j)
Divides two integers giving a long fract answer.
Definition stdfix-full-iso.h:1381
static int32_t __stdfix_round_s32(int32_t x, int n)
This function rounds the input signed 32-bit integer to a number of bits, returning a 32-bit integer.
Definition stdfix-full-iso.h:1910
unsigned long accum u3232
An alternative name for the unsigned long accum type.
Definition stdfix-full-iso.h:205
static int_lk_t bitslk(const s3231 f)
Converts a long accum into an integer.
Definition stdfix-full-iso.h:302
#define __I32(x)
Cast to int32_t.
Definition stdfix-full-iso.h:555
static int32_t __stdfix_sadd_k(int32_t x, int32_t y)
Saturated addition of the underlying integer representations.
Definition stdfix-full-iso.h:869
static s1615 kdivi(int i, int j)
Divides two integers giving an accum answer.
Definition stdfix-full-iso.h:1393
static int countlslk(s3231 f)
This function counts the number of leading sign-bits of a long accum.
Definition stdfix-full-iso.h:2203
static s1615 kbits(const int_k_t n)
Converts a signed integer into a signed accum.
Definition stdfix-full-iso.h:450
static int32_t __stdfix_sat_lr(const int64_t x)
Saturates a 64-bit integer to 32-bits.
Definition stdfix-full-iso.h:609
#define __I64(x)
Cast to int64_t.
Definition stdfix-full-iso.h:557
static uint32_t __stdfix_sat_uk(const uint64_t x)
Saturates an unsigned 64-bit integer to 32 bits.
Definition stdfix-full-iso.h:716
static int idivr(s015 x, s015 y)
Divides two fracts giving an integer answer.
Definition stdfix-full-iso.h:1417
static uint32_t __stdfix_ssub_uhr(uint32_t x, uint32_t y)
Saturated subtraction of the underlying unsigned integer representations.
Definition stdfix-full-iso.h:1036
static s07 abshr(s07 f)
This function returns the absolute value of a short fract.
Definition stdfix-full-iso.h:1681
static uint32_t __stdfix_smul_uk(uint32_t x, uint32_t y)
Saturated multiplication of the underlying unsigned integer representations.
Definition stdfix-full-iso.h:1232
static int32_t __stdfix_sneg_hr(int_hr_t x)
Saturated negation of the underlying integer representations.
Definition stdfix-full-iso.h:756
static s015 rdivi(int i, int j)
Divides two integers giving a fract answer.
Definition stdfix-full-iso.h:1369
static uint32_t __stdfix_sat_uhr(const uint32_t x)
Saturates an unsigned integer to 8 bits.
Definition stdfix-full-iso.h:660
static int32_t __stdfix_smul_lr(int32_t x, int32_t y)
Saturated multiplication of the underlying integer representations.
Definition stdfix-full-iso.h:967
static s1615 roundk(s1615 f, int n)
This function rounds the input accum to a number of bits, returning an accum.
Definition stdfix-full-iso.h:2000