From: pito <pi...@vo...> - 2011-05-26 17:58:18
|
Hi, it seems the T flag is currently used in a much more "aggresive way". The .asm floating routines are using T flag within sign manipulation and when using timer (tick timer) and the float calcs it does crash (e.g. do _float_asm_calc_ loop never finishes). Q: when running a word e.g. f* written entirely in asm. - what needs to be done? (1st option - not to use T flag, 2nd one??) P. |
From: Matthias T. <mt...@we...> - 2011-05-26 18:22:46
|
Hi Pito, > Hi, it seems the T flag is currently used in a much more "aggresive > way". Not at all. The usage of the T-Flag for dealing with interrupts is part of the code for a very long time (versions around 0.9). It is even documented since ever ;) What's new, is that there is now an example for the interrupts.. > The .asm floating routines are using T flag within sign > manipulation and when using timer (tick timer) and the float calcs > it does crash (e.g. do _float_asm_calc_ loop never finishes). > Q: when running a word e.g. f* written entirely in asm. - what needs > to be done? (1st option - not to use T flag, 2nd one??) P. 1st Options is yours. All of the CPU is mine, with the (documented) exception of the temp registers. They can be used without restriction, but they are not kept between two words however. Matthias |
From: pito <pi...@vo...> - 2011-05-26 18:35:10
|
I did not experienced such behaviour in 4.0 or 4.2. As you can remember I did time measurements in a loop with ticktimer of most of the asm floating primitives. No issues at that time. Now, when I switch +timer it crashes. E.g. > : test5 10000 0 do 123 s>f 123 s>f f* fdrop loop ; ok > test5 ok > +timer ok > test5 CRASH This worked with 4.0. P. ----- PŮVODNÍ ZPRÁVA ----- Od: "Matthias Trute" <mt...@we...> Komu: amf...@li... Předmět: Re: [Amforth] Interrupts - T flag, asm float problem Datum: 26.5.2011 - 20:22:38 > Hi Pito, > > > Hi, it seems the T flag is currently used in a > > much more "aggresive > > > way". > > Not at all. The usage of the T-Flag for dealing > with > interrupts is part of the code for a very long > time > (versions around 0.9). It is even documented since > ever ;) > What's new, is that there is now an example for > the > interrupts.. > > > The .asm floating routines are using T flag > > within sign > > > manipulation and when using timer (tick timer) > > and the float calcs > > > it does crash (e.g. do _float_asm_calc_ loop > > never finishes). > > > Q: when running a word e.g. f* written entirely > > in asm. - what needs > > > to be done? (1st option - not to use T flag, 2nd > > one??) P. > > > 1st Options is yours. All of the CPU is mine, with > the > (documented) exception of the temp registers. They > can be > used without restriction, but they are not kept > between > two words however. > > Matthias > > ------------------------------------------------------------------------------ > > 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 > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel > |
From: pito <pi...@vo...> - 2011-05-26 19:18:22
|
I need the Status Register as well, of course (;-)). It cannot be changed during an interrupt event (you are manipulating the T flag there). Imagine you run a routine and somebody changes a flag there in SR. Would it be possible to use, as the interrupt signalling, a bit outside the status register??P. ----- PŮVODNÍ ZPRÁVA ----- Od: "Matthias Trute" <mt...@we...> Komu: amf...@li... Předmět: Re: [Amforth] Interrupts - T flag, asm float problem Datum: 26.5.2011 - 20:22:38 > Hi Pito, > > > Hi, it seems the T flag is currently used in a > > much more "aggresive > > > way". > > Not at all. The usage of the T-Flag for dealing > with > interrupts is part of the code for a very long > time > (versions around 0.9). It is even documented since > ever ;) > What's new, is that there is now an example for > the > interrupts.. > > > The .asm floating routines are using T flag > > within sign > > > manipulation and when using timer (tick timer) > > and the float calcs > > > it does crash (e.g. do _float_asm_calc_ loop > > never finishes). > > > Q: when running a word e.g. f* written entirely > > in asm. - what needs > > > to be done? (1st option - not to use T flag, 2nd > > one??) P. > > > 1st Options is yours. All of the CPU is mine, with > the > (documented) exception of the temp registers. They > can be > used without restriction, but they are not kept > between > two words however. > > Matthias > > ------------------------------------------------------------------------------ > > 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 > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel > -- IHNED.cz je nový, přehlednější a rychlejší. Přesvědčte se na: www.ihned.cz |
From: Matthias T. <mt...@we...> - 2011-05-26 19:52:20
|
Hi Pito, > I need the Status Register as well, of course (;-)). > It cannot be changed during an interrupt event (you are manipulating > the T flag there). That is part of the magic how the forth VM synchronizes interrupt handling with the controller state. Its not a convential way, yes. > Imagine you run a routine and somebody changes a > flag there in SR. No problem. Remember: amforth is a runtime environment for forth code, not for (huge) assembler code snippets. They are useful, no doubt, but they must follow the rules (expressed and implied ones). > Would it be possible to use, as the interrupt > signalling, a bit outside the status register??P. Not really. There is nothing as speedy as the status register based jumps. And the inner interpreter checks that interrupt signalling bit every time it is called. Speed is a must-have there. What about you? Why do you not change the code to use something else? e.g. some empty/ununsed/pushed register? floating point division is not well known for speed, regardless of the implementation..... You could even disable interrupts during your assembly code, thats not really a smart solution but it will prevent collisions. Matthias |
From: pito <pi...@vo...> - 2011-05-26 20:07:29
|
Matthias, I do understand.. The point is not how huge the asm snippets are, but that the .asm user cannot use the status register freely. As the speed of the amforth is concerned, you know well the floating point without fast asm. libraries is not usable. Maybe as a floating point l'art pour l'art exercise..P. ----- PŮVODNÍ ZPRÁVA ----- Od: "Matthias Trute" <mt...@we...> Komu: "pito" <pi...@vo...> Předmět: Re: [Amforth] Interrupts - T flag, asm float problem Datum: 26.5.2011 - 21:52:12 > Hi Pito, > > > I need the Status Register as well, of course > > (;-)). > > > It cannot be changed during an interrupt event > > (you are manipulating > > > the T flag there). > > That is part of the magic how the forth VM > synchronizes interrupt > handling with the controller state. Its not a > convential way, yes. > > > Imagine you run a routine and somebody changes a > > flag there in SR. > > No problem. Remember: amforth is a runtime > environment for > forth code, not for (huge) assembler code > snippets. They > are useful, no doubt, but they must follow the > rules > (expressed and implied ones). > > > Would it be possible to use, as the interrupt > > signalling, a bit outside the status > > register??P. > > > Not really. There is nothing as speedy as the > status > register based jumps. And the inner interpreter > checks > that interrupt signalling bit every time it is > called. > Speed is a must-have there. > > What about you? Why do you not change the code to > use > something else? e.g. some empty/ununsed/pushed > register? > floating point division is not well known for > speed, regardless > of the implementation..... > > You could even disable interrupts during your > assembly code, thats > not really a smart solution but it will prevent > collisions. > > Matthias > |
From: pito <pi...@vo...> - 2011-05-26 21:40:31
|
In my newest float libs (1/2011) I am handling T this way - pushing an poping it into r14.7. It worked with 4.0 and 4.2. Is it possible you set the T in 4.0/4.2 within the inner interpreter only (it means before entering a word) and now you set the T anytime when interrupt fires- it means maybe during e.g. __SUBF12?? ..... ld R30, Y+ ld R31, Y+ ; ############ BLD R14, 7 push R28 push R29 CALL __SUBF12 pop R29 pop R28 BST R14, 7 ; ############ ; store B st -Y , R31 st -Y , R30 .... P/ ----- PŮVODNÍ ZPRÁVA ----- Od: "pito" <pi...@vo...> Komu: mt...@we..., pi...@vo..., amf...@li... Předmět: Re: [Amforth] Interrupts - T flag, asm float problem Datum: 26.5.2011 - 22:07:18 > Matthias, I do understand.. The point is not how > huge the asm > snippets are, but that the .asm user cannot use > the status register > freely. As the speed of the amforth is concerned, > you know well the > floating point without fast asm. libraries is not > usable. Maybe as a > floating point l'art pour l'art exercise..P. > > ----- PŮVODNÍ ZPRÁVA ----- > Od: "Matthias Trute" <mt...@we...> > Komu: "pito" <pi...@vo...> > Předmět: Re: [Amforth] Interrupts - T flag, asm > float problem > Datum: 26.5.2011 - 21:52:12 > > > Hi Pito, > > > > > I need the Status Register as well, of course > > > (;-)). > > > > It cannot be changed during an interrupt > > > > event > > > > > > (you are manipulating > > > > the T flag there). > > > > That is part of the magic how the forth VM > > synchronizes interrupt > > handling with the controller state. Its not a > > convential way, yes. > > > > > Imagine you run a routine and somebody changes > > > a > > > > > flag there in SR. > > > > No problem. Remember: amforth is a runtime > > environment for > > forth code, not for (huge) assembler code > > snippets. They > > are useful, no doubt, but they must follow the > > rules > > (expressed and implied ones). > > > > > Would it be possible to use, as the interrupt > > > signalling, a bit outside the status > > > register??P. > > > > > Not really. There is nothing as speedy as the > > status > > register based jumps. And the inner interpreter > > checks > > that interrupt signalling bit every time it is > > called. > > Speed is a must-have there. > > > > What about you? Why do you not change the code > > to > > > use > > something else? e.g. some empty/ununsed/pushed > > register? > > floating point division is not well known for > > speed, regardless > > of the implementation..... > > > > You could even disable interrupts during your > > assembly code, thats > > not really a smart solution but it will prevent > > collisions. > > > > Matthias > > > > -- IHNED.cz je nový, přehlednější a rychlejší. Přesvědčte se na: www.ihned.cz |
From: Matthias T. <mt...@we...> - 2011-05-27 06:03:38
|
Pito, > In my newest float libs (1/2011) I am handling T this way - pushing > an poping it into r14.7. It worked with 4.0 and 4.2. Is it possible > you set the T in 4.0/4.2 within the inner interpreter only (it means > before entering a word) and now you set the T anytime when interrupt > fires- it means maybe during e.g. __SUBF12?? The redesign of the interrupt handling did not change _that_ part. It was always as it is now. The T-flag could be set anytime, and the inner intepreter checks it whenever it is entered. The timing has not changed here. What has changed is, that the controller itself is kept significantly longer in interrupt mode than in previous versions, since the reti instruction has been delayd. I cannot see anything here that could do harm to your code however. Even long running assembly snippets did work as before in my tests (they of course did not touch the T flag). Currently I'd that it was pure luck, that the error did not came up earlier.. strange enough.. Matthias |
From: pito <pi...@vo...> - 2011-05-27 09:16:23
|
Yes, the CLI/SEI helped, however it it not the best solution, though. I'll try to remove T handling from my asm. But still coping with rec-float.. P. ----- PŮVODNÍ ZPRÁVA ----- Od: "Matthias Trute" <mt...@we...> Komu: "pito" <pi...@vo...> Předmět: Re: [Amforth] Interrupts - T flag, asm float problem Datum: 27.5.2011 - 8:03:29 > Pito, > > > In my newest float libs (1/2011) I am handling T > > this way - pushing > > > an poping it into r14.7. It worked with 4.0 and > > 4.2. Is it possible > > > you set the T in 4.0/4.2 within the inner > > interpreter only (it means > > > before entering a word) and now you set the T > > anytime when interrupt > > > fires- it means maybe during e.g. __SUBF12?? > > The redesign of the interrupt handling did not > change _that_ > part. It was always as it is now. The T-flag could > be set > anytime, and the inner intepreter checks it > whenever it > is entered. The timing has not changed here. > > What has changed is, that the controller itself is > kept significantly > longer in interrupt mode than in previous > versions, since the reti > instruction has been delayd. I cannot see anything > here that could do > harm to your code however. Even long running > assembly snippets did work > as before in my tests (they of course did not > touch the T flag). > > Currently I'd that it was pure luck, that the > error did not came up > earlier.. strange enough.. > > Matthias > |