gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gforth] Peephole optimize compiler


From: Matt Wilbur
Subject: Re: [gforth] Peephole optimize compiler
Date: Tue, 11 Jan 2011 10:05:42 -0500

On Tue, Jan 11, 2011 at 5:27 AM, David Kuehling <address@hidden> wrote:
>>>>>> "Matt" == Matt Wilbur <address@hidden> writes:
>
>> Hello, Just for my own intellectual curiosity as I learn more about
>> forth, is there a way to turn off the peehole optimized compiler so
>> that compile, just becomes , ?
>
> You could just try the 'gforth-itc' binary which implements plain old
> indirect threaded code.  Maybe you also need to set the --no-super
> command line switch.

Hmm.  Perhaps I'm not trying to do the right thing by disabling the
peephole optimizer (admittedly a very new concept to me).

Here's what I'm playing with:

Even in gforth-itc, when I try, say

: x 1 ;
: y x ;

Instead of the xt of x compiled into y, the logic in comp.fs is
followed where the xt of call followed by the PFA of x is compiled
into y.
In comp.fs, compile, is defined as , if the word peephole is not in
the dictionary, which is why I was trying to turn of the peephole
optimization.  Having started reading Anton's paper from Forth-Tagung
'02, perhaps it has less to do with peephole optimization as it does
with this "primitive centric" code.

At any rate, I suppose I can try to "hack" comp.fs to make compile,
synonymous with , .  But I though there might be a less invasive way
to get the more "traditional" behaviour.  Just to be clear, this is
all just for my own learning.

Matt

>
> cheers,
>
> David
> --
> GnuPG public key: http://user.cs.tu-berlin.de/~dvdkhlng/dk.gpg
> Fingerprint: B17A DC95 D293 657B 4205  D016 7DEF 5323 C174 7D40
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]