public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* [patch][commit] New (if (...) (...) (...)) Test Allowed at Top Level  of the Input
@ 2006-05-10 17:57 Dave Brolley
  2006-05-10 18:11 ` Doug Evans
  0 siblings, 1 reply; 6+ messages in thread
From: Dave Brolley @ 2006-05-10 17:57 UTC (permalink / raw)
  To: cgen

[-- Attachment #1: Type: text/plain, Size: 399 bytes --]

Hi,

I've committed the attach patch. I allows the psecification of

(if (application-is? <appname>)
    (true expr)
    (false expr))

at the top level of the CGEN input. This test corresponds to (eq? 
application <appname>) 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


[-- Attachment #2: cgen-if.ChangeLog --]
[-- Type: text/plain, Size: 179 bytes --]

2006-05-10  Dave Brolley  <brolley@redhat.com>

	* read.scm (cmd-if): Provide the correct argument to reader-error. Add
	support for (if (application-is? <appname>) (...) (...)).

[-- Attachment #3: cgen-if.patch.txt --]
[-- Type: text/plain, Size: 1330 bytes --]

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))))))
  )
  

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-05-11 20:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-10 17:57 [patch][commit] New (if (...) (...) (...)) Test Allowed at Top Level of the Input Dave Brolley
2006-05-10 18:11 ` Doug Evans
2006-05-11 11:52   ` Thien-Thi Nguyen
2006-05-11 14:12     ` Dave Brolley
2006-05-11 16:45       ` Jim Blandy
2006-05-11 20:52         ` Doug Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).