From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30791 invoked by alias); 12 Dec 2007 14:35:37 -0000 Received: (qmail 30781 invoked by uid 22791); 12 Dec 2007 14:35:36 -0000 X-Spam-Check-By: sourceware.org Received: from pfepa.post.tele.dk (HELO pfepa.post.tele.dk) (195.41.46.235) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 12 Dec 2007 14:35:22 +0000 Received: from x1-6-00-0f-9f-c6-3e-90 (unknown [80.197.1.215]) by pfepa.post.tele.dk (Postfix) with ESMTP id F27ADFAC05D; Wed, 12 Dec 2007 15:35:14 +0100 (CET) Received: from x1-6-00-0f-9f-c6-3e-90 (localhost.localdomain [127.0.0.1]) by x1-6-00-0f-9f-c6-3e-90 (8.14.0/8.14.0) with ESMTP id lBCEZDJq003148; Wed, 12 Dec 2007 15:35:13 +0100 Received: (from rask@localhost) by x1-6-00-0f-9f-c6-3e-90 (8.14.0/8.14.0/Submit) id lBCEZAbJ003140; Wed, 12 Dec 2007 15:35:10 +0100 Date: Wed, 12 Dec 2007 15:21:00 -0000 From: "'Rask Ingemann Lambertsen'" To: "Balaji V. Iyer" Cc: gcc@gcc.gnu.org, openrisc@opencores.org Subject: Re: Help with another constraint Message-ID: <20071212143508.GP17368@sygehus.dk> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <002601c83c7c$b3763960$33160e98@ece.ncsu.edu> User-Agent: Mutt/1.5.14 (2007-02-12) 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/msg00371.txt.bz2 On Wed, Dec 12, 2007 at 12:06:04AM -0500, Balaji V. Iyer wrote: > Hello Everyone, > I got past that negdi2 and some errors..now I am trying to compile > some linux module, and it says I am not able to find this constraint: > > init/main.c: In function 'start_kernel': > init/main.c:441: error: insn does not satisfy its constraints: > (insn 112 110 478 12 (set (mem:QI (reg/v/f:SI 16 r16 [orig:72 line.183 ] > [72]) [0 S1 A8]) > (const_int 0 [0x0])) 16 {movqi} (nil) > (nil)) > init/main.c:441: internal compiler error: in > reload_cse_simplify_operands, at postreload.c:391 > Please submit a full bug report, > > Here is what I have for movqi: 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. When you've got the secondary reloads working, you can likely improve code quality: 1) Use a movqi expander to expand the instructions correctly to begin with. For example, if operand 0 is in memory and operand 1 is an immediate, use operands[1] = force_reg (QImode, operands[1]); Rename the "movqi" insn to "*movqi". > (define_insn "movqi" > [(set (match_operand:QI 0 "nonimmediate_operand" "=p,q,m,m,p,q,p,q") > (match_operand:QI 1 "general_operand" "m,m,p,q,p,q,I,I"))] > "" ^^ 2) Reject operand combinations that aren't supported, such as operand 0 being in memory and operand 1 being an immediate. You can look at other RISC targets (e.g. ARM, PA-RISC, MIPS, SPARC, Alpha or RS6000) for examples. > "* New ports should not use the old-style "* ... " C-blocks. Use { ... } as documented. Then you'll also avoid the \" and \\ sequences. > switch(which_alternative) > { > case 0: > case 1: > return \"l.lbz \\t%0,%1\"; > case 2: > case 3: > return \"l.sb \\t%0,%1\"; > case 4: > case 5: > return \"l.ori \\t%0,%1,0\\t # move reg to reg\"; > case 6: > case 7: > return \"l.addi \\t%0,r0,%1\\t # move immediate\"; > default: > return \"invalid alternative\"; > } Presumably you've temporarily coded it this way for debugging purposes. If not, use the normal way: "@ l.lbz ... l.sb ... ..." > To give a quick explanation: > p = register numbers between 0-31 (inclusive) > q = register numbers between 32-63 (inclusive) You use them in pairs a lot. Define a register class which consists of registers 0-64 and use that in your constraints. -- Rask Ingemann Lambertsen Danish law requires addresses in e-mail to be logged and stored for a year