Subject: Re: ARM ELF toolchain patches
To: Ben Harris <bjh21@cam.ac.uk>
From: Richard Earnshaw <rearnsha@buzzard.freeserve.co.uk>
List: port-arm32
Date: 02/28/2001 00:18:17
> In article <Pine.NEB.4.30.0102272206440.11503-100000@crowley.our-flat.net> you write:
> >> Nope, the compiler doesn't use them.  But -mhard-float changes the calling
> >> convention for floating point functions.  Code compiled -mhard-float
> >> expects a floating point result to be returned in a floating point
> >> register; code compiled -msoft-float expects it in r0(+r1 for doubles).
> >> So the problem is that you cannot link the system libraries into your
> >> program if you are expecting floating point results back.
> >
> >Just out of academic interest how feasible would it be/what would be the
> >major downside to having a gcc option that passed FP arguments on the
> >stack/in integer registers for function calls, but used the FPA otherwise.
> 
> Erm, I think that's what -mno-apcs-float is meant to do.  Whether it works
> is another matter.

Nope.  APCS-FLOAT governs argument passing.  Result return for hard float 
is always in an FP register.

> 
> >Would this not permit interoperation between soft-float and hard-float
> >code?
> 
> It wouldn't quite.  You'd still have to propogate exception flags and trap
> enabling between the FPA and the softfloat code.

You'd also have to make setjmp/longjmp save and restore f4-f7.

R.