From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26654 invoked by alias); 23 Mar 2007 11:31:03 -0000 Received: (qmail 26641 invoked by uid 22791); 23 Mar 2007 11:31:02 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 23 Mar 2007 11:30:59 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l2NBUtbP017410; Fri, 23 Mar 2007 07:30:55 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l2NBUte8020770; Fri, 23 Mar 2007 07:30:55 -0400 Received: from touchme.toronto.redhat.com (IDENT:postfix@touchme.toronto.redhat.com [172.16.14.9]) by pobox.toronto.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id l2NBUsGK021648; Fri, 23 Mar 2007 07:30:54 -0400 Received: from ton.toronto.redhat.com (ton.toronto.redhat.com [172.16.14.15]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 92DAB800287; Fri, 23 Mar 2007 06:30:54 -0500 (EST) Received: from ton.toronto.redhat.com (localhost.localdomain [127.0.0.1]) by ton.toronto.redhat.com (8.13.1/8.13.1) with ESMTP id l2NBUsS0003290; Fri, 23 Mar 2007 07:30:54 -0400 Received: (from fche@localhost) by ton.toronto.redhat.com (8.13.1/8.13.1/Submit) id l2NBUrnu003289; Fri, 23 Mar 2007 07:30:53 -0400 Date: Fri, 23 Mar 2007 11:31:00 -0000 From: "Frank Ch. Eigler" To: Chuan-Hua Chang Cc: cgen@sourceware.org Subject: Re: generated decoder code question Message-ID: <20070323113053.GR27273@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i 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: 2007-q1/txt/msg00067.txt.bz2 Hi - > In the utils-sim.scm file, the "-gen-decode-insn-entry" function has > the following lines: > ; Generate code to check that all of the opcode bits > for this insn match > [...] > It generates an IF-statement to check the opcode again inside the case > statement before doing the real extraction. This seems really > redundant I believe that this check is done because the switch statement by itself is not necessarily sufficient. The switch may simply disambiguate the instructions (so no two candidate instructions fall into the same switch case), but that could leave some additional decodeable bits. Those bits would need to be tested to tell apart the remaining candidate instruction from illegal opcodes. > and make the decoder inefficient. Do you have a sense of how frequently such a test is completely redundant, and how much additional time this test takes? - FChE