[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Newest GCC + Binutils compile status



MiKRO wrote:
I took a look into netbsd's libm -- it's based on fdlibm as you guessed but it's made much more intelligent than sparemint's one. on netbsd there are three targets, m68k, m68881 and m68060 and each target contains math functions for each FPU -- i.e. m68k has none, so everything is built (emulated functions in C), m68881 has sin function so it's just wrapper to fsin instruction, m68060 hasn't sinf but it's wrapped to 060 FPSP by motorola.

Good !

Note that GCC itself has the notion of "builtin functions". For some well-known functions (including math), GCC do not actually call the functions, it simply replaces the well-known function call by the precomputed result. When the function arguments are not constant, and when it is possible, GCC tries to replace the function call with an FPU call (for example, fabs() inside libm.a is never called, the FPU instuction "fabs" is always used instead).

A similar optimization occurs with printf("foo\n").
GCC actually calls puts("foo") !

--
Vincent Rivière