From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3447 invoked by alias); 16 Jan 2012 14:32:26 -0000 Received: (qmail 3285 invoked by uid 22791); 16 Jan 2012 14:32:24 -0000 X-SWARE-Spam-Status: No, hits=3.4 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SARE_OBFU_VALUE X-Spam-Check-By: sourceware.org Received: from snt0-omc1-s48.snt0.hotmail.com (HELO snt0-omc1-s48.snt0.hotmail.com) (65.54.61.85) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 Jan 2012 14:32:06 +0000 Received: from SNT142-W18 ([65.55.90.9]) by snt0-omc1-s48.snt0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 16 Jan 2012 06:32:06 -0800 Message-ID: From: youssef fahmi To: Subject: Problem with instruction description Date: Mon, 16 Jan 2012 14:32:00 -0000 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact cgen-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sourceware.org X-SW-Source: 2012-q1/txt/msg00006.txt.bz2 Hello, I'm sorry for the previous mail, I do not know why there were "=C2" everywh= ere. I am working on the porting of binutils to a new architecture.This processo= r has an instruction of the form: ld rx,[r1] + imm6=A0[load the 32 bit word= at the address calculated from the contents=A0of r1 plus the 6 bit immedia= te value (multiplied by 4) ]In summary: rx <- mem[r1 + imm6 * 4] I need to generate code for this instruction, but only in the case=A0where = the code generator in the compiler generates a standard load,=A0but with an= offset appropriate for the imm6 value.=A0That is to say the immediate valu= e would be less than=A0256 and be a multiple of 4 (word access). This is the description that I am using at the moment:(df f-imm6x4 "imm6x4"= ()=A0 11 6 UINT=A0 ((value pc) (sra WI value (const 2)))=A0 ((value pc) (s= ll WI value (const 2))))(dnop imm6x4 "imm6x4" () h-uint f-imm6x4)(dni ldsta= ck-r1-imm6x4 "ldstack r1#imm6x4" =A0=A0=A0() =A0=A0=A0"ld $r1,[r1]+$imm6x4"= =A0(+ (f-stack-opcode #05) r1 imm6x4)=A0=A0() =A0=A0=A0()) =A0=A0However th= is description causes the "ld rx,[r1] + imm6" to be used=A0whenever the imm= ediate vallue is less than 256, and not JUST when=A0the offset is also a mu= ltiple of 4. How do I alter this description so that it only operates when the=A0immedia= te value is less than 256 AND ALSO a multiple of 4. I have already tried.... but this generates code with this instruction=A0in= these cases which are not appropriate.How do I achieve this?=A0I guess tha= t I'll have to create an attribute to handle this, but I could=A0not get an= attribute that suits me.=A0is there a way to create an attribute of type i= nteger, for example, but with=A0only specific integers not necessarily foll= owing. =A0 Thanks in advance =A0for your answer.Youssef=A0=20=09=09=20=09=20=20=20=09= =09=20=20