Topic : RC51 - arithmetic library - slow 32bit division

Forum : 8051

Original Post
Post Information Post
May 23, 2007 - 4:45pm
Guest

Signed 32bit (long) division is the slowest basic calculation for most compilers. However, in RC51 I'm surprised at how much slower it is than other operations. The call C_SLDIV_SP takes typically 2200 machine cycles. That's 100usec on a 22MHz single-cycle 8051. By comparsion 16bit division e.g C_UIDIV, takes roughly 60 cycles.

Is the time for C_SLDIV_SP reasonable? For now I have to beware of using it in some signal processing paths. This is the one routine whose optimisation, it that's possible, would help me most.

Thanks Steven Pruzina

Replies
Post Information Post
+1
0
-1
May 23, 2007 - 7:10pm
Guest

if you have a problem with the time it takes to do 32 bit operations, you should not have selected a 8 bit processor.

Erik

+1
0
-1
May 23, 2007 - 7:21pm
Guest

Hi Erik

Well... hindsight is always 20:20. Also, Silicon Labs remain a good fit for my application overall. The slow 32bit divide isn't a killer; I'm just asking Raisonance if it is unreasonably long relative to the other arithmetic operations in their library.

Steven

+1
0
-1
May 23, 2007 - 8:06pm
Guest

2200 machine cycles. . By comparsion 16bit division e.g C_UIDIV, takes roughly 60 cycles.

well 60 squared is 3600, so 2000 sounds great

Erik