Thread View: comp.lang.forth
4 messages
4 total messages
Started by Anton Ertl
Wed, 07 Oct 2026 06:30
Re: You cannot know how many cells a floating-point number takes?
Author: Anton Ertl
Date: Wed, 07 Oct 2026 06:30
Date: Wed, 07 Oct 2026 06:30
19 lines
2124 bytes
2124 bytes
marcel hendrix <mhx@iae.nl> writes:
>Except for the FFL, I have yet to see the first useful library that
>needs to know the size of the FP stack.
My code for summing up an array needs an FP stack that is deeper than
8 elements for all but the smalles arrays for SHIFT-REDUCE-SUM; for
RECURSIVE-SUM, it checks the stack depth, and if it is small, the
higher levels of the evaluation move intermediate results from the FP
stack before calling the lower-level SUM<n> words which use up to 8 FP
stack items.
https://www.complang.tuwien.ac.at/forth/programs/pairwise-sum.4th
- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: https://forth-standard.org/
EuroForth 2026 CFP: http://www.euroforth.org/ef26/cfp.html
Re: You cannot know how many cells a floating-point number takes?
Author: marcel hendrix
Date: Wed, 07 Oct 2026 10:43
Date: Wed, 07 Oct 2026 10:43
20 lines
2221 bytes
2221 bytes
On 10/7/2026 8:30 AM, Anton Ertl wrote: > marcel hendrix <mhx@iae.nl> writes: >> Except for the FFL, I have yet to see the first useful library that >> needs to know the size of the FP stack. > > My code for summing up an array needs an FP stack that is deeper than > 8 elements for all but the smalles arrays for SHIFT-REDUCE-SUM; for > RECURSIVE-SUM, it checks the stack depth, and if it is small, the > higher levels of the evaluation move intermediate results from the FP > stack before calling the lower-level SUM<n> words which use up to 8 FP > stack items. > > https://www.complang.tuwien.ac.at/forth/programs/pairwise-sum.4th > Did you check if it speeds up the NORMAL() algorithm in the mm.frt benchmark? -marcel
Re: You cannot know how many cells a floating-point number takes?
Author: Anton Ertl
Date: Wed, 07 Oct 2026 11:01
Date: Wed, 07 Oct 2026 11:01
30 lines
2630 bytes
2630 bytes
marcel hendrix <mhx@iae.nl> writes:
>On 10/7/2026 8:30 AM, Anton Ertl wrote:
>> marcel hendrix <mhx@iae.nl> writes:
>>> Except for the FFL, I have yet to see the first useful library that
>>> needs to know the size of the FP stack.
>>
>> My code for summing up an array needs an FP stack that is deeper than
>> 8 elements for all but the smalles arrays for SHIFT-REDUCE-SUM; for
>> RECURSIVE-SUM, it checks the stack depth, and if it is small, the
>> higher levels of the evaluation move intermediate results from the FP
>> stack before calling the lower-level SUM<n> words which use up to 8 FP
>> stack items.
>>
>> https://www.complang.tuwien.ac.at/forth/programs/pairwise-sum.4th
>>
>
>Did you check if it speeds up the NORMAL() algorithm in the mm.frt
>benchmark?
No. I did check the performance of summing up arrays
<2025Jul16.132504@mips.complang.tuwien.ac.at>. One can use the
pairwise sum technique for speeding up DDOT, and thus the "normal"
matrix multiplication algorithm.
- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: https://forth-standard.org/
EuroForth 2026 CFP: http://www.euroforth.org/ef26/cfp.html
Re: You cannot know how many cells a floating-point number takes?
Author: Anton Ertl
Date: Wed, 07 Oct 2026 20:41
Date: Wed, 07 Oct 2026 20:41
19 lines
2085 bytes
2085 bytes
marcel hendrix <mhx@iae.nl> writes:
>On 10/7/2026 8:30 AM, Anton Ertl wrote:
>> https://www.complang.tuwien.ac.at/forth/programs/pairwise-sum.4th
>>
>
>Did you check if it speeds up the NORMAL() algorithm in the mm.frt
>benchmark?
The "normal algorithm" suffers from bad spacial locality, leading to
TLB (and maybe cache) thrashing. The benefits of pairwise addition in
DDOT probably vanish in the TLB and cache misses caused by the "normal
algorithm".
- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: https://forth-standard.org/
EuroForth 2026 CFP: http://www.euroforth.org/ef26/cfp.html
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads