This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: What to do when constraint doesn't match


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....


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]