This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: What to do when constraint doesn't match
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: "'Mohamed Shafi'" <shafitvm at gmail dot com>, <gcc at gcc dot gnu dot org>
- Date: Thu, 15 Mar 2007 10:23:26 -0000
- Subject: RE: What to do when constraint doesn't match
- References: <ba0bd44d0703142159w1785f3bawdbaf814aaa8e2c06@mail.gmail.com>
On 15 March 2007 05:00, Mohamed Shafi wrote:
> I have a define_expand with the pattern name mov<mode> and a
> define_insn mov<mode>_store
> The predicate in define_expand is general_operand, so that all
> operands are matched.
> While in define_insn i have a predicate which allows only two class of
> registers say 'a' and 'b'. But the constraint for define_insn only
> allows registers of class 'b'.
>
> I also have a pattern for register move from 'a' to 'b', call it
> mov<mode>a2b. So if for mov<mode>_store define_insn constraint
> doesn't satisfy why is that the compiler is not trying to match the
> constraint by generating a mov<mode>a2b pattern? Is there something
> that i am missing here?
Secondary reloads. IIUIC (I'm up to my neck in this area of the compiler
myself ATM!) you use them to tell the compiler it needs to use a temporary
register of class 'a' to move any value (that isn't a REG or SUBREG already in
class 'b') into a reg of class 'b'. Look at `SECONDARY_RELOAD_CLASS', and
`reload_inM' and `reload_outM' in the internals docs.
cheers,
DaveK
--
Can't think of a witty .sigline today....