Re: how to generate code for (a,b):=(b,a)

genew@vip.net (Gene Wirchenko)
13 May 1997 22:51:07 -0400

          From comp.compilers

Related articles
[5 earlier articles]
Re: how to generate code for (a,b):=(b,a) dlmoore@ix.netcom.com (David L Moore) (1997-05-08)
Re: how to generate code for (a,b):=(b,a) preston@cs.rice.edu (1997-05-08)
Re: how to generate code for (a,b):=(b,a) cliffc@risc.sps.mot.com (Cliff Click) (1997-05-12)
Re: how to generate code for (a,b):=(b,a) wilson@cs.utexas.edu (1997-05-12)
Re: how to generate code for (a,b):=(b,a) tim@wfn-shop.Princeton.EDU (1997-05-13)
Re: how to generate code for (a,b):=(b,a) cdg@nullstone.com (Christopher Glaeser) (1997-05-13)
Re: how to generate code for (a,b):=(b,a) genew@vip.net (1997-05-13)
Re: how to generate code for (a,b):=(b,a) bobduff@world.std.com (1997-05-13)
Re: how to generate code for (a,b):=(b,a) will@ccs.neu.edu (William D Clinger) (1997-05-17)
Re: how to generate code for (a,b):=(b,a) wilson@cs.utexas.edu (1997-05-17)
Re: how to generate code for (a,b):=(b,a) boehm@mti.mti.sgi.com (Hans-Juergen Boehm) (1997-05-17)
Re: how to generate code for (a,b):=(b,a) boehm@mti.mti.sgi.com (Hans-Juergen Boehm) (1997-05-17)
Re: how to generate code for (a,b):=(b,a) Dave@occl-cam.demon.co.uk (Dave Lloyd) (1997-05-22)
[6 later articles]
| List of all articles for this month |
From: genew@vip.net (Gene Wirchenko)
Newsgroups: comp.compilers
Date: 13 May 1997 22:51:07 -0400
Organization: All USENET -- http://www.Supernews.com
References: 97-05-058 97-05-114
Keywords: code, optimize

Dave Lloyd <Dave@occl-cam.demon.co.uk> wrote:


[snip]


>With our Algol 68 compiler, the equivalent code generates (x86):
>PROC foo (E:\tests\a68\perf\swaps.a68)[6]
> di := cx
> cx := bx
> bx := ax
> ax := di
> CALL bar
> RETURN
>
>(Yes I know it should be just JMP foo with no return, one day soon I'll
>tidy that one up).


          Shouldn't that be foo run with
                    CALL foo
and ending with
                    JMP bar
? If you then end up optimizing the tail one level up, you'd change
the CALL foo to JMP foo, too and so on up as far as you go. It seems
weird to me to have all but the bottom level call being jumpified
instead of the top being the one left.


    1) Am I missing something? (Quite possibly, but what?)
    2) Is either way better than the other or is it just a preference
issue?


Sincerely,


Gene Wirchenko
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.