From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19431 invoked by alias); 3 Sep 2002 14:38:27 -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 19394 invoked from network); 3 Sep 2002 14:38:27 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 3 Sep 2002 14:38:27 -0000 Received: from tooth.toronto.redhat.com (tooth.toronto.redhat.com [172.16.14.29]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 99739B8832; Tue, 3 Sep 2002 10:38:26 -0400 (EDT) Received: (from bje@localhost) by tooth.toronto.redhat.com (8.11.6/8.11.6) id g83EcOH06286; Tue, 3 Sep 2002 10:38:24 -0400 From: Ben Elliston MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15732.51552.667078.3400@tooth.toronto.redhat.com> Date: Tue, 03 Sep 2002 07:38:00 -0000 To: =?gb2312?B?5rEg578=?= Cc: cgen@sources.redhat.com Subject: Re: Question about cpu description In-Reply-To: References: X-SW-Source: 2002-q3/txt/msg00043.txt.bz2 Hi. >>>>> "dam" == dam wang writes: dam> How do CGEN know what the vitual cpu would do when one Ins was excuted. I dam> mean, when I write the description file, nothing that describe the action dam> of each Ins(at least I haven't found it till after I read the exited m32r dam> description file.) is included. The CPU description includes a semantics definition that describes that the instruction does when it is executed. For example, from the M32R description: (dni addv3 "addv3" () "addv3 $dr,$sr,$simm16" (+ OP1_8 OP2_8 dr sr simm16) (parallel () (set dr (add sr simm16)) (set condbit (add-oflag sr simm16 (const 0)))) () ) So, `dr' is set to the sum of `sr' and `simm16' and the condbit is set accordingly. The instruction semantics are defined using a register transfer language similar to GCC -- you can read more about it in the CGEN manual. There is an entire chapter dedicated to CGEN RTL. Ben