From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8343 invoked by alias); 25 Aug 2009 00:38:49 -0000 Received: (qmail 8335 invoked by uid 22791); 25 Aug 2009 00:38:49 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-ew0-f216.google.com (HELO mail-ew0-f216.google.com) (209.85.219.216) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 25 Aug 2009 00:38:42 +0000 Received: by ewy12 with SMTP id 12so3180467ewy.0 for ; Mon, 24 Aug 2009 17:38:39 -0700 (PDT) Received: by 10.210.87.11 with SMTP id k11mr5864211ebb.83.1251160719552; Mon, 24 Aug 2009 17:38:39 -0700 (PDT) Received: from ?192.168.2.99? (cpc2-cmbg8-0-0-cust61.cmbg.cable.ntl.com [82.6.108.62]) by mx.google.com with ESMTPS id 10sm352232eyz.51.2009.08.24.17.38.38 (version=SSLv3 cipher=RC4-MD5); Mon, 24 Aug 2009 17:38:39 -0700 (PDT) Message-ID: <4A9335C2.1030606@gmail.com> Date: Tue, 25 Aug 2009 00:38:00 -0000 From: Dave Korn User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: cgen@sourceware.org Subject: sim-model.scm @cpu@ vs @prefix@ confusion Content-Type: multipart/mixed; boundary="------------000305080704080806010705" 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/msg00075.txt.bz2 This is a multi-part message in MIME format. --------------000305080704080806010705 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 889 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 --------------000305080704080806010705 Content-Type: text/x-c; name="sim-model-cpu2prefix.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sim-model-cpu2prefix.diff" Content-length: 852 Index: sim-model.scm =================================================================== --- sim-model.scm (revision 141) +++ sim-model.scm (working copy) @@ -333,13 +333,13 @@ static void\n" CPU_PC_FETCH (cpu) = " (gen-sym (mach-cpu mach)) "_h_pc_get; CPU_PC_STORE (cpu) = " (gen-sym (mach-cpu mach)) "_h_pc_set; CPU_GET_IDATA (cpu) = @cpu@_get_idata; - CPU_MAX_INSNS (cpu) = @CPU@_INSN__MAX; + CPU_MAX_INSNS (cpu) = @PREFIX@_INSN__MAX; CPU_INSN_NAME (cpu) = cgen_insn_name; - CPU_FULL_ENGINE_FN (cpu) = @cpu@_engine_run_full; + CPU_FULL_ENGINE_FN (cpu) = @prefix@_engine_run_full; #if WITH_FAST - CPU_FAST_ENGINE_FN (cpu) = @cpu@_engine_run_fast; + CPU_FAST_ENGINE_FN (cpu) = @prefix@_engine_run_fast; #else - CPU_FAST_ENGINE_FN (cpu) = @cpu@_engine_run_full; + CPU_FAST_ENGINE_FN (cpu) = @prefix@_engine_run_full; #endif } --------------000305080704080806010705--