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

Re: [MiNT] GCC return register



Henk Robbers wrote:
FYI.

Thanks for your precisions, Henk.
Now I will highlight the differences between AHCC and GCC, as a summary.

Pointers in A0

GCC for MiNT returns pointers to d0 (unlike GCC for m68k/Linux).

If compiled for FPU, floats in fp0

GCC currently do the same (except on ColdFire where d0 is used in any case), the discussion here is about changing this behavior or not.

Software floating point:

Doubles are, from a function's perspective, treated as structures.

This means that AHCC does not allow to mix 68000 code with 68020+FPU code (like the current GCC for MiNT).

With soft float, AHCC returns doubles through an extra pointer, whereas GCC returns doubles to d0/d1. This means that libraries (or manually written assembler functions) are incompatible between AHCC and GCC, it if was even possible.

There is also the question about returning structures. GCC can use 2 different schemes, I have not checked that. I'm not even sure that GCC 4.x do the same thing as GCC 2.95.3. To be investigated.

A Pure C program compiled for software fp can detect a FPU and thus
is able to be slightly more efficient.

This is one big difference from GCC.
GCC has no autodetect features, programs have to be compiled either for soft-float or FPU.

A program compiled for the FPU just crashes if no FPU is present,

This is the exception to the previous rule. The MiNTLib startup code used by GCC autodetects the CPU with cookies (68000, 68020+, ColdFire) and FPU, then display an explicit message and exit cleanly if the current system is incompatible.

--
Vincent Rivière