From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3364 invoked by alias); 25 Jan 2007 15:00:06 -0000 Received: (qmail 3353 invoked by uid 22791); 25 Jan 2007 15:00:05 -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; Thu, 25 Jan 2007 14:59:56 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id l0PExsFC014348; Thu, 25 Jan 2007 09:59:54 -0500 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 l0PExrZL014951; Thu, 25 Jan 2007 09:59:54 -0500 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 l0PExrKi004354; Thu, 25 Jan 2007 09:59:53 -0500 Received: from ton.toronto.redhat.com (ton.toronto.redhat.com [172.16.14.15]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 6C5F38001CF; Thu, 25 Jan 2007 09:59:53 -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 l0PExrSQ031486; Thu, 25 Jan 2007 09:59:53 -0500 Received: (from fche@localhost) by ton.toronto.redhat.com (8.13.1/8.13.1/Submit) id l0PExoxK031485; Thu, 25 Jan 2007 09:59:50 -0500 Date: Thu, 25 Jan 2007 15:00:00 -0000 From: "Frank Ch. Eigler" To: Joern Rennecke Cc: cgen@sources.redhat.com Subject: Re: CGEN_DIS_HASH: how to get endianness and/or instruction size? Message-ID: <20070125145950.GA30933@redhat.com> References: <20070125142036.GA18395@elsdt-razorfish.arc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070125142036.GA18395@elsdt-razorfish.arc.com> 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/msg00025.txt.bz2 Hi - On Thu, Jan 25, 2007 at 02:20:36PM +0000, Joern Rennecke wrote: > [...] So, inside CGEN_DIS_HASH, how can I get the first 16 bits of > the instruction, represented in host byte order? > If I want to dereference the buffer pointer, I need to know the > target endianness. Use the "value" parameter (a host-endian copy of the "base insn") rather than the "buffer" parameter. > If I want to use the passed instruction value, I need to know what > size it is. [...] See m32r_cgen_dis_hash: a hand-written baby insn classifier routine. It is important to realize though that this disassembler hashing widget is strictly an optimization. You can try hard-coding the hash value to 0 like some other cgen platforms, and see if the performance is bearable. - FChE