This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC floating point usage
- From: Stefan Bylund <steby at enea dot se>
- To: David Edelsohn <dje at watson dot ibm dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 14 Oct 2002 19:10:32 +0200
- Subject: Re: GCC floating point usage
- Organization: OSE Systems
- References: <200210141637.MAA28330@makai.watson.ibm.com>
The reason why I am asking this is because in the OSE RTOS, the kernel will only save the
floating point registers for a process at context switch if that process has ever used a
floating point register. If a process never uses a floating point register its context
switch will be more efficient. So, if a process executes code that utilizes the floating
point registers for non-floating point purposes, its context switches will be less
efficient. Ideally, we only want processes that actually uses the floating point registers
for actual floating point purposes to pay the price of a less efficient context switch.
/Stefan
David Edelsohn wrote:
> >>>>> Stefan Bylund writes:
>
> Stefan> In GCC 3.2 for powerpc-eabi, when enabling hardware floating point, GCC will
> Stefan> generate floating point instructions not only for C/C++ float/double operations
> Stefan> but also internally for optimizing non-floating point 64-bit data transfers etc.
>
> Stefan> Is it possible to somehow instruct GCC to only generate floating point
> Stefan> instructions for C/C++ float/double operations and not for internal non-floating
> Stefan> point optimizations etc?
>
> If you do not want to use the FPU, then invoke the compiler with
> the -msoft-float PowerPC option. If the FPRs are present and it is
> efficient to use them, the compiler will use them.
>
> David
begin:vcard
n:Bylund;Stefan
tel;cell:+46 709 714 325
tel;work:+46 8 507 143 25
x-mozilla-html:FALSE
url:http://www.ose.com
org:OSE Systems
adr:;;Nytorpsvägen 5;Täby;;183 23;Sweden
version:2.1
email;internet:steby@enea.se
title:Software Engineer
fn:Stefan Bylund
end:vcard