From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21979 invoked by alias); 20 Dec 2009 09:04:02 -0000 Received: (qmail 21969 invoked by uid 22791); 20 Dec 2009 09:04:01 -0000 X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL,BAYES_00,DNS_FROM_RFC_BOGUSMX X-Spam-Check-By: sourceware.org Received: from sebabeach.org (HELO sebabeach.org) (64.165.110.50) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 20 Dec 2009 09:03:57 +0000 Received: from sspiff.sspiff.org (seba.sebabeach.org [10.8.159.10]) by sebabeach.org (Postfix) with ESMTP id 2EA5A6E3DC; Sun, 20 Dec 2009 01:03:56 -0800 (PST) Message-ID: <4B2DE87B.2030806@sebabeach.org> Date: Sun, 20 Dec 2009 09:04:00 -0000 From: Doug Evans User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: "Frank Ch. Eigler" , dj@redhat.com, cgen@sourceware.org Subject: better use of disassembly hash table by mep port Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2009-q4/txt/msg00048.txt.bz2 I think I understand the MEP port enough to have it starting using the disassembly hash table better (rather than hashing every insn to the same slot, blech). The basics have always been there, we just need to extend it a little. [Another way to go, of course, is to add a simulator-style decoder to the disassembler. There's various reasons why I didn't do that in the beginning. It'll probably be useful to add it some day.] AIUI, different MEP ISAs use different opcode bits and so the hashing is useless ... if one tries to hash *all* insns for *all* ISAs in *one* table. But if one takes the current isa/mach/config into account when doing the hashing and ignore insns that don't match it, I think a useful hash is possible. Right? [I'm assuming the chip doesn't do something excessively funky and that for any particular isa/mach/config context there are *some* opcode bits common to all relevant instructions for that context.] I gather the MEP port doesn't do that because more parameters are used to decide whether an insn is valid for the current context than what cgen currently uses (which is isa/mach/endian). See mep.opc:mep_cgen_insn_supported. If we enhance the disassembler's instruction recognizer hash table builder to let the target record additional parameters to use to decide when a new CGEN_CPU_DESC needs to be created, and let the target provide routines to access/use that info, I think that's all that's needed. Plus , of course, a hash function - I think the code can pick something at runtime if the port doesn't provide one. E.g. pick all the bits that are constant in the first instruction word. An N-stage hash could be done for ISAs that have few common bits among all insns, but have more common bits among groups of instructions. Maybe we could even use/borrow the simulator's decoder-generator to drive it. Comments? Am I missing anything?