From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21344 invoked by alias); 19 Oct 2009 13:29:57 -0000 Received: (qmail 21330 invoked by uid 22791); 19 Oct 2009 13:29:56 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-fx0-f226.google.com (HELO mail-fx0-f226.google.com) (209.85.220.226) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Oct 2009 13:29:52 +0000 Received: by fxm26 with SMTP id 26so7960741fxm.23 for ; Mon, 19 Oct 2009 06:29:50 -0700 (PDT) Received: by 10.223.132.204 with SMTP id c12mr988188fat.32.1255958990219; Mon, 19 Oct 2009 06:29:50 -0700 (PDT) Received: from ?163.242.202.161? ([91.213.169.4]) by mx.google.com with ESMTPS id l19sm312978fgb.6.2009.10.19.06.29.34 (version=SSLv3 cipher=RC4-MD5); Mon, 19 Oct 2009 06:29:35 -0700 (PDT) Message-ID: <4ADC6A35.4020709@gmail.com> Date: Mon, 19 Oct 2009 13:29:00 -0000 From: Dmitry Eremin-Solenikov User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706) MIME-Version: 1.0 To: Doug Evans CC: cgen@sources.redhat.com Subject: Re: Instruction w/ prefix References: <4AD7ABC4.3080105@sebabeach.org> In-Reply-To: <4AD7ABC4.3080105@sebabeach.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2009-q4/txt/msg00017.txt.bz2 Hello, Doug Evans wrote: > Dmitry Eremin-Solenikov wrote: >> Hello, >> >> I'm using cgen to create binutils port for the CISC architecture >> (M68HC(S)08 if somebody cares). I've stumbled upon one problem: the is >> an instruction prefix which can change meaning >> of the next instruction (basically it then uses SP register instead of >> IX one). >> >> What is the most clean way to do this w/ cgen? I can of course >> duplicate instruction fields, counting another byte in the beginning, >> instructions, etc.. This will permit me to catch illegal combinations. >> OTOH it doesn' look like completely clean idea. >> >> What would you suggest? >> >> > > Hi. Sorry for the slow reply. > > I think the right solution (which I wouldn't wait for) is to extend cgen > to handle instruction prefixes. Do you have any ideas how to implement (or at least design) this? As for me, the prefix just changes the addressing (prefixed instruction just uses SP as a base instead of IX register). > In the meantime, I would treat the prefix as its own instruction. Yep, I've tried this approach. However I've stumbled upon the fact that cgen just sums all specified values, thus leading me into problems. I'm currently looking into how to overcome this. Maybe you can suggest a sample which I can look upon? -- With best wishes Dmitry