Re: [Amforth-devel] Floating point - test/benchmark

2010-10-28 Thread pito
With f*/+- written in forth it takes ~111 secs (original Leon's flib): . 99 R(m)= 4.144999E2 V(m3)= 2.983059E8 M(kg)= 7.457643E11 v(m/sec)= 6.29E4 Ek(J)= 1.479969E21 100 R(m)= 2.994999E2 V(m3)= 1.125327E8 M(kg)= 2.813316E11 v(m/sec)= 2.39E4 Ek(J)= 8.102348E19 1.118E2 secs e

Re: [Amforth-devel] Floating point - fatan

2010-09-26 Thread pito
Hi, who needs urgently fatan - this is an aproximation, 5+ digits precision for small arguments (-1..+1). \ fatan library \ amforth 4.0 \ Pito 26-9-2010 \ v 1.0. \ needs Leon's flib (and Pito's asm flib v1.1 for speed) -fatan marker -fatan \ calculate fatan : fatan ( RAD -- arctangens ) \ x fdup f

Re: [Amforth-devel] Floating point - fsin, fcos, f tan

2010-09-26 Thread pito
Matthias, pls mind the Pito's asm lib update I've sent you (v1.1.) with a bug fix. I've been discussing the flib approach with Leon. There are currently two ideas: to go full asm or combined. As from my understanding nobody will be using the amforth for dsp, a forth flib based on those 4 asm primit

Re: [Amforth-devel] Floating point - fsin, fcos, ftan

2010-09-26 Thread Matthias Trute
Hi Pito, great work, thank you. I've put it into the application tree of the sourceforge subversion tree. Matthias -- Start uncovering the many advantages of virtual appliances and start using them to simplify applicat

Re: [Amforth-devel] Floating point - fsin, fcos, f tan

2010-09-25 Thread pito
Hi, this is a new version of the lib - combination of amforth's look-up table sinus calculus (see examples) within the 0-pi/2 range, and, the actual sinus calculated by the taylor series. VERY GOOD precision (6+ digits) and still fast. Pito. \ fsin fcos ftan library \ amforth 4.0 \ Pito 25-9-2010

Re: [Amforth-devel] Floating point - fsin, fcos, f tan

2010-09-23 Thread pito
..more compact, faster by 25%.P. \ fsin fcos ftan library \ amforth 4.0 \ Pito 23-9-2010 \ based on 4tH library by J.L. Bezemer \ needs Leon's flib (and Pito's asm flib v1.1 for speed) -fsincostan marker -fsincostan \ the original JLB (taylor) does not work, a bug? : >taylor fdup f* fover ;

Re: [Amforth-devel] Floating point - fsin, fcos, f tan

2010-09-23 Thread pito
.. a better fsin: \ calculate fsin : fsin _pihalf f- fcos ; FYI: \ Leon's flib and Pito's flib asm v 1.1 and atm...@25mhz: > fmeasure ( _half fsin ) 9.2494154E-3 secs duration of fsin FUNCTION ok > fmeasure ( _half fcos ) 1.23060155E-2 secs duration of fcos FUNCTION ok > fmeasure ( _half ftan )

Re: [Amforth-devel] Floating point - f* f/ in asm . . calculate execution times

2010-09-17 Thread pito
Michael, here is a little bit more precise function duration measurement tool (FDMT): \ *** \ Precise measurement of duration of a FUNCTION \ Pito 17-9-2010 \ based on the idea on FUNCTION separation by Michael Kalus \ Pito's 4 prim

Re: [Amforth-devel] Floating point library - 4 primitives f/ f* f+ f-

2010-09-16 Thread Matthias Trute
Marcin, > Dnia 16.09.2010 Matthias Trute napisał/a: > > > > btw: I'm still working on the marker issue. strange case > > Matthias, > > Reverting change 918 to istore_nrww.asm fixes the marker issue. indeed. fixed. thank you. Matthias

Re: [Amforth-devel] Floating point library - 4 primitives f/ f* f+ f-

2010-09-16 Thread Marcin Cieslak
Dnia 16.09.2010 Matthias Trute napisał/a: > > btw: I'm still working on the marker issue. strange case Matthias, Reverting change 918 to istore_nrww.asm fixes the marker issue. --Marcin -- Start uncovering the man

Re: [Amforth-devel] Floating point library - 4 primiti ves f/ f* f+ f-

2010-09-16 Thread pito
Matthias, if somebody may send to me the ready to run test cases for f* f/ f+ f-which runs in amforth, I will provide the results (e.g. I'am not going to deal with uppercase words, as you know). Moreover, I cannot write test cases as it might be an interest conflict then.. Btw, the marker is one o

Re: [Amforth-devel] Floating point library - 4 primitives f/ f* f+ f-

2010-09-16 Thread Matthias Trute
Pito, > Hi Leon and Matthias, > enclosed pls find my little contribution to floating with amforth Great work. Thank you. > (:-)). > The library is provided as-is, no guarantees and warrantees, no > liability fo any direct, indirect, consequent damages or losses.. There is are test programs for

Re: [Amforth-devel] Floating point - f* f/ in asm

2010-09-16 Thread pito
> But there is other Q I would like address - how to > measure a word > duration? Imagine to measure f/. So the loop might > be: Michael, to be more precise in what I like to address: how to measure a "function" duration? P. ---

Re: [Amforth-devel] Floating point - f* f/ in asm

2010-09-16 Thread pito
Michael, Thanks!! At least you have confirmed 3us, so my guess of 7us for an average amforth word is not so bad (:-)). I am using rtc as well, however for these time measurements I use ticker (you may see it somewhere in the post). I am thinking now to use 16bit counter for the hw timer1 clocked by

Re: [Amforth-devel] Floating point - f* f/ in asm

2010-09-16 Thread Kalus Michael
Hi. Am 16.09.2010 um 14:39 schrieb pito: .. > PS: I am still thinking why the amforth overhead is so big?? It > seems from my naive measurements a typical forth word takes ~7us > plus minus. > This is about 175 clock cycles @25MHz, or aprox 100 instructions - > could it be so much? Just a stupid Q

Re: [Amforth-devel] Floating point - f* f/ in asm

2010-09-16 Thread pito
Hi, the last one is f-. Even the amforth overhead compared to asm float primitives is huge I did f- in asm too (all measurements @25MHz): > > test_empty_loop > 4.0894465E-5 sec per empty loop operation ok f- : > test_sub_asm 4.0894465E-5 sec per fsub-asm operation ok > _pi _pi f* _pi f- fs. 6.72

Re: [Amforth-devel] Floating point - f* f/ in asm

2010-09-16 Thread pito
Hi, the f+ works as well: > test_empty_loop 4.0894465E-5 sec per empty loop operation ok > test_fadd_asm 4.194304E-5 sec per fadd-asm operation ok > test_fmul_asm 4.5088768E-5 sec per fmul-asm operation ok > test_fdiv_asm 6.6060295E-5 sec per fdiv-asm operation ok > test_sub_forth_asm (f- as "fne

Re: [Amforth-devel] Floating point - f* f/ in asm

2010-09-15 Thread pito
Hi, the f* routine (my template based) works now (a bug - I did not care on R0,1 - where MULT puts results..), so Marcin may redo it into amforth look, when required. > : test_mul_asm timer-start 3 0 do _pi _ln2 f* drop drop loop oktimer-stop 3 s>f f/ fs. ." sec per mul-asm operation" ; o

Re: [Amforth-devel] Floating point - f* f/ in asm

2010-09-15 Thread pito
As an example the f/ "__DIV" code has been generated by C compiler from "c=a/b". So we may that way create any floating point-function in few seconds. However, it is up to amforth community to agree the integration standards. When the ___frutine will be hard coded to certain amforth registers, the

Re: [Amforth-devel] Floating point - f* f/ in asm

2010-09-15 Thread Marcin Cieslak
I have uploaded the fdiv code (the one I got from Pito) integrated into amforth here: hg clone http://saper.info/hg/forth/fdiv/ It defines "f0", "fmin", "fmax" and "f/" words. //Marcin -- Start uncovering the many adv

Re: [Amforth-devel] Floating point - f* f/ in asm

2010-09-15 Thread pito
Hi, Leon, Marcin and co., if somebody needs the fast word "f/" in asm (f* still not ready) I recommend to use Marcin's one as mine is not amforth like one (I use an template for educational purposes - the same as the template of fuX I posted in the assembler discussion with a lot of stuff highly u

Re: [Amforth-devel] Floating point - f* f/ in asm

2010-09-15 Thread pito
HI, thanks to Marcin, who had shown me again how the stack works, the f/ routine works within amforth as word f/. You may see the speed up (amforth 4.0, new f/ v1. in asm, @25Mhz): > : test_mul_forth timer-start 3 0 do _pi _ln2 f* drop drop > loop > oktimer-stop 3 s>f f/ fs. ." sec per mu

Re: [Amforth-devel] floating-point

2010-08-25 Thread Matthias Trute
Hi Leon, > I've been working on a single precision floating point word set, and I > recently got addition/subtraction working. and a f* is already there :=)) Great work, Leon!! really! Matthias -- Sell apps to millio