From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16148 invoked by alias); 15 Jun 2005 21:46:43 -0000 Mailing-List: contact sid-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: sid-owner@sources.redhat.com Received: (qmail 16129 invoked by uid 22791); 15 Jun 2005 21:46:40 -0000 Received: from neon-gw-l3.transmeta.com (HELO neon-gw.transmeta.com) (63.209.4.196) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 15 Jun 2005 21:46:40 +0000 Received: from victor.transmeta.com (victor.transmeta.com [10.0.2.120]) by neon-gw.transmeta.com (Postfix) with ESMTP id 4BCB25F8050; Wed, 15 Jun 2005 14:46:36 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by localhost.transmeta.com (Postfix) with ESMTP id 81CFF4F802C; Wed, 15 Jun 2005 14:46:38 -0700 (PDT) Received: from victor.transmeta.com ([127.0.0.1]) by localhost (victor [127.0.0.1]) (amavisd-new, port 10022) with LMTP id 05666-02-18; Wed, 15 Jun 2005 14:46:38 -0700 (PDT) Received: from casey.transmeta.com (casey.transmeta.com [10.10.25.22]) by victor.transmeta.com (Postfix) with ESMTP id 664DA4F8003; Wed, 15 Jun 2005 14:46:38 -0700 (PDT) Received: (from dje@localhost) by casey.transmeta.com (8.11.6/8.11.6) id j5FLkc806889; Wed, 15 Jun 2005 14:46:38 -0700 From: Doug Evans MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17072.41406.147361.75051@casey.transmeta.com> Date: Wed, 15 Jun 2005 21:46:00 -0000 To: Dave Brolley Cc: cgen@sources.redhat.com, sid@sources.redhat.com Subject: Re: [RFC] New cpu --- Morpho ms1 In-Reply-To: <42B09F6F.7020302@redhat.com> References: <42A752B2.8090407@rogers.com> <20050613145452.GE18930@redhat.com> <42B09F6F.7020302@redhat.com> X-SW-Source: 2005-q2/txt/msg00037.txt.bz2 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)))) > !