1111#include <stddef.h>
1212#include <stdint.h>
1313
14- #ifndef DEBUG_FIXED_POINT
15- #define DEBUG_FIXED_POINT 0
16- #endif
17-
1814struct fp_32_64 {
1915 uint32_t l0 ; /* unshifted value */
2016 uint32_t l32 ; /* value shifted left 32 bits (or bit -1 to -32) */
2117 uint32_t l64 ; /* value shifted left 64 bits (or bit -33 to -64) */
2218};
2319
24- #include "fixed_point_debug.h"
25-
2620static inline void
2721fp_32_64_div_32_32 (struct fp_32_64 * result , uint32_t dividend , uint32_t divisor ) {
2822 uint64_t tmp ;
@@ -76,7 +70,6 @@ fp_32_64_div_32_64(struct fp_32_64 *result, uint32_t dividend, uint64_t divisor)
7670static inline uint64_t
7771mul_u32_u32 (uint32_t a , uint32_t b , int a_shift , int b_shift ) {
7872 uint64_t ret = (uint64_t )a * b ;
79- debug_mul_u32_u32 (a , b , a_shift , b_shift , ret );
8073 return ret ;
8174}
8275
@@ -97,8 +90,6 @@ u64_mul_u32_fp32_64(uint32_t a, struct fp_32_64 b) {
9790 res_l32_32 = res_l32 ;
9891 ret = res_0 + (res_l32_32 >> 31 ); /* Round to nearest integer */
9992
100- debug_u64_mul_u32_fp32_64 (a , b , res_0 , res_l32_32 , ret );
101-
10293 return ret ;
10394}
10495
@@ -117,8 +108,6 @@ u32_mul_u64_fp32_64(uint64_t a, struct fp_32_64 b) {
117108 res_l32 += mul_u32_u32 (a_0 , b .l64 , 0 , -64 ) >> 32 ; /* Improve rounding accuracy */
118109 ret = (res_l32 >> 32 ) + ((uint32_t )res_l32 >> 31 ); /* Round to nearest integer */
119110
120- debug_u32_mul_u64_fp32_64 (a , b , res_l32 , ret );
121-
122111 return ret ;
123112}
124113
@@ -150,8 +139,6 @@ u64_mul_u64_fp32_64(uint64_t a, struct fp_32_64 b) {
150139 res_l32_32 = res_l32 ;
151140 ret = res_0 + (res_l32_32 >> 31 ); /* Round to nearest integer */
152141
153- debug_u64_mul_u64_fp32_64 (a , b , res_0 , res_l32_32 , ret );
154-
155142 return ret ;
156143}
157144
0 commit comments