Hi Rask,
        First, Thank you very much for all help you have provided me. It
really help me finish my project.

This is what I did:

I capture all the moves regardless of the operand and then to move an
immediate into a regiser, I force a register:

here is the code for this:


      if (!no_new_pseudos)
        { 
          /* taking care of moving constant integers */
          if (GET_CODE (operands[1]) == CONST_INT)
            {
              rtx reg = gen_reg_rtx (SImode);

              emit_insn (gen_movsi (reg, operands[1]));
              operands[1] = gen_lowpart (QImode, reg);
            }
           /* moving memory operands */
          if (GET_CODE (operands[1]) == MEM)
            {
              rtx reg = gen_reg_rtx (SImode);

              emit_insn (gen_rtx_SET (SImode, reg,
                                  gen_rtx_ZERO_EXTEND (SImode,
                                                       operands[1])));

              operands[1] = gen_lowpart (QImode, reg);
            }
           /* moving register operands */
          if (GET_CODE (operands[0]) != REG)
            operands[1] = force_reg (QImode, operands[1]);
        }

I hope this helps.

-Balaji V. Iyer.

-- 
 
Balaji V. Iyer
PhD Student, 
Center for Efficient, Scalable and Reliable Computing,
Department of Electrical and Computer Engineering,
North Carolina State University.


-----Original Message-----
From: Rask Ingemann Lambertsen [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 17, 2007 1:33 PM
To: Balaji V. Iyer
Cc: gcc@gcc.gnu.org; [EMAIL PROTECTED]
Subject: Re: Help with another constraint

On Wed, Dec 12, 2007 at 03:35:09PM +0100, 'Rask Ingemann Lambertsen'
wrote:
> 
>    The movxx patterns are special and you'll need to hold the 
> compiler's hands a little. Since your target can't move immediates 
> directly to memory, you have to ask for a secondary reload to an 
> intermediate register. Use the target hook TARGET_SECONDARY_RELOAD.

   Actually, how do you do that? I can't see any place in the
documentation that says how TARGET_SECONDARY_RELOAD can be used for that
purpose.

--
Rask Ingemann Lambertsen
Danish law requires addresses in e-mail to be logged and stored for a
year

Reply via email to