From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 374 invoked by alias); 25 Aug 2009 05:41:43 -0000 Received: (qmail 366 invoked by uid 22791); 25 Aug 2009 05:41:41 -0000 X-SWARE-Spam-Status: No, hits=0.0 required=5.0 tests=AWL,BAYES_00,DNS_FROM_RFC_BOGUSMX,J_CHICKENPOX_33 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; Tue, 25 Aug 2009 05:41:36 +0000 Received: from sspiff.sspiff.org (seba.sebabeach.org [10.8.159.10]) by sebabeach.org (Postfix) with ESMTP id DC11E6E3D0; Mon, 24 Aug 2009 22:41:34 -0700 (PDT) Message-ID: <4A93798E.1070603@sebabeach.org> Date: Tue, 25 Aug 2009 05:41:00 -0000 From: Doug Evans User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: Dave Korn CC: cgen@sourceware.org Subject: Re: sim-model.scm @cpu@ vs @prefix@ confusion References: <4A9335C2.1030606@gmail.com> In-Reply-To: <4A9335C2.1030606@gmail.com> 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-q3/txt/msg00076.txt.bz2 Dave Korn wrote: > Hi CGEN, > > It looks to me like there are a couple of spots in -gen-mach-defns where the > prefix should be used instead of the cpu, specifically when referencing > *_INSN__MAX and in the names of the *_engine_run_* functions. Certainly > that's how genmloop.sh and friends expect them to look. I had to apply the > attached patch otherwise I get undefined references in the generated mloop.c, > so here it is. > > cgen/ChangeLog: > > * sim-model.scm (-gen-mach-defns): Replace @cpu@ and @CPU@ by @prefix@ > and @PREFIX@ when setting CPU_MAX_INSNS and the CPU_*_ENGINE_FNs. > > I'm not sure about the relation between cpu and prefix yet, but in my > generated files the prefix appears to be a concatenation of isa and cpu. > Maybe in other ports the prefix ends up just being equal to the cpu and that's > why this hasn't caused any problems in /src? I didn't investigate yet. > > cheers, > DaveK > > Thanks for the patch! I looked into this and you are correct. I'll apply the patch tomorrow. For reference sake, prefix is set here in src/sim/common/cgen.sh. This explains where _ is coming from. if test -z "$isa" ; then isa=all prefix=$cpu else prefix=${cpu}_$isa fi [Seems like the test should be $isa == "" || $isa == "all", but that's another patch.]