On Friday 21 December 2007 16:15, Weddington, Eric wrote: [...] > A completely rewritten floating-point library, contributed by Dmitry > Xmelkov. It is smaller and faster, but as it's an almost full rewrite.
A correction is needed: The speed: yes. But the size is not a strong feature of new fplib/math library. The size is consederably reduced for printing functions (dtostre, dtostrf, printf), which are not use more float point operations. From NEWS file: + The fplib/math library is completely rewritten. Now features of the IEEE 754 standard are supported all: negative zero, subnormals, Infs and NaNs. It concerns both to base operations (arithmetic, comparison...), and to all functions. Speed of performance is increased, sometimes considerably. A number of mistakes (not reflected in the Bugs) which led severe losses of accuracy for some arguments is corrected. A number of new functions is added. It is necessary to note, that the new library concedes old under the charge of flash memory a little. Dmitry. =========================================================== Old comparison tables (today the results may be different a little): Flash, bytes. Function + tables and needed mudules. gcc/fp-bit 1.4.2 1.5 File avr2 avr4 avr2 avr4 avr2 avr4 ----------------------------------------------------- t_add.c 1870 1650 290 290 376 364 t_cmp.c 852 786 156 156 88 88 t_div.c 1298 1208 296 296 372 368 t_flt2llng.c 6162 5662 -1 -1 220 216 t_flt2long.c 556 526 152 152 178 174 t_llng2flt.c 3350 3014 -1 -1 164 164 t_long2flt.c 826 778 234 234 122 122 t_mul.c 1532 1438 312 300 376 358 t_frexp.c -1 -1 130 128 154 152 t_ldexp.c -1 -1 212 212 234 232 t_modf.c -1 -1 464 464 490 466 t1_acos.h -1 -1 1020 972 1030 956 t1_asin.h -1 -1 1004 956 1110 1032 t1_atan.h -1 -1 880 824 1054 980 t1_ceil.h -1 -1 210 210 252 250 t1_cos.h -1 -1 1060 1008 928 860 t1_cosh.h -1 -1 1170 1118 1364 1280 t1_exp.h -1 -1 1142 1090 1328 1244 t1_floor.h -1 -1 206 206 252 250 t1_log10.h -1 -1 950 902 1112 1038 t1_log.h -1 -1 938 890 1096 1022 t1_sin.h -1 -1 1086 1034 934 866 t1_sinh.h -1 -1 1172 1120 1450 1362 t1_sqrt.h -1 -1 552 552 286 276 t1_tan.h -1 -1 1128 1072 1186 1112 t1_tanh.h -1 -1 1238 1186 1478 1390 t1_trunc.h -1 -1 -1 -1 228 226 t2_atan2.h -1 -1 974 918 1204 1116 t2_fdim.h -1 -1 -1 -1 448 434 t2_fmax.h -1 -1 -1 -1 66 62 t2_fmin.h -1 -1 -1 -1 66 62 t2_fmod.h -1 -1 798 786 304 302 t2_hypot.h -1 -1 -1 -1 1102 1052 t2_pow.h -1 -1 1426 1368 1856 1758 t_dtostre.c -1 -1 1934 1874 1022 952 t_dtostrf.c -1 -1 1712 1640 1604 1452 t_strtod.c -1 -1 1020 992 1472 1370 t_base.c 3982 3586 732 720 1120 1086 t_lib14.c -1 -1 2626 2562 3440 3310 t_lib15.c -1 -1 -1 -1 4286 4126 The 't_lib14.c' test is a set of all fp/math fuctions, which are present in avr-libc 1.4. Average time of function execution, CPU cycles. gcc/fp-bit 1.4.2 1.5 File avr2 avr4 avr2 avr4 avr2 avr4 ----------------------------------------------------- t_add.c 959 890 126 126 113 110 t_cmp.c 515 486 57 57 42 42 t_div.c 1458 1418 483 483 467 466 t_flt2llng.c 11564 10913 -1 -1 119 118 t_flt2long.c 369 358 189 189 68 68 t_llng2flt.c 6899 6482 -1 -1 81 81 t_long2flt.c 841 745 264 264 55 55 t_mul.c 2179 2077 364 133 347 125 t_frexp.c -1 -1 34 33 34 33 t_ldexp.c -1 -1 49 49 39 39 t_modf.c -1 -1 775 775 395 391 t1_acos.h -1 -1 6527 4565 4691 2700 t1_asin.h -1 -1 6380 4417 4107 2317 t1_atan.h -1 -1 5513 3087 4813 2375 t1_ceil.h -1 -1 285 285 118 118 t1_cos.h -1 -1 6250 3827 3440 1730 t1_cosh.h -1 -1 5545 3825 4866 2890 t1_exp.h -1 -1 4586 2908 4227 2292 t1_floor.h -1 -1 274 274 117 117 t1_log10.h -1 -1 7277 4603 4776 2437 t1_log.h -1 -1 6783 4111 4424 2304 t1_sin.h -1 -1 6377 3963 3338 1632 t1_sinh.h -1 -1 5500 3785 4555 2696 t1_sqrt.h -1 -1 1815 1815 711 706 t1_tan.h -1 -1 5881 3738 3843 1893 t1_tanh.h -1 -1 5659 3992 4824 2931 t1_trunc.h -1 -1 -1 -1 114 114 t2_atan2.h -1 -1 6248 3825 5284 2833 t2_fdim.h -1 -1 -1 -1 74 72 t2_fmax.h -1 -1 -1 -1 31 30 t2_fmin.h -1 -1 -1 -1 31 30 t2_fmod.h -1 -1 1545 1321 127 127 t2_hypot.h -1 -1 -1 -1 1483 1054 t2_pow.h -1 -1 12336 7777 9122 4870 t_dtostre.c -1 -1 10851 8619 1058 953 t_dtostrf.c -1 -1 18951 13202 1376 1243 t_strtod.c -1 -1 1459 1025 1193 934 Avr-libc-1.4.5: Flash, bts Stack, bts Time, clks Function avr2 avr4 avr2 avr4 avr2 avr4 -------------------------------------------------------------- sprintf(s,"%x",12345) 1914 1700 68 68 5731 5598 sprintf(s,"%d",12345) 1914 1700 68 68 7054 6894 sprintf(s,"%e",1.2345) 4658 4158 138 138 12025 9885 Avr-libc-CVS: Flash, bts Stack, bts Time, clks Function avr2 avr4 avr2 avr4 avr2 avr4 -------------------------------------------------------------- sprintf(s,"%x",12345) 1690 1500 57 57 1078 1010 sprintf(s,"%d",12345) 1690 1500 57 57 1714 1616 sprintf(s,"%e",1.2345) 3302 3004 64 64 2502 2283 ============================================================== _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list