33 #ifndef FIXMATH_MACRO_H
34 #define FIXMATH_MACRO_H
37 #error "Do not include this file directly - use fixmath.h instead!"
42 #include "fixmath_impl.h"
52 #define fx_clz(word) \
55 FX_IMPL_CLZ(r__, word); \
61 #define fx_ctz(word) \
64 FX_IMPL_CTZ(r__, word); \
70 #define fx_bitcount(word) \
73 FX_IMPL_BITCOUNT(r2__, word); \
78 #define fx_divx(x1, x2, frac) \
82 FX_IMPL_DIVX(x1__, x2__, frac); \
93 #define fx_itox(ival, frac) \
94 FX_IMPL_ITOX(ival, frac)
96 #define fx_ftox(fval, frac) \
97 FX_IMPL_FTOX(fval, frac)
99 #define fx_dtox(fval, frac) \
100 FX_IMPL_DTOX(fval, frac)
102 #define fx_xtox(xval, f1, f2) \
103 FX_IMPL_XTOX(xval, f1, f2)
105 #define fx_xtoi(xval, frac) \
106 FX_IMPL_XTOI(xval, frac)
108 #define fx_xtof(xval, frac) \
109 FX_IMPL_XTOF(xval, frac)
111 #define fx_xtod(xval, frac) \
112 FX_IMPL_XTOD(xval, frac)
114 #define fx_roundx(xval, frac) \
115 FX_IMPL_ROUNDX(xval, frac)
117 #define fx_floorx(xval, frac) \
118 FX_IMPL_FLOORX(xval, frac)
120 #define fx_ceilx(xval, frac) \
121 FX_IMPL_CEILX(xval, frac)
123 #define fx_addx(x1, x2) \
126 #define fx_subx(x1, x2) \
129 #define fx_mulx(x1, x2, frac) \
130 FX_IMPL_MULX(x1, x2, frac)
132 #define fx_rdivx(xval, rdiv) \
133 FX_IMPL_RDIVX(xval, rdiv)
Fixed-point math library - platform-specific definitions.