From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12831 invoked by alias); 26 Jan 2007 01:31:16 -0000 Received: (qmail 12822 invoked by uid 22791); 26 Jan 2007 01:31:16 -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, 26 Jan 2007 01:31:11 +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 l0Q1V9xE030811; Thu, 25 Jan 2007 20:31:09 -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 l0Q1V8Es012927; Thu, 25 Jan 2007 20:31:08 -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 l0Q1V8I3011791; Thu, 25 Jan 2007 20:31:08 -0500 Received: from ton.toronto.redhat.com (ton.toronto.redhat.com [172.16.14.15]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 43DCC8001CA; Thu, 25 Jan 2007 20:31:08 -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 l0Q1V7qW027232; Thu, 25 Jan 2007 20:31:07 -0500 Received: (from fche@localhost) by ton.toronto.redhat.com (8.13.1/8.13.1/Submit) id l0Q1V7nQ027231; Thu, 25 Jan 2007 20:31:07 -0500 Date: Fri, 26 Jan 2007 01:31: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: <20070126013107.GH30933@redhat.com> References: <20A30789B9F48C4E9D71A188EFE8042C2BC65C@elexch01.arc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20A30789B9F48C4E9D71A188EFE8042C2BC65C@elexch01.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/msg00029.txt.bz2 Hi - joern wrote: > [...] > The top 5 bits of the first 16 bit word are what is known as major > opcode field. [...] > I reckon that, given a suitably endian-correted input, > I could make an adequate hash by using a switch based on > the 5 bit major opcode to decide which bits from the first 16 > bit word to use. Heck, just use those five bits. > I had already written the hash function, only to discover that the > endian check depended on an argument that was not passed to my > macro/function. You should use the *value* rather than *buf* input. > Its easy to change his code into incorrect and/or useless (return 0) > code that will compile [...] It is neither incorrect nor useless. It just means that the hash table will be degenerate, and a linear search will be required for each disassembled instruction. It won't hurt anyone and will only slightly worsen global warming. > Unless otherwise expressly stated, this message does not create or vary = > any contractual relationship between you and ARC International. [...] That's a relief! - FChE