1 /* SPDX-License-Identifier: MIT */
2 
3 /* Copyright 2024 Advanced Micro Devices, Inc. */
4 
5 #ifndef SPL_CUSTOM_FLOAT_H_
6 #define SPL_CUSTOM_FLOAT_H_
7 
8 #include "spl_os_types.h"
9 #include "spl_fixpt31_32.h"
10 
11 struct spl_custom_float_format {
12 	uint32_t mantissa_bits;
13 	uint32_t exponenta_bits;
14 	bool sign;
15 };
16 
17 struct spl_custom_float_value {
18 	uint32_t mantissa;
19 	uint32_t exponenta;
20 	uint32_t value;
21 	bool negative;
22 };
23 
24 bool spl_convert_to_custom_float_format(
25 	struct spl_fixed31_32 value,
26 	const struct spl_custom_float_format *format,
27 	uint32_t *result);
28 
29 #endif //SPL_CUSTOM_FLOAT_H_
30