From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10750 invoked by alias); 10 May 2006 17:57:32 -0000 Received: (qmail 10738 invoked by uid 22791); 10 May 2006 17:57:30 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 10 May 2006 17:57:28 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k4AHvQYl013750 for ; Wed, 10 May 2006 13:57:26 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k4AHvQeF000996 for ; Wed, 10 May 2006 13:57:26 -0400 Received: from [172.16.14.227] (IDENT:9JEpyxK+Xu9ZYhtntnuUD0cY2+pRKPPW@topaz.toronto.redhat.com [172.16.14.227]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id k4AHvQAc000767 for ; Wed, 10 May 2006 13:57:26 -0400 Message-ID: <44622986.3090309@redhat.com> Date: Wed, 10 May 2006 17:57:00 -0000 From: Dave Brolley User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) MIME-Version: 1.0 To: cgen@sources.redhat.com Subject: [patch][commit] New (if (...) (...) (...)) Test Allowed at Top Level of the Input Content-Type: multipart/mixed; boundary="------------090001050300070503040403" X-IsSubscribed: yes Mailing-List: contact cgen-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sourceware.org X-SW-Source: 2006-q2/txt/msg00025.txt.bz2 This is a multi-part message in MIME format. --------------090001050300070503040403 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 399 Hi, I've committed the attach patch. I allows the psecification of (if (application-is? ) (true expr) (false expr)) at the top level of the CGEN input. This test corresponds to (eq? application ) which is found in many places in the CGEN source. For example (if (application-is? SID-SIMULATOR) (include "sid-macros.cpu") (include "sim-macros.cpu")) Dave --------------090001050300070503040403 Content-Type: text/plain; name="cgen-if.ChangeLog" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="cgen-if.ChangeLog" Content-length: 179 2006-05-10 Dave Brolley * read.scm (cmd-if): Provide the correct argument to reader-error. Add support for (if (application-is? ) (...) (...)). --------------090001050300070503040403 Content-Type: text/plain; name="cgen-if.patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="cgen-if.patch.txt" Content-length: 1330 Index: cgen/read.scm =================================================================== RCS file: /cvs/src/src/cgen/read.scm,v retrieving revision 1.13 diff -c -p -r1.13 read.scm *** cgen/read.scm 10 May 2006 16:24:53 -0000 1.13 --- cgen/read.scm 10 May 2006 17:45:17 -0000 *************** Define a preprocessor-style macro. *** 796,803 **** (cons 'if (cons test (cons then else))) "")) ; ??? rtx-eval test ! (if (not (memq (car test) '(keep-isa? keep-mach?))) ! (reader-error "only (if (keep-mach?|keep-isa? ...) ...) is currently supported")) (case (car test) ((keep-isa?) (if (keep-isa? (cadr test)) --- 796,803 ---- (cons 'if (cons test (cons then else))) "")) ; ??? rtx-eval test ! (if (not (memq (car test) '(keep-isa? keep-mach? application-is?))) ! (reader-error "only (if (keep-mach?|keep-isa?|application-is? ...) ...) are currently supported" test "")) (case (car test) ((keep-isa?) (if (keep-isa? (cadr test)) *************** Define a preprocessor-style macro. *** 810,815 **** --- 810,821 ---- (eval1 then) (if (null? else) #f + (eval1 (car else))))) + ((application-is?) + (if (eq? APPLICATION (cadr test)) + (eval1 then) + (if (null? else) + #f (eval1 (car else)))))) ) --------------090001050300070503040403--