From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29614 invoked by alias); 16 Jun 2002 15:04:23 -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 29599 invoked from network); 16 Jun 2002 15:04:22 -0000 Received: from unknown (HELO mf1.bredband.net) (195.54.122.119) by sources.redhat.com with SMTP; 16 Jun 2002 15:04:22 -0000 Received: from cockmaster ([213.112.126.65]) by mf1.bredband.net with ESMTP id <20020616150421.UNE668.mf1@cockmaster>; Sun, 16 Jun 2002 17:04:21 +0200 Date: Sun, 16 Jun 2002 08:04:00 -0000 From: Johan Rydberg To: "Frank Ch . Eigler" Cc: cgen@sources.redhat.com Subject: Re: adjusting cgen Message-ID: <20020616170816.A8517@cockmaster.bredbandsbolaget.se> References: <20020612041320.C16968@cockmaster.bredbandsbolaget.se> <20020612111310.A24036@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit In-Reply-To: <20020612111310.A24036@redhat.com>; from fche@redhat.com on Wed, Jun 12, 2002 at 17:13:10 +0200 X-SW-Source: 2002-q2/txt/msg00021.txt.bz2 On 2002.06.12 17:13 Frank Ch. Eigler wrote: : : [...] : : If nothing else, they could be detected within the branch instruction : semantics. They could set some private simulator state that signals : that the previously identified imem page is still valid. Or even better, : this logic could be put into the general instruction execution loop : directly: if the new PC is on the same page as the old PC, then use : the previous value. The main idea behind GUSS is "decode once -- execute many". To achive this, the insn is decoded into a intermediate format (similar to argbuf). And the simulator engine is using threaded code, implemented using GCC's computed goto's. This means that there's really no general insn execution loop. Another idea behind GUSS is that special cases, such as on-page branching should be specialized and optimized. These special cases are, to increase performance, detected at decoding time. : > [...] : : Are you sure that this is a worthwhile thing to do? You should mark : up the generated sources by hand once, and see if it makes a positive : or negative impact on performance. If it's positive for interesting : hosts, we should do this cgen-wide. The reason for me to wanting this is that my intermediate format is built of two words, one pointing to the insn semantics, and one containing the insn arguments. Trying to minimize the intermediate format gains both memory bandwidth when simulting (just loading one word, and then shift and mask), and will save memory. And if the size of intermediate format is a power of two, you can eliminate the update of the PC for every instruction, and instead use the difference between the PC and the intermediate format pointer. example; PC = pc_diff + (vpc >> S); Where S is the difference between the size of the intermediate format and the insn length. (for a architecture with 32-bit insn, and an intermediate format of 64-bits, S is 1). Many hosts also has insns to load 64-bit instructions into a register pair. : > If you're intressted in the simulator, you can find information (ie : > the sources) at http://savannah.gnu.org/projects/guss/ . : : Not to be discouraging, but can you explain why you'd like to build a : new simulator framework, when you're welcome to make contributions to : established ones like sid and even the older gdb simulators? (It's of : course a good personal learning exercise to build things from scratch, : but please realize that there is a *lot* of work involved in making a : nice, fully featured framework.) The main reason for doing this to gain more personal knowledge of simulators, and what technices that can be used to increase the performance. And to try out some of the ideas I have, I think it's easier to write something from scratch than to learn all the internals of either SID or GDB. regards johan (sorry for the delayed reply, I've been at a music festival for the last four days).