From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11027 invoked by alias); 15 May 2008 19:54:49 -0000 Received: (qmail 11014 invoked by uid 22791); 15 May 2008 19:54:48 -0000 X-Spam-Check-By: sourceware.org Received: from nf-out-0910.google.com (HELO nf-out-0910.google.com) (64.233.182.189) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 15 May 2008 19:54:05 +0000 Received: by nf-out-0910.google.com with SMTP id e27so236761nfd.30 for ; Thu, 15 May 2008 12:54:02 -0700 (PDT) Received: by 10.125.88.2 with SMTP id q2mr1711308mkl.106.1210881242719; Thu, 15 May 2008 12:54:02 -0700 (PDT) Received: by 10.86.31.7 with HTTP; Thu, 15 May 2008 12:54:02 -0700 (PDT) Message-ID: <7af24c80805151254s529be8eenc46c36262fd44dbb@mail.gmail.com> Date: Sun, 01 Jun 2008 14:14:00 -0000 From: "Kai Henningsen" To: "Jim Blandy" Subject: Re: Some CGEN problems Cc: "Frank Ch. Eigler" , cgen@sources.redhat.com In-Reply-To: <8f2776cb0804221018m29a5c764o536eceb901a8d894@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_4084_16981785.1210881242716" References: <7af24c80804191023q318f850do9db5458352163d19@mail.gmail.com> <7af24c80804211206x6e0f505fo1748b3af85a6d397@mail.gmail.com> <8f2776cb0804221018m29a5c764o536eceb901a8d894@mail.gmail.com> 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: 2008-q2/txt/msg00013.txt.bz2 ------=_Part_4084_16981785.1210881242716 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 811 On Tue, Apr 22, 2008 at 7:18 PM, Jim Blandy wrote: > CGEN was designed for risc-like architectures, with few instruction > sizes. CISC architectures are difficult to incorporate. I don't think it's that ... Anyway, I think the following is simple enough that I'll just put it in the public domain. It allows me to use perl in the .cpu file - well, in the file that the .cpu file is generated from (or, for that matter, in any other text file). One needs to escape characters that are special in perl strings - mainly dollar. Application looks as follows: (... normal cgen stuff ...) ! for my $i (@list) { ! for my $j (@otherlist) { (... normal cgen stuff, with vatiables $i and $j ...) ! } ! } (... normal cgen stuff ...) and then domac.pl xxx.cpu.in xxx.cpu Script attached. ------=_Part_4084_16981785.1210881242716 Content-Type: application/x-perl; name=domac.pl Content-Transfer-Encoding: base64 X-Attachment-Id: f_fg9rcgk60 Content-Disposition: attachment; filename=domac.pl Content-length: 1074 IyEgL3Vzci9iaW4vcGVybCAtdwoKdXNlIHN0cmljdDsKCm15ICRzcmMgPSBz aGlmdDsKb3BlbiBTUkMsICc8JywgJHNyYyBvciBkaWUgIiRzcmM6ICQhIjsK bXkgJHBlcmwgPSAiL3RtcC9kb21hYyQkLnBsIjsKb3BlbiBQRVJMLCAnPics ICRwZXJsIG9yIGRpZSAiJHBlcmw6ICQhIjsKbXkgJGRlc3QgPSBzaGlmdDsK cHJpbnQgUEVSTCA8PFBIRFI7CiMhIC91c3IvYmluL3BlcmwgLXcKCnVzZSBz dHJpY3Q7CgpteSBcJGRlc3QgPSAnJGRlc3QnOwpvcGVuIERFU1QsICc+Jywg XCRkZXN0IG9yIGRpZSAiXCRkZXN0OiBcJCEiOwoKUEhEUgoKbXkgJGN0ciA9 IDA7Cm15ICRwcmludCA9IDA7CndoaWxlICg8U1JDPikgewoJdHIvXHJcbi8v ZDsKCWlmICgvXiEoLiopJC8pIHsKCQlteSAkZGF0YSA9ICQxOwoJCWlmICgk cHJpbnQpIHsKCQkJcHJpbnQgUEVSTCAiUFIkcHJpbnRcbiI7CgkJCSRwcmlu dCA9IDA7CgkJfQoJCXByaW50IFBFUkwgIiRkYXRhXG4iOwoJfQoJZWxzZSB7 CgkJbXkgJGRhdGEgPSAkXzsKCQlpZiAobm90ICRwcmludCkgewoJCQkkcHJp bnQgPSArKyRjdHI7CgkJCXByaW50IFBFUkwgIn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