This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: GCC floating point usage
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Richard dot Earnshaw at arm dot com
- Cc: David Edelsohn <dje at watson dot ibm dot com>, Mark Mitchell <mark at codesourcery dot com>, Geoff Keating <geoffk at geoffk dot org>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 26 Feb 2003 09:14:02 -0800
- Subject: Re: GCC floating point usage
- References: <200302261546.h1QFkuH03204@pc960.cambridge.arm.com>
Richard Earnshaw <rearnsha at arm dot com> writes:
> I missed the start of the *BSD discussion, but if it's anything like the
> one that Mike is referring to that occurred on this list, then the issue
> is to discourage (severly) the first use of the floating point registers
> when there are no floating point operations in a function; otherwise we
> might pay a very large penalty in the kernel for the very first use and
> fairly large penalties after each context switch if the kernel switches
> the FP context on a lazy basis.
I'd like to remind everyone that the patch Mike refers to deals with a
slightly different situation, viz. where use of floating point in an
unanticipated context causes a correctness failure, not just a
performance penalty. Which means...
> It seems to me that the best solution to this would be to have a new cost
> metric that expressed this discouragement directly, maybe
> CLASS_FIRST_USE_COST(class) which could then be set to a large value to
> express what really happens. Once the threshold has been crossed the
> register allocator would then be free to use the registers as it would
> normally.
... that, while this is an interesting idea, I'm not convinced it
would provide a sufficiently ironclad guarantee that floating point
instructions will _never_ be emitted unless floating point operations
appear in the same function. Discouragement is not good enough.
(Maybe there's a notion of "infinite cost" or something that could be
applied -- I don't know a whole lot about register classes and costs.)
zw