gforth
[Top][All Lists]
Advanced

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

Re: [gforth] Strange behavior of f! etc.


From: Charles G Montgomery
Subject: Re: [gforth] Strange behavior of f! etc.
Date: Mon, 13 Feb 2012 15:35:03 -0500
User-agent: KMail/1.13.7 (Linux/3.1.0-1-amd64; KDE/4.6.5; x86_64; ; )

On Sunday 12 February 2012 8:10:34 PM David Kuehling wrote:
> 
> Do you say you can reproduce the bug report on debian i386 with
> gforth-fast?  For me the bug doesn't happen at all, neither with
> gforth-fast nor gforth.  But then I didn't try a i386 version of
> gforth (only amd64 and 32-bit mipsel).
> 

I have pinned down the problem on i386 somewhat further.
With gforth-fast, the phrase  
PI F* FSIN
on the first time through the loop in  wtest-init  in the walsh.fth file 
the value on the data stack is somehow incorrectly increased by 1024.  
This happens only on the first trip through the loop, and only for 
gforth-fast on i386, of the things I have tried.  More details follow, 
likely Not of General Interest.

If I replace the file walsh.fth in Marcel's example with the file:

\ file starts ---
32 FLOAT ARRAY xx{

: wt ( n -- )
       DUP 0 DO
         cr
             I 1+ 2* S>F
         .s  DUP S>F F/ 
         .s fs.s
             PI F* FSIN
         .s  fs.s
             1000 S>F
        .s   F*
             xx{ I } F!           
       LOOP
       DROP
;
\ file ends

the output from  32 wt  starts with

<1> 32 <1> 32 <1> 6.25000E-2 <1> 1056 <1> 1.95090E-1 <1> 1056 
<1> 1056 <1> 1056 <1> 3.78788E-3 <1> 1056 <1> 1.18997E-2 <1> 1056 
<1> 1056 <1> 1056 <1> 5.68182E-3 <1> 1056 <1> 1.78490E-2 <1> 1056 
<1> 1056 <1> 1056 <1> 7.57576E-3 <1> 1056 <1> 2.37977E-2 <1> 1056 
<1> 1056 <1> 1056 <1> 9.46970E-3 <1> 1056 <1> 2.97455E-2 <1> 1056 
.....

Maybe this provides a clue to what is going wrong with gforth-fast on 
some platforms?

regards   cgm



reply via email to

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