From: Alexander G. <ale...@an...> - 2008-07-14 22:29:55
|
Greetings, First of all, thanks to all of the developers for making amforth available; I've found it extremely useful. I think I've run into a bug related to u*/mod. It's listed as accepting unsigned values, but (as of amforth v2.8) uses m* for multiplication. Shouldn't it be using um*? --- a/core/words/ustarslashmod.asm +++ b/core/words/ustarslashmod.asm @@ -9,7 +9,7 @@ XT_USTARSLASHMOD: .dw DO_COLON PFA_USTARSLASHMOD: .dw XT_TO_R - .dw XT_MSTAR + .dw XT_UMSTAR .dw XT_R_FROM .dw XT_UMSLASHMOD .dw XT_EXIT Thanks. Alexander |
From: Matthias T. <mt...@we...> - 2008-07-16 19:21:09
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ho Alexander Alexander Guy wrote: > Greetings, First of all, thanks to all of the developers for making > amforth available; I've found it extremely useful. Thank you, and allow me a simple question: what do you do with amforth? I get only very vage project descriptions, if anything at all; but am very interested what people do with amforth (you can answer me directly, I won't disclose your ideas)... > I think I've run > into a bug related to u*/mod. It's listed as accepting unsigned > values, but (as of amforth v2.8) uses m* for multiplication. > Shouldn't it be using um*? The u*/mod currently passes the Hayes Test, but I'll check your fix ASAP, it is too obvious to be ignored ;=) Matthias -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIfkol9bEHdGEMFjMRApJKAJ9ITjFy1hbMEL6ddCr/4OSenMT9bgCfYZI/ MDtF1UfDM98AQmDpHH9eofc= =7Jqh -----END PGP SIGNATURE----- |
From: Kalus M. <mic...@on...> - 2008-07-16 20:09:06
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi. Am 16.07.2008 um 21:21 schrieb Matthias Trute: >> I think I've run >> into a bug related to u*/mod. It's listed as accepting unsigned >> values, but (as of amforth v2.8) uses m* for multiplication. >> Shouldn't it be using um*? > > The u*/mod currently passes the Hayes Test, but I'll check your fix > ASAP, it is > too obvious to be ignored ;=) In dpans forth there is no "u*/mod" at all; even gforth has no such word. I wonder how it sneeked into amforth? Michael -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iD8DBQFIflVVJ3DLQCvSXtcRAhvWAKD+CdNr0CQvh1F96xptWTr8feXWrACgovtb fYscooOwVhN4suaBVf/lmog= =3rze -----END PGP SIGNATURE----- |
From: Alexander G. <ale...@an...> - 2008-07-16 20:41:40
|
>>>>> "Matthias" == Matthias Trute <mt...@we...> writes: Matthias> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Matthias> Ho Alexander Matthias> Alexander Guy wrote: >> Greetings, First of all, thanks to all of the developers for >> making amforth available; I've found it extremely useful. Matthias> Thank you, and allow me a simple question: what do you Matthias> do with amforth? I've been using it to test automotive engine control units: http://www.efi101.com/forum/viewtopic.php?t=3619&highlight=simulation .. specifically I've been generating simulated engine position information, to see how the ECUs react to changes in engine speed. >> I think I've run into a bug related to u*/mod. It's listed as >> accepting unsigned values, but (as of amforth v2.8) uses m* for >> multiplication. Shouldn't it be using um*? Matthias> The u*/mod currently passes the Hayes Test, but I'll Matthias> check your fix ASAP, it is too obvious to be ignored ;=) Great. Thanks. Alexander |
From: Matthias T. <mt...@we...> - 2008-07-17 14:44:02
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 hi, Kalus Michael wrote: > In dpans forth there is no "u*/mod" at all; even gforth has no such > word. > > I wonder how it sneeked into amforth? Good question, and I do not find the test case anymore in my unchanged core.frt file.... Sorry about the confusion, I'll change the code as suggested Thanks+cu Matthias -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIf1qy9bEHdGEMFjMRAh3rAKDa0XXRcs/w1blK9/fYnzpfeJCEKgCffVQQ ByFU3SKVslEKj7WGCVyRhY4= =ZrST -----END PGP SIGNATURE----- |
From: Kalus M. <mic...@on...> - 2008-07-17 18:34:10
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi. Am 17.07.2008 um 16:44 schrieb Matthias Trute: >> In dpans forth there is no "u*/mod" at all; even gforth has no such >> word. >> >> I wonder how it sneeked into amforth? > > Good question, and I do not find the test case anymore in my > unchanged core.frt file... Must have been something where an unsigned double precision intermediate calculation has been nessesary (= mixed precision arithmetic) Mixed precision means you take 2 unsigned single precision integers, multiply into double precision so you dont loose the overflow if it happens to have one, then calculate division and remainder using this double precision intermediate result. If you do it with * and /mod you get wrong results when overflow of the product ocures. (Thats why there is no u* or u/mod to get mixed up with.) So, instead of creating an extra *core* word named u*/mod I think its more clean programming to use um* and um/mod inline instead. um* ( u1 u2 – ud) \ core “u-m-star” um/mod ( ud u3 – u4 u5) \ core “u-m-slash-mod” The inlined phrase ( u1 u2 u3 – u4 u5 ) >r um* r> um/mod should work as well and you can see what happens and test it. Further more as u*/mod is not standard (as far as I can see) you loose portability of code. And as it is not coded in assembler but in high level, I can not see any speed benefit. As it comes along whit another level of nesting, it slows down calculaton a littel bit instead. > Sorry about the confusion, I'll change the code as suggested I vote for dropping it or move it into, hm, maybe lib/misc.frt ? (Yes, I like amforth to be as lean as possible to meet standards. Is it getting too fat and needs review? ;-) Michael -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iD8DBQFIf5CWJ3DLQCvSXtcRAszuAJ9b9EXOII8L89KDdjXkXIYF/KCDUQCeN0mI hn2c7eRpFsIFRkMand3oSvI= =ZiD/ -----END PGP SIGNATURE----- |
From: Matthias T. <mt...@we...> - 2008-07-19 09:34:33
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Kalus Michael wrote: > I vote for dropping it or move it into, hm, maybe lib/misc.frt ? how about a lib/math.frt? I put a sqrt word into it as well. Matthias -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIgbUm9bEHdGEMFjMRAuLjAJ9+rSvqepJptEr97xkuo3OyAUgKWwCg17JB pu1u5otoLFkT/VQsXKzw+tA= =o8V9 -----END PGP SIGNATURE----- |
From: Kalus M. <mic...@on...> - 2008-07-21 16:54:24
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Matthias. Am 19.07.2008 um 11:34 schrieb Matthias Trute: >> I vote for dropping it or move it into, hm, maybe lib/misc.frt ? > > how about a lib/math.frt? I put a sqrt word into it as well. Ok, why not? Where does the ANS forth standard put non-standard words? Maybe we ask Ulrich as well? Michael -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iD8DBQFIhL80J3DLQCvSXtcRAh4FAJ45DeOlTLsjzhnrTek5khYwzrIdrwCguvRf RVxB8HlxbcyLizAvNf4Cink= =kaUw -----END PGP SIGNATURE----- |
From: Ulrich H. <uh...@xl...> - 2008-07-21 17:00:06
|
As far as I know, there is no statement in the standard about the location of (standard or non-standard) definitions whatsoever. A file with math utility words seems appropriate. Regards, Ulli Am 21.07.2008 um 18:54 schrieb Kalus Michael: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Matthias. > > > Am 19.07.2008 um 11:34 schrieb Matthias Trute: > >>> I vote for dropping it or move it into, hm, maybe lib/misc.frt ? >> >> how about a lib/math.frt? I put a sqrt word into it as well. > > Ok, why not? Where does the ANS forth standard put non-standard words? > Maybe we ask Ulrich as well? > > Michael > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.1 (Darwin) > > iD8DBQFIhL80J3DLQCvSXtcRAh4FAJ45DeOlTLsjzhnrTek5khYwzrIdrwCguvRf > RVxB8HlxbcyLizAvNf4Cink= > =kaUw > -----END PGP SIGNATURE----- |