public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
From: Doug Evans <dje@transmeta.com>
To: Dave Brolley <brolley@redhat.com>
Cc: cgen@sources.redhat.com, sid@sources.redhat.com
Subject: Re: [RFC] New cpu --- Morpho ms1
Date: Wed, 15 Jun 2005 21:46:00 -0000	[thread overview]
Message-ID: <17072.41406.147361.75051@casey.transmeta.com> (raw)
In-Reply-To: <42B09F6F.7020302@redhat.com>

Eewwwww!

Imagine if bison or autoconf had encoded in them knowledge of particular
applications that used them.
[The analogy doesn't port 1-1, but the eewww-ness is equivalent.]

Dave Brolley writes:
 > Index: cgen/rtl-c.scm
 > ===================================================================
 > RCS file: /cvs/src/src/cgen/rtl-c.scm,v
 > retrieving revision 1.5
 > diff -c -p -r1.5 rtl-c.scm
 > *** cgen/rtl-c.scm	16 Jul 2003 05:35:47 -0000	1.5
 > --- cgen/rtl-c.scm	15 Jun 2005 20:58:26 -0000
 > ***************
 > *** 1305,1311 ****
 >   			"bad arg to `operand'" object-or-name)))
 >   )
 >   
 > ! (define-fn xop (estate options mode object) object)
 >   
 >   (define-fn local (estate options mode object-or-name)
 >     (cond ((rtx-temp? object-or-name)
 > --- 1305,1327 ----
 >   			"bad arg to `operand'" object-or-name)))
 >   )
 >   
 > ! (define-fn xop (estate options mode object) 
 > !   (let ((delayed (assoc '#:delay (estate-modifiers estate))))
 > !     (if (and delayed
 > ! 	     (equal? APPLICATION 'SID-SIMULATOR)
 > ! 	     (operand? object))
 > ! 	;; if we're looking at an operand inside a (delay ...) rtx, then we
 > ! 	;; are talking about a _delayed_ operand, which is a different
 > ! 	;; beast.  rather than try to work out what context we were
 > ! 	;; constructed within, we just clone the operand instance and set
 > ! 	;; the new one to have a delayed value. the setters and getters
 > ! 	;; will work it out.
 > ! 	(let ((obj (object-copy object))
 > ! 	      (amount (cadr delayed)))
 > ! 	  (op:set-delay! obj amount)
 > ! 	  obj)
 > ! 	;; else return the normal object
 > ! 	object)))
 >   
 >   (define-fn local (estate options mode object-or-name)
 >     (cond ((rtx-temp? object-or-name)
 > ***************
 > *** 1364,1372 ****
 >     (cx:make VOID "; /*clobber*/\n")
 >   )
 >   
 > ! (define-fn delay (estate options mode n rtx)
 > !   (s-sequence (estate-with-modifiers estate '((#:delay))) VOID '() rtx) ; wip!
 > ! )
 >   
 >   ; Gets expanded as a macro.
 >   ;(define-fn annul (estate yes?)
 > --- 1380,1417 ----
 >     (cx:make VOID "; /*clobber*/\n")
 >   )
 >   
 > ! 
 > ! (define-fn delay (estate options mode num-node rtx)
 > !   (case APPLICATION
 > !     ((SID-SIMULATOR)
 > !      (let* ((n (cadddr num-node))
 > ! 	    (old-delay (let ((old (assoc '#:delay (estate-modifiers estate))))
 > ! 			 (if old (cadr old) 0)))
 > ! 	    (new-delay (+ n old-delay)))    
 > !        (begin
 > ! 	 ;; check for proper usage
 > !      	 (if (let* ((hw (case (car rtx) 
 > ! 			  ((operand) (op:type (rtx-operand-obj rtx)))
 > ! 			  ((xop) (op:type (rtx-xop-obj rtx)))
 > ! 			  (else #f))))		    	       
 > ! 	       (not (and hw (or (pc? hw) (memory? hw) (register? hw)))))
 > ! 	     (context-error 
 > ! 	      (estate-context estate) 
 > ! 	      (string-append 
 > ! 	       "(delay ...) rtx applied to wrong type of operand '" (car rtx) "'. should be pc, register or memory")))
 > ! 	 ;; signal an error if we're delayed and not in a "parallel-insns" CPU
 > ! 	 (if (not (with-parallel?)) 
 > ! 	     (context-error 	      
 > ! 	      (estate-context estate) 
 > ! 	      "delayed operand in a non-parallel cpu"))
 > ! 	 ;; update cpu-global pipeline bound
 > ! 	 (cpu-set-max-delay! (current-cpu) (max (cpu-max-delay (current-cpu)) new-delay))      
 > ! 	 ;; pass along new delay to embedded rtx
 > ! 	 (rtx-eval-with-estate rtx mode (estate-with-modifiers estate `((#:delay ,new-delay)))))))
 > ! 
 > !     ;; not in sid-land
 > !     (else (s-sequence (estate-with-modifiers estate '((#:delay))) VOID '() rtx))))
 > ! 

  reply	other threads:[~2005-06-15 21:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-08 20:19 Dave Brolley
2005-06-13 14:55 ` Frank Ch. Eigler
2005-06-15 21:37   ` Dave Brolley
2005-06-15 21:46     ` Doug Evans [this message]
2005-06-16 14:22       ` Dave Brolley
2005-06-16 15:22       ` Frank Ch. Eigler
2005-06-16 15:42         ` Doug Evans
2005-06-16 15:49           ` Frank Ch. Eigler
2005-06-16 16:04             ` Doug Evans
2005-06-15 21:39   ` Dave Brolley
2005-06-14 10:25 ` Nick Clifton
2005-06-15 15:40   ` Dave Brolley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17072.41406.147361.75051@casey.transmeta.com \
    --to=dje@transmeta.com \
    --cc=brolley@redhat.com \
    --cc=cgen@sources.redhat.com \
    --cc=sid@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).