From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17654 invoked by alias); 13 Dec 2002 14:56:06 -0000 Mailing-List: contact cgen-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sources.redhat.com Received: (qmail 17644 invoked from network); 13 Dec 2002 14:56:05 -0000 Received: from unknown (HELO miranda.axis.se) (212.209.10.215) by sources.redhat.com with SMTP; 13 Dec 2002 14:56:05 -0000 Received: from ignucius.axis.se (ignucius.axis.se [10.13.1.18]) by miranda.axis.se (8.12.3/8.12.3/Debian -4) with ESMTP id gBDEu3x4023451; Fri, 13 Dec 2002 15:56:03 +0100 Received: from ignucius.axis.se (localhost [127.0.0.1]) by ignucius.axis.se (8.12.3/8.12.3/Debian -4) with ESMTP id gBDEu3G9030722 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=FAIL); Fri, 13 Dec 2002 15:56:03 +0100 Received: (from hp@localhost) by ignucius.axis.se (8.12.3/8.12.3/Debian -4) id gBDEu2g8030718; Fri, 13 Dec 2002 15:56:02 +0100 Date: Fri, 13 Dec 2002 06:56:00 -0000 Message-Id: <200212131456.gBDEu2g8030718@ignucius.axis.se> From: Hans-Peter Nilsson To: dje@transmeta.com CC: hans-peter.nilsson@axis.com, cgen@sources.redhat.com In-reply-to: <15865.59974.251811.291863@xris-athlon.transmeta.com> (message from Doug Evans on Fri, 13 Dec 2002 06:10:14 -0800 (PST)) Subject: Re: [RFA:] Simplification transformations in semantics.scm X-SW-Source: 2002-q4/txt/msg00085.txt.bz2 > From: Doug Evans > Date: Fri, 13 Dec 2002 06:10:14 -0800 (PST) > Suppose you could give names to expressions in the semantic code > and use these names in the model description. That'd be very nice! > Note that I don't think you want to use the format description > as some operands can be implicit. No; currently I don't see how they can be implicit. It'd be nice if they could. > e.g. something like > > ;[sr,dr are operands] > > (dni add-gr-13 > ... > (sequence ((QI tmp)) > (set tmp (rename QI foo (reg QI h-gr 13))) > (set dr (add tmp sr))) > ((model-baz (unit u-exec (in src1 sr) (in src2 foo) (out dr #f)))) > ) > > Here `rename' is being used to attach a name to something that is then > referenced by the model parameters of the dni. > > semantic operand sr -> u-exec input src1 > semantic operand foo -> u-exec input src2 > semantic operand dr -> u-exec output dr > > [The `tmp' is unnecessary of course.] > > I _think_ this will be very easy to implement and very flexible. > Thoughts? The syntax is at first slightly confusing, but it looks fine otherwise. Not currently possible *generally* of course; you can't feed (rename QI foo (add QI sr dr)) to the model machinery. It has to be something that maps to one ifield AFAICT. > > (SET (if IFMODE COND ltrue lfalse) src) > > into (for SET = {set, set-quiet}): > > (if COND (SET ltrue dst) (SET lfalse dst)) This one above was not intended for user code, just for internal simplification from the following: > > (reg h-hw RMODE (if COND ntrue nfalse)) > > into > > (if RMODE COND (reg h-hw RMODE ntrue) > > (reg h-hw RMODE nfalse)) > > but only if simplification makes that latter expression > > not take that form, i.e. (if COND (reg...) (reg...)) > > How much pain would it be if we continue to disallow > conditions in the left side of `set'? If you mean in (set (reg h-hw RMODE exp1) exp2) then much so, but in (set exp1 exp2) none at all. I think it's currently invalid and should remain so. > I don't mind adding something that let's one write such > conditions as long as they get removed before the rtl parser sees them. Agreed. > By that I mean above the rtl language we can play some games, > but at the level of the rtl language, conditions in the left side > of `set' do not exist. E.g. maybe a special form or macro > that makes things look "as if" there's a condition present. > I think it's more or less what you already have, except I want > the transformations to live above the rtl language line, not below it. > Sound reasonable? Yes! That was exactly my intention, and what I originally had, except it looked too non-linear. I'll cook up a patch to do that. > [ok, now I'm off to get some sleep ...] Sweet dreams! brgds, H-P