5#ifndef ZEPHYR_INCLUDE_ZEPHYR_DSP_PRINT_FORMAT_H
6#define ZEPHYR_INCLUDE_ZEPHYR_DSP_PRINT_FORMAT_H
30#define PRIq(precision) "s%" PRIu32 ".%0" STRINGIFY(precision) PRIu32
35 return llabs(q) >> -shift;
37 return llabs(q) << shift;
41#define __EXP2(a, b) a ## b
42#define __EXP(a, b) __EXP2(a ## e, b)
43#define __CONSTPOW(C, x) __EXP(C, x)
45#define __PRIq_arg_shift(q, shift) ___PRIq_arg_shift(q, ((shift) + (8 * (4 - (int)sizeof(q)))))
46#define __PRIq_arg_get(q, shift, h, l) FIELD_GET(GENMASK64(h, l), __PRIq_arg_shift(q, shift))
47#define __PRIq_arg_get_int(q, shift) __PRIq_arg_get(q, shift, 63, 31)
48#define __PRIq_arg_get_frac(q, precision, shift) \
49 ((__PRIq_arg_get(q, shift, 30, 0) * __CONSTPOW(1, precision)) / INT32_MAX)
58#define PRIq_arg(q, precision, shift) \
59 ((q) < 0 ? "-" : ""), (uint32_t)__PRIq_arg_get_int(q, shift), \
60 (uint32_t)__PRIq_arg_get_frac(q, precision, shift)
__INT64_TYPE__ int64_t
Definition: stdint.h:75
static long long llabs(long long __n)
Definition: stdlib.h:70