home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.forth      Forth programmers eat a lot of Bratwurst      117,927 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 116,403 of 117,927   
   Krishna Myneni to Anton Ertl   
   Re: Floating point implementations on AM   
   13 Apr 24 18:47:20   
   
   From: krishna.myneni@ccreweb.org   
      
   On 4/13/24 12:55, Anton Ertl wrote:   
   > I just looked at the floating-point implementations of recent   
   > SwiftForth and VFX (finally present in the system from the start), and   
   > on iForth-5.1-mini (for comparison):   
   >   
   > 1 FLOATS .   
   >   
   > reports:   
   >   
   > 16 iforth   
   > 10 sf64   
   > 10 vfx64   
   >   
   > For   
   >   
   > : foo f+ f* ;   
   >   
   > the resulting code is:   
   >   
   > SwiftForth x64-Linux 4.0.0-RC87 24-Mar-2024   
   > : foo f+ f* ;  ok   
   > see foo   
   > 44E8B9   ST(0) ST(1) FADDP              DEC1   
   > 44E8BB   ST(0) ST(1) FMULP              DEC9   
   > 44E8BD   RET                            C3 ok   
   >   
   >   
   > VFX Forth 64 5.43 [build 0199] 2023-11-09 for Linux x64   
   > © MicroProcessor Engineering Ltd, 1998-2023   
   >   
   > : foo f+ f* ;  ok   
   > see foo   
   > FOO   
   > ( 0050A250    DEC1 )                  FADDP   ST(1), ST   
   > ( 0050A252    DEC9 )                  FMULP   ST(1), ST   
   > ( 0050A254    C3 )                    RET/NEXT   
   > ( 5 bytes, 3 instructions )   
   >   
   >   
   > iForth:   
   > $10226000  : foo                        488BC04883ED088F4500      H.@H.m..E.   
   > $1022600A  fld           [r13 0 +] tbyte41DB6D00                  A[m.   
   > $1022600E  fld           [r13 #16 +] tbyte   
   >                                          41DB6D10                  A[m.   
   > $10226012  fxch          ST(2)          D9CA                      YJ   
   > $10226014  lea           r13, [r13 #32 +] qword   
   >                                          4D8D6D20                  M.m   
   > $10226018  faddp         ST(1), ST      DEC1                      ^A   
   > $1022601A  fxch          ST(1)          D9C9                      YI   
   > $1022601C  fpopswap,                    41DB6D00D9CA4D8D6D10      A[m.YJM.m.   
   > $10226026  fmulp         ST(1), ST      DEC9                      ^I   
   > $10226028  fpush,                       4D8D6DF0D9C941DB7D00      M.mpYIA[}.   
   > $10226032  ;                            488B45004883C508FFE0      H.E.H.E..`   
   ok   
   >   
   > So apparently the 8 hardware FP stack items are enough for SwiftForth   
   > and VFX, while iForth prefers to use an FP stack in memory to allow   
   > for a deeper FP stack.   
   >   
   ...   
      
   For me, an 8 item hardware fp stack limit is too limiting to be useful.   
   This is mostly because of my use of the fp stack for initializing tables   
   (arrays and matrices), and my coding style of returning more than 8   
   floats on the fp stack for some types of computation. No doubt one can   
   limit themselves to an 8-item fp stack, but I'd hate to have to code wit   
   such a limit.   
      
   --   
   Krishna   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca