This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: HARD_REGNO_MODE_OK_FOR_CLASS Might Be Nice (tm)
- From: Joern RENNECKE <joern dot rennecke at st dot com>
- To: From:Bernd Jendrissek <berndj at prism dot co dot za>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 03 Jan 2006 17:25:55 +0000
- Subject: Re: HARD_REGNO_MODE_OK_FOR_CLASS Might Be Nice (tm)
In http://gcc.gnu.org/ml/gcc/2005-12/msg00642.html, Bernd Jendrissek wrote:
> Which leads me to the subject. Would it be a win to have a macro
> HARD_REGNO_MODE_OK_FOR_CLASS (REGNO, MODE, CLASS) which would be the
> authoritative test for this loop in find_reg()? On my port, and I
> imagine on many others too, I think a default
>
> #ifndef HARD_REGNO_MODE_OK_FOR_CLASS
> #define HARD_REGNO_MODE_OK_FOR_CLASS(REGNO, MODE, CLASS) \
> HARD_REGNO_MODE_OK ((REGNO), (MODE))
> #endif
>
> would be okay.
It's not that simple. For example, consider multi-word integer arithmetic.
If you want to allocate a 32 bit integer register on your 16 bit x86,
all the integer registers are suitable as parts of the allocation.
However, if you start with the last integer register, the second part
will end up in a hard register which is not an integer register.
So to make this work, you's have to say that the last integer register is
not suitable for SImode, SFmode or CHImode, the last three ones are not
suitable for DImode, DFmode, CSImode or SCmode etc.