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

[MiNT] GCC define for detecting FPU



Hello.

There is a big mess regarding to the GCC defines used to detect if the FPU is present or not.

When no FPU should be used, GCC does not define anything special.

When an FPU compatible with 68881 is, the standard GCC defines __HAVE_68881__. This is the case for GCC 4.x.

Unfortunately, and certainly by mistake, GCC 2.95.3 for MiNT never defines __HAVE_68881__ :-(

Instead, GCC 2.95.3 defines __M68881__. It works as expected in most common cases, but not all. For example, "-m68020-60 -soft-float" does not generate code for the FPU, but __M68881__ is still defined :-(

Currently, things are bad with GCC 4.x. It defines __HAVE_68881__ (the standard one), but the MiNTLib and PML checks for __M68881__.

Ideally, all the old code should be patched to test __HAVE_68881__ only, and GCC 2.95.3 should be patched to set that define. But it is a bit idealistic.

So I propose to patch GCC 4.x and *add* the nonstandard __M68881__ whenever the standard __HAVE_68881__ is defined. Old code will be automatically compatible. That define is nonstandard, so it should not hurt anything.
For new code, we will say: test __HAVE_68881__, forget about __M68881__.
If compatibility is required with the current GCC 2.95.3 binary, both defines should be tested.

Please tell me if you agree with this simple solution.

--
Vincent Rivière