Tool/software:
Hello,
We are currently trying to divide uint64_t by 1000 (integer division). This operation takes a lot of time for our usecase, and we figured that a faster approach would be to convert the value into double, and multiply it by 0.001. However, this still doesn't suffice our needs, and is still too slow. After examining alternative methods, we found out that there is an option to do a division with one multiplication and one right shift operation. Basically, we calculate a quotient like this:
M = (2^60 +24)/1000 = 1.152.921.504.606.847 (0x4189374BC6A7F).
Then we multiply our number with it: R = M * N (where N is our number which we want to divide), and then we shift it by 60 to the right: O = ((2^60 +24)/1000) * (N / 2^60).
This leaves us with N/1000 + (24*N)/(1000*2^60), which seems to be a nice approximation.
Is it possible and how to multiply two 64bit unsigned values to get a 128bit unsigned value which we can use later on (to extract higher and lower part) on C71 DSP TDA4?
Best Regards,
Ogi.