From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30508 invoked by alias); 10 Jun 2003 14:56:08 -0000 Mailing-List: contact cgen-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sources.redhat.com Received: (qmail 30419 invoked from network); 10 Jun 2003 14:56:07 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 10 Jun 2003 14:56:07 -0000 Received: from redhat.com (to-dhcp3.toronto.redhat.com [172.16.14.103]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 2311480001E; Tue, 10 Jun 2003 10:56:07 -0400 (EDT) Message-ID: <3EE5F1FC.8060701@redhat.com> Date: Tue, 10 Jun 2003 14:56:00 -0000 From: Dave Brolley User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20021216 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jan Zizka Cc: cgen@sources.redhat.com Subject: Re: Insns with similar mnemonics References: <20030610112137.24146.qmail@web41511.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-q2/txt/msg00086.txt.bz2 I usually end up ordering the insns in the .cpu file so that the most restrictive insn (in your case move13meml) appears first. CGEN currently attempts the insns in the order in which they appear in the .cpu file. Even with a parse handler, this is often necessary to prevent an unintended variant from parsing successfully. I've never seen this ordering behavior documented anywhere. It sould be nice if we could get a definitive statement in the documentation about it, since many existing ports rely on it. Dave Jan Zizka wrote: >Hi! > >I have a small problem with correcly assembling following insns (only examle): > >move x:(r0+symbol1),x0 >move x:symbol2,x0 > >since the pharenteses might be aswell part of a symbol the first instruction is >interpreted as it would be second one. This will of course make r0, which is >really a register, undefined symbol. Now I have added my own parse function for >that, but it's really not elegat :(. Any suggestions? See my insn definitions >below: > >(dni move13meml/allreg "move x:(Rn+xxxx),DDDDD" > () > ("move x:($r+$imm16),$d5cap") > (+ (f-op-4 #xF) d5cap (f-op-bit-2/6 #x10) r imm16) > () > () >) > >(dni move14mem/allreg "move x:imm16,DDDDD" > () > ("move x:$imm16,$d5cap") > (+ (f-op-4 #xF) d5cap (f-op--7 #x54) imm16) > () > () >) > >Thanks! > Jan > >