This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: powerpc-eabi-gcc no implicit FPU usage
- From: Kai Henningsen <kai at khms dot eu>
- To: Paul Brook <paul at codesourcery dot com>
- Cc: gcc at gcc dot gnu dot org, Martin Guy <martinwguy at gmail dot com>, David Edelsohn <dje dot gcc at gmail dot com>, Robert Grimm <rfgrimm at gmail dot com>
- Date: Wed, 20 Jan 2010 19:04:08 +0100
- Subject: Re: powerpc-eabi-gcc no implicit FPU usage
- References: <5522DE9B-4FBC-4199-B143-102763034AFD@gmail.com> <303e1d291001160523t59af08e1q109f45e08ba3157@mail.gmail.com> <56d259a01001160600j77fc2d55l5eadca301fc0eee9@mail.gmail.com> <201001162314.03033.paul@codesourcery.com>
Am Samstag, den 16.01.2010, 23:14 +0000 schrieb Paul Brook:
> > > > 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.
If the whole source file does not need to use fp, could you get the
intended effect using -ffixed-REG for all FP registers?