#ifndef __SPL_FIXED31_32_H__
#define __SPL_FIXED31_32_H__
#include "os_types.h"
#include "spl_os_types.h"
#ifndef ASSERT
#define ASSERT …
#endif
#ifndef LLONG_MAX
#define LLONG_MAX …
#endif
#ifndef LLONG_MIN
#define LLONG_MIN …
#endif
#define FIXED31_32_BITS_PER_FRACTIONAL_PART …
#ifndef LLONG_MIN
#define LLONG_MIN …
#endif
#ifndef LLONG_MAX
#define LLONG_MAX …
#endif
struct spl_fixed31_32 { … };
static const struct spl_fixed31_32 spl_fixpt_zero = …;
static const struct spl_fixed31_32 spl_fixpt_epsilon = …;
static const struct spl_fixed31_32 spl_fixpt_half = …;
static const struct spl_fixed31_32 spl_fixpt_one = …;
struct spl_fixed31_32 spl_fixpt_from_fraction(long long numerator, long long denominator);
static inline struct spl_fixed31_32 spl_fixpt_from_int(int arg)
{ … }
static inline struct spl_fixed31_32 spl_fixpt_neg(struct spl_fixed31_32 arg)
{ … }
static inline struct spl_fixed31_32 spl_fixpt_abs(struct spl_fixed31_32 arg)
{ … }
static inline bool spl_fixpt_lt(struct spl_fixed31_32 arg1, struct spl_fixed31_32 arg2)
{ … }
static inline bool spl_fixpt_le(struct spl_fixed31_32 arg1, struct spl_fixed31_32 arg2)
{ … }
static inline bool spl_fixpt_eq(struct spl_fixed31_32 arg1, struct spl_fixed31_32 arg2)
{ … }
static inline struct spl_fixed31_32 spl_fixpt_min(struct spl_fixed31_32 arg1, struct spl_fixed31_32 arg2)
{ … }
static inline struct spl_fixed31_32 spl_fixpt_max(struct spl_fixed31_32 arg1, struct spl_fixed31_32 arg2)
{ … }
static inline struct spl_fixed31_32 spl_fixpt_clamp(
struct spl_fixed31_32 arg,
struct spl_fixed31_32 min_value,
struct spl_fixed31_32 max_value)
{ … }
static inline struct spl_fixed31_32 spl_fixpt_shl(struct spl_fixed31_32 arg, unsigned char shift)
{ … }
static inline struct spl_fixed31_32 spl_fixpt_shr(struct spl_fixed31_32 arg, unsigned char shift)
{ … }
static inline struct spl_fixed31_32 spl_fixpt_add(struct spl_fixed31_32 arg1, struct spl_fixed31_32 arg2)
{ … }
static inline struct spl_fixed31_32 spl_fixpt_add_int(struct spl_fixed31_32 arg1, int arg2)
{ … }
static inline struct spl_fixed31_32 spl_fixpt_sub(struct spl_fixed31_32 arg1, struct spl_fixed31_32 arg2)
{ … }
static inline struct spl_fixed31_32 spl_fixpt_sub_int(struct spl_fixed31_32 arg1, int arg2)
{ … }
struct spl_fixed31_32 spl_fixpt_mul(struct spl_fixed31_32 arg1, struct spl_fixed31_32 arg2);
static inline struct spl_fixed31_32 spl_fixpt_mul_int(struct spl_fixed31_32 arg1, int arg2)
{ … }
struct spl_fixed31_32 spl_fixpt_sqr(struct spl_fixed31_32 arg);
static inline struct spl_fixed31_32 spl_fixpt_div_int(struct spl_fixed31_32 arg1, long long arg2)
{ … }
static inline struct spl_fixed31_32 spl_fixpt_div(struct spl_fixed31_32 arg1, struct spl_fixed31_32 arg2)
{ … }
struct spl_fixed31_32 spl_fixpt_recip(struct spl_fixed31_32 arg);
struct spl_fixed31_32 spl_fixpt_sinc(struct spl_fixed31_32 arg);
struct spl_fixed31_32 spl_fixpt_sin(struct spl_fixed31_32 arg);
struct spl_fixed31_32 spl_fixpt_cos(struct spl_fixed31_32 arg);
struct spl_fixed31_32 spl_fixpt_exp(struct spl_fixed31_32 arg);
struct spl_fixed31_32 spl_fixpt_log(struct spl_fixed31_32 arg);
static inline struct spl_fixed31_32 spl_fixpt_pow(struct spl_fixed31_32 arg1, struct spl_fixed31_32 arg2)
{ … }
static inline int spl_fixpt_floor(struct spl_fixed31_32 arg)
{ … }
static inline int spl_fixpt_round(struct spl_fixed31_32 arg)
{ … }
static inline int spl_fixpt_ceil(struct spl_fixed31_32 arg)
{ … }
unsigned int spl_fixpt_u4d19(struct spl_fixed31_32 arg);
unsigned int spl_fixpt_u3d19(struct spl_fixed31_32 arg);
unsigned int spl_fixpt_u2d19(struct spl_fixed31_32 arg);
unsigned int spl_fixpt_u0d19(struct spl_fixed31_32 arg);
unsigned int spl_fixpt_clamp_u0d14(struct spl_fixed31_32 arg);
unsigned int spl_fixpt_clamp_u0d10(struct spl_fixed31_32 arg);
int spl_fixpt_s4d19(struct spl_fixed31_32 arg);
static inline struct spl_fixed31_32 spl_fixpt_truncate(struct spl_fixed31_32 arg, unsigned int frac_bits)
{ … }
struct spl_fixed31_32 spl_fixpt_from_ux_dy(unsigned int value, unsigned int integer_bits, unsigned int fractional_bits);
struct spl_fixed31_32 spl_fixpt_from_int_dy(unsigned int int_value,
unsigned int frac_value,
unsigned int integer_bits,
unsigned int fractional_bits);
#endif