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

MiNTlibs & FPU?



Hi,

I have just noticed MiNTlibs for CPU >= 68020 are compiled with -m68881,
so it requires FPU. That means 030 optimized programs that are linked
with MiNTlibs do not run on FPU less Falcons, PAKs and 68LC040 equipped
machines, even if the compiled program does not need FPU itself. I
consider this as an unhappy situation.

I compiled MiNTlibs both with and without the -m68881 switch
and found out that just three files were different: atof.o, doprnt.o and
scanf.o. All these files contain specific -m68881 and fps004
support and also 'normal' C code for FPU operations (note that I don't
know these FPU related things well, so I may be mistaken).

I think it would be cool to include both -m68881 (native FPU) and normal
functions (FPU not req'd) into the MiNTlibs and use either the native
(if machine has got FPU) or the emulated ones (if there's no FPU found).

PureC libs contain hack to test the presence of real FPU - there's one
FPU insns in the crt0 and they hook on the illegal insn vector. Quite
odd, as it caused problems in TOSemu (a TOS emulator under Linux).
We are more lucky as we can easily check the '_FPU' cookie.

What do you think? I believe it would be useful to have one library that
runs on both FPU and nonFPU machines. And if I got it right, it should
be easy to do that within current MiNTlibs.

Petr
--
E-mail: stehlik@cas3.zlin.vutbr.cz                        PARCP developer
   WWW: http://cas3.zlin.vutbr.cz/~stehlik/              MiNTOS/Linux user
mirror: http://users.zln.cz/~pstehlik/                 Atari 800XL emulation
mirror: http://www.stehlik.cyberstrider.org/              Atari Falcon040