Hi,
my customer test the division speed of 2 unsigned integer,
Uint32 a, Uint 32 b. c=a/b.
The "/" takes around 40 cycles, and they think it's too long.
Are there any way other than "/" to do the division which is faster?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
my customer test the division speed of 2 unsigned integer,
Uint32 a, Uint 32 b. c=a/b.
The "/" takes around 40 cycles, and they think it's too long.
Are there any way other than "/" to do the division which is faster?
Can you check what the disassembly looks like? Is it something like this?
MOVB ACC,#0 ; Zero ACC
MOVL P,@Num32 ; Load P register with Num32
RPT #31 ; Repeat operation 32 times
||SUBCUL ACC,@Den32 ; Conditional subtract with Den32
MOVL @Rem32,ACC ; Store remainder in Rem32
MOVL @Quot32,P ; Store quotient in Quot32
Thanks,
Sira