Lines Matching full:q
14 * @defgroup math_printing Helper macros for printing Q values.
21 * For a Q value representing 0.5, the expected output will be:
28 * @brief Insert Q value format string
32 static inline int64_t ___PRIq_arg_shift(int64_t q, int shift) in ___PRIq_arg_shift() argument
35 return llabs(q) >> -shift; in ___PRIq_arg_shift()
37 return llabs(q) << shift; in ___PRIq_arg_shift()
45 #define __PRIq_arg_shift(q, shift) ___PRIq_arg_shift(q, ((shift) + (8 * (4 - (int)sizeof(q))))) argument
46 #define __PRIq_arg_get(q, shift, h, l) FIELD_GET(GENMASK64(h, l), __PRIq_arg_shift(q, shift)) argument
47 #define __PRIq_arg_get_int(q, shift) __PRIq_arg_get(q, shift, 63, 31) argument
48 #define __PRIq_arg_get_frac(q, precision, shift) \ argument
49 ((__PRIq_arg_get(q, shift, 30, 0) * __CONSTPOW(1, precision)) / INT32_MAX)
52 * @brief Insert Q value arguments to print format
54 * @param[in] q The q value
56 * @param[in] shift The "scale" to shift @p q by
58 #define PRIq_arg(q, precision, shift) \ argument
59 ((q) < 0 ? "-" : ""), (uint32_t)__PRIq_arg_get_int(q, shift), \
60 (uint32_t)__PRIq_arg_get_frac(q, precision, shift)