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: David Edelsohn <dje dot gcc at gmail dot com>
- To: Robert Grimm <rfgrimm at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 16 Jan 2010 08:23:47 -0500
- Subject: Re: powerpc-eabi-gcc no implicit FPU usage
- References: <5522DE9B-4FBC-4199-B143-102763034AFD@gmail.com>
On Fri, Jan 15, 2010 at 6:42 PM, Robert Grimm <rfgrimm@gmail.com> wrote:
> Greetings all,
>
> I'm working with the powerpc-eabi architecture (specifically, the MPC563 processor). ?For some time we have been using GCC 3.4.3 and I noticed gcc generating code that makes use of the floating point registers for 64-bit integer loads and whatnot... which we don't want it to do as there are times when we disable the FPU. ?I'm aware of the -msoft-float option but we didn't want to use that as we only wanted it to not use FP registers in certain functions and not entire files. ?I was under the impression that a newer GCC wouldn't do this based on some old mailing posts I've read. ?I've just tried out GCC 4.4.2 and notice that the FP registers are still being used even though there is no explicit FPU usage going on in this particular part of the code.
>
> 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)?
Recent versions of GCC greatly decrease the use of FPRs for
non-floating point code, but do not prevent it.
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.
GCC is a compiler, not an assembler. It tries to optimize programs,
not read programmers' minds. If the person invoking the compiler does
not deny the resource to the compiler, it will try to use it when
profitable, which is what it should do.
David