ribblem
Joined: 30 Dec 2005 Posts: 1
|
PCWH 3.241 odd math performance |
Posted: Fri Dec 30, 2005 9:34 pm |
|
|
I just got the dev board and compiler so I thought I'd run some simple perf numbers to verify that I'm getting numbers similar to those on page 264 of the "C Compiler Reference Manual". Since the pic18f6722 dev board is only clocked at 20 MHz I expected my performance to be about half as fast as the numbers in the book. Also I'm including a store in my benchmarks so I should be a little slower. I found my numbers agree for int8, int16, and int32. However my float numbers are much faster than the book values. So much so with mul that the float mul is significantly faster than the in32 mul. I didn't take the time to understand the algorithms used for the float math, but I'm wondering if people have run into accuracy problems? Is there a way to force a slower, but more accurate float lib to be used? I didn't do any accuracy testing on the floating point algorithms, but I've never seen a processor without floating point hardware having faster floating point math than integer math while having good accuracy for floats. Let me know if this is the first case of this and I'll be happy (and have to take the time to understand their algorithm).
Here are the results I got from testing performance. The first number is the number of instruction clocks and the second number is microseconds.
Mult
int8 is: 4 1
int16 is: 30 6
int32 is: 228 46
float is: 134 27
Div
int8 is: 97 19
int16 is: 304 61
int32 is: 988 198
float is: 1056 211
Add
int8 is: 3 1
int16 is: 6 1
int32 is: 12 2
float is: 132 26 |
|