Re: [Flashforth-devel] Floating point library - open issues
Brought to you by:
oh2aun
From: om1zz <om...@vo...> - 2015-06-03 11:20:13
|
With experimental heap=256 and Cstack=512 dstack=96 rstack=96 and TXbuffer=0 fpow crashes on this kind of tests: : tpw ticks 10000 for 3 s>f 4 s>f fpow fdrop next ticks swap - u. ; It seems fpow is buggy or uses even a bigger Cstack (are we handling Cstack properly?). I've done this fpow workaround (in my lib): float Cfpow(float x, float y) { //return powf(x, y); // IgorM: simple workaround if (x <= 0.0) return 0.0; return expf(y*logf(x)); } Which calculates with positive x, and works with heap=0 Cstack=128 dstack=96 rstack=96 Txbuffer=0 : tpw ticks 10000 for 3 s>f 4 s>f fpow fdrop next ticks swap - u. ; ok<#,ram> tpw 3441 ok<#,ram> tpw 3441 ok<#,ram> and also the bigtest passes. Note: The workaround is simpler than the powf function, which does more.. But, still with Txbuffer none zero it crashes, so it seems we have got 2 issues here. Igor. ______________________________________________________________ > Od: om1zz <om...@vo...> > Komu: <fla...@li...> > Datum: 02.06.2015 22:22 > Předmět: Re: [Flashforth-devel]Floating point library - open issues > >Mike, >even with Txbuffer=0 the fpow crashes, see the session below. > >2.3e 4.3e fpow fs. 3.59277e1 ok<#,ram> > >: tpw ticks 1000 for 2.3e 4.3e fpow drop drop next ticks swap - . ; ok<#,ram> > >tpw 170 ok<#,ram> >tpw 170 ok<#,ram> >tpw 170 ok<#,ram> >tpw 170 ok<#,ram> >tpw 170 ok<#,ram> >tpw OS FlashForth PIC24 31.05.2015 >ESC >tpw 170 ok<#,ram> >tpw 170 ok<#,ram> >tpw 170 ok<#,ram> >tpw 170 ok<#,ram> >tpw OS FlashForth PIC24 31.05.2015 >ESC >tpw 170 ok<#,ram> >tpw OS FlashForth PIC24 31.05.2015 >ESC >tpw 170 ok<#,ram> >tpw 170 ok<#,ram> >tpw 170 ok<#,ram> >tpw OS FlashForth PIC24 31.05.2015 >ESC >tpw 170 ok<#,ram> >tpw 170 ok<#,ram> >tpw 170 ok<#,ram> >tpw 170 ok<#,ram> >tpw OS FlashForth PIC24 31.05.2015 >ESC >tpw 170 ok<#,ram> >tpw 170 ok<#,ram> >tpw 170 ok<#,ram> >tpw 170 ok<#,ram> >tpw 170 ok<#,ram> >tpw OS FlashForth PIC24 31.05.2015 >ESC > > > > >______________________________________________________________ >> Od: "om1zz" <om...@vo...> >> Komu: <fla...@li...> >> Datum: 02.06.2015 09:37 >> Předmět: Re: [Flashforth-devel] Floating point library - open issues >> >>Yep, you have found it, it seems.. >> >>Here: >> >>TXbuffer=0 dstack=96 bigtest passes (20minutes long run now) >>TXbuffer=31 dstack=254 bigtest passes (several 8minutes rounds) >> >>Igor. >> >>______________________________________________________________ >>> Od: Mikael Nordman <mik...@fl...> >>> Komu: <fla...@li...> >>> Datum: 02.06.2015 08:56 >>> Předmět: Re: [Flashforth-devel] Floating point library - open issues >>> >>>There seems to be an issue with the NSTDIS bit in INTCON1. >>>FF PIC24 Interrupt routines rely on that nested interrupts do not >>>occur. >>>Either there is some latent problem in FF or the float lib keeps >>>resetting that bit. >>> >>>There could also be some other conflict with the usage of the shadow >>>registers between FF and the float lib. >>> >>>If you use unbuffered transmission on TX1 you will experience less >>>problems, since there are no >>>disturbing interrupts during the float calculations. >>> >>>I will check details later. >>> >>> >>>On 02.06.2015 00:05, om1zz wrote: >>>> Issue 4. >>>> >>>> Mike, >>>> it crashes here with latest trunk's OS, and 24config (except the uart >>>> pins def and 115k2) and >>>> >>>> ; UART buffer sizes >>>> ; Valid sizes are 7, 15, 31, 63, 127, 255, 511, 1023, etc. >>>> .equ TX1_BUF_SIZE, 31 ; Use 0 for unbuffered TX. >>> >>> >>>------------------------------------------------------------------------------ >>>_______________________________________________ >>>Flashforth-devel mailing list >>>Fla...@li... >>>https://lists.sourceforge.net/lists/listinfo/flashforth-devel >>> >> > >------------------------------------------------------------------------------ >_______________________________________________ >Flashforth-devel mailing list >Fla...@li... >https://lists.sourceforge.net/lists/listinfo/flashforth-devel > |