Hi, I am resending to Matthias a new version 2.0 of the Pito's 4 primitives called 5 primitives. The lib is redone, no warnings when compiled, cleaner code, maybe faster, and I added fsqrt. Most important is the T flag dependency is removed, thus no issues with interrupts observed yet. The lib require ~50b own stack - see the note, it works with mine.
; ############## Pito's Five primitives ################# ; ############## IEEE 754 single precision ############## ; ############## f/ f* f+ f- fsqrt words ################ ; ; v.1.0 Pito 16-9-2010 ; v.1.1 Pito 22-9-2010 ; 22-9-2010 BUG FIXED: FDIV shall use R0, R1 instead R8, R9 ; v.2.0 Pito 27-5-2011 ; 27-5-2011 BUG FIXED: T flag dependency removed fully ; Added: fsqrt ; ; The library is provided as-is, no guarantees or/and warrantees of any kind ; are given, no liability of any kind is provided for any and all direct, ; indirect or consequent damages or losses caused by using this software ; library ; ; This program is free software; you can redistribute it and/or ; modify it under the terms of the GNU General Public License ; as published by the Free Software Foundation; using version 2 ; of the License. ; Note: ; Please add in template.asm following float stack, 50bytes required (e.g): ; ; addresses of various data segments ; .set rstackstart = RAMEND ; start address of return stack, grows downward ; .set FLIBSTACK = RAMEND - 80 ; FLOATLIB space ; .set stackstart = RAMEND - 130 ; start address of data stack, grows downward ; ; How to install: ; 1. put this file into amforth's ..\core\words library ; 2. do .include "words/float_5primitives" into your dict_appl.inc ; 3. compile amforth ; 4. flash it ; 5. load what you want ; 6. load Leon's float.lib ( !! DO NOT forget to cut-off ; or comment-out the words f/ f* f+ f- in Leon's lib !!!!) ; 7. enjoy the speed! ; ; &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& > 1.00 4.00 f* fs. 4.0 ok > 1.0 4.0 f/ fs. 2.5E-1 ok > -1.0e1 -4.0e0 f/ fs. 2.5 ok > 100.0 1000.0 f+ fs. 1.1E3 ok > -300.0 -400.0 f+ fs. -7.0E2 ok > 100.0 400.0 f- fs. -3.0E2 ok > -100.0 -400.0 f- fs. 3.0E2 ok > 10000.0 fsqrt fs. 1.0E2 ok > 1234567.8 fsqrt fs. 1.1111109E3 ok > +timer ok > 1234567.8 fsqrt fs. 1.1111109E3 ok > 10000.0 fsqrt fs. 1.0E2 ok > 100.0 400.0 f- fs. -3.0E2 ok > : test1 timer-start 10000 0 do 100000.0 fsqrt fdrop loop > timer-stop fs. ." seconds" ; > ok > test1 1.28814816E1 seconds ok > .s ok > ------------------------------------------------------------------------------ vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 _______________________________________________ Amforth-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/amforth-devel
