> >  > Is there a way to get GCC to only use the FPU when we explicitly want
> >  > to use it (i.e. when we use doubles/floats)?  Is -msoft-float my only
> >  > option here?  Is there any sort of #pragma that could do the same
> >  > thing as -msoft-float (I didn't see one)?
> >
> >  To absolutely prevent use of FPRs, one must use -msoft-float.  The
> >  hard-float and soft-float ABIs are incompatible and one cannot mix
> >  object files.
> 
> There is a third option -mfloat-abi=softfp which stipulates that FP
> instructions can be used within functions but the parameter and return
> values are passed using the same conventions as soft float. soft and
> softfp-compiled files can be linked together, allowing you to mix code
> using FP instructions and not with source file granularity.

That's completely the opposite. mfloat-abi=softfp tells gcc to use FPU 
instructions while conforming to a nominally soft-float ABI.

The OP wants the opposite: Conform to a hard-float ABI without actually using 
FPU instructions. It is (in thory) possible to do this in a half-sane way, 
however it's also easy to end up with something very fragile that breaks more 
often than it works.

Paul

Reply via email to