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

Re: [MiNT] GCC return register

On 15 November 2011 at 23:46, Vincent Rivière <vincent.riviere@freesbee.fr> wrote:
Alan Hourihane wrote:
What was the outcome of this topic as I can't see what happened in my
thread archives.

Finally we chose the compatible way:
- integers are returned into d0
- pointers are returned into d0 (not a0)
- float/doubles are returned into d0/d1 (not fp0)

The above applies to m6800/m68020-60/m5475.
So mixing the libraries is now compatible (while not recommended). The only exception is the "long double" type for ColdFire.

The rule above is consistently used in the GCC libs, the MiNTLib and PML. As a result POV-Ray (as a testcase) works fine when compiled for the 3 targets.

On a second though, this was quite a disastrous move. ;-) It had started with PML being wrong (using d0/d1 as return regs) and escalated into this state. Why disastrous? Because of the stupid PML I have now two huge completely irreparable projects (Silkcut and Ocean Machine; Quake used a bit less asm functions and I was able to repair it few years ago): back in 2008 I had still preferred compilation on native hardware and/or aranym (mainly because of working gdb with gcc 2.95). gcc 2.95 uses FPU regs. Everything was great, I could use the latest gcc for the final build.

Forward 7 years later and I'm found with two projects with tens and tens of FPU asm code which will never again be compilable with the latest gcc.

I don't know whether is too late to change this (we don't have any other distro that sparemint which is still compiled against the old gcc = old FPU method) but I'd strongly appreciate remaining backward compatibility on this one. ;) (plus, it will be more effective code, too).

MiKRO / Mystic Bytes