The results
below can only give a rough estimate of the resources necessary for using
certain library functions. There is a number of factors which can both increase
or reduce the effort required:
Avr-gcc version is 4.2.2
Функция |
Units |
Avr2 |
Avr25 |
Avr4 |
atoi ("12345") |
Flash
bytes |
82 |
78 |
74 |
atol ("12345") |
Flash
bytes |
122 |
118 |
118 |
dtostre (1.2345, s, 6, 0) |
Flash
bytes |
1184 |
1088 |
1088 |
dtostrf (1.2345, 15, 6, s) |
Flash
bytes |
1676 |
1548 |
1548 |
itoa (12345, s, 10) |
Flash
bytes |
150 |
134 |
134 |
ltoa (12345L, s, 10) |
Flash
bytes |
220 |
200 |
200 |
malloc (1) |
Flash
bytes |
556 |
508 |
508 |
realloc ((void *)0, 1) |
Flash
bytes |
1156 |
1046 |
1046 |
qsort (s,
sizeof(s), 1, cmp) |
Flash
bytes |
1242 |
990 |
1008 |
sprintf_min (s, "%d", 12345) |
Flash
bytes |
1216 |
1090 |
1086 |
sprintf (s, "%d", 12345) |
Flash
bytes |
1674 |
1542 |
1498 |
sprintf_flt (s, "%e", 1.2345) |
Flash
bytes |
3334 |
3084 |
3040 |
sscanf_min ("12345", "%d", &i) |
Flash
bytes |
1528 |
1378 |
1390 |
sscanf ("12345", "%d", &i) |
Flash
bytes |
1880 |
1724 |
1694 |
sscanf_flt ("1.2345", "%e", &x) |
Flash
bytes |
4250 |
3916 |
3886 |
strtod ("1.2345", &p) |
Flash
bytes |
1638 |
1550 |
1514 |
strtol ("12345", &p, 0) |
Flash
bytes |
956 |
888 |
822 |
The table
contains the number of MCU clocks to calculate a function with a given
argument(s). The main reason of a big difference between Avr2 and Avr4 is a
hardware multiplication.
Function |
Avr2 |
Avr4 |
__addsf3 (1.234, 5.678) |
113 |
108 |
__mulsf3 (1.234, 5.678) |
375 |
138 |
__divsf3 (1.234, 5.678) |
466 |
465 |
acos (0.54321) |
4648 |
2689 |
asin (0.54321) |
4754 |
2790 |
atan (0.54321) |
4710 |
2271 |
atan2 (1.234, 5.678) |
5270 |
2857 |
ceil (1.2345) |
177 |
177 |
cos (1.2345) |
3381 |
1665 |
cosh (1.2345) |
4922 |
2979 |
exp (1.2345) |
4708 |
2765 |
fdim (5.678, 1.234) |
111 |
111 |
floor (1.2345) |
180 |
180 |
fmax (1.234, 5.678) |
39 |
37 |
fmin (1.234, 5.678) |
35 |
35 |
fmod (5.678, 1.234) |
132 |
132 |
frexp (1.2345, 0) |
37 |
36 |
hypot (1.234, 5.678) |
1556 |
1078 |
ldexp (1.2345, 6) |
42 |
42 |
log (1.2345) |
4142 |
2134 |
log10 (1.2345) |
4498 |
2260 |
modf (1.2345, 0) |
433 |
429 |
pow (1.234, 5.678) |
9293 |
5047 |
round (1.2345) |
150 |
150 |
sin (1.2345) |
3347 |
1647 |
sinh (1.2345) |
4946 |
3003 |
sqrt (1.2345) |
709 |
704 |
tan (1.2345) |
4375 |
2420 |
tanh (1.2345) |
5126 |
3173 |
trunc (1.2345) |
178 |
178 |
Automatically generated by Doxygen 1.5.2 on 21
Dec 2007.