From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28980 invoked by alias); 17 Dec 2007 18:38:23 -0000 Received: (qmail 28968 invoked by uid 22791); 17 Dec 2007 18:38:22 -0000 X-Spam-Check-By: sourceware.org Received: from uni11mr.unity.ncsu.edu (HELO uni11mr.unity.ncsu.edu) (152.1.224.170) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 17 Dec 2007 18:38:05 +0000 Received: from lakshmi (lakshmi.ece.ncsu.edu [152.14.22.51]) by uni11mr.unity.ncsu.edu (8.13.7/8.13.8/Nv5.2006.1109) with ESMTP id lBHIc1h4028498; Mon, 17 Dec 2007 13:38:02 -0500 (EST) From: "Balaji V. Iyer" To: "'Rask Ingemann Lambertsen'" Cc: References: <000c01c83a41$4499e240$33160e98@ece.ncsu.edu> <20071209130740.GI17368@sygehus.dk> <000d01c83a81$85462ca0$33160e98@ece.ncsu.edu> <20071210171542.GL17368@sygehus.dk> <002601c83c7c$b3763960$33160e98@ece.ncsu.edu> <20071212143508.GP17368@sygehus.dk> <20071217183242.GE17368@sygehus.dk> Subject: RE: Help with another constraint Date: Mon, 17 Dec 2007 20:31:00 -0000 Message-ID: <007701c840db$f4b92910$33160e98@ece.ncsu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <20071217183242.GE17368@sygehus.dk> Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2007-12/txt/msg00492.txt.bz2 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:rask@sygehus.dk] Sent: Monday, December 17, 2007 1:33 PM To: Balaji V. Iyer Cc: gcc@gcc.gnu.org; openrisc@opencores.org 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