This is the mail archive of the
mailing list for the GCC project.
Re: GCC floating point usage
- From: Michael Matz <matz at suse dot de>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: Richard Henderson <rth at redhat dot com>,Mark Mitchell <mark at codesourcery dot com>, Mike Stump <mrs at apple dot com>,Geoff Keating <geoffk at geoffk dot org>, "steby at enea dot se" <steby at enea dot se>,"gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Thu, 17 Oct 2002 01:35:34 +0200 (CEST)
- Subject: Re: GCC floating point usage
On Wed, 16 Oct 2002, Zack Weinberg wrote:
> > No, what I mean is that I'm with Geoff: you won't be able to
> > guarantee that the compiler does the right thing without a
> > completely different approach.
> > You're going to need the front/middle-end to indicate whether
> > "floating point has been used", and if not, hide *all* existance
> > of the fp registers from the register allocators. Nothing less
> > gives you assurance they won't be used.
> Okay. Care to suggest how this should be accomplished?
Multiple possibilities: either change fixed_regs per function to either
include or exclude those special regs, based on information from the
frontend or middleend.
Or create a regclass for all regs you intend to hide (FLOAT_REGS for
instance). Subtract that class from the possible hardreg candidates for
pseudos in regclass.c (or probably better directly in global.c, or even
right in reload*.c). Look e.g. for STACK_REGS in global.c how a similar
case is handled. Do this also conditionalized on information on the
front/middleend. If that information is incorrect you might end up with
reload aborting (e.g. when you indeed have insn which only accept floats,
while disallowing them).