On 6 Jun 2022 at 18:16:17 CEST, "dxforth" <
dxf...@gmail.com> wrote:
I'm puzzled by the claim an optimizing compiler wouldn't know how to
handle a colon definition with UNNEST or ABANDON in it. When I write a
discrete definition I expect the compiler to respect that and optimize
only when safe to do so. The presence of those words should signal
don't inline this definition.
The whole return stack manipulation issue is more complex that you give
it credit for. There are three scenarios:
1) classical Forth - return address is on return stack unmodified
This applies for most x86/x64 Forths. It's possible to track the use of
> R and R> and you can predict how many levels of return address
are involved. However, I have not been able to convince myself
that this can be done completely accurately.
2) Modified return address - e.g. ARM Cortex M
In these systems there's a single-cell return address where you expect
it, but it has some modifications, e.g. bit 0 is always 1.
3) Return address is not a single cell - e.g. DSPIC
There were papers about this topic by Michael Gassanenko, who
proposed a return stack manipulation wordset for the purpose. It
was the closest approach to sanity given the problems. Also, I can
guess what UNNEST does, but ABANDON? - Give me a break. See
http://www.euroforth.org/ef98/gassanenko98b.pdf
Stephen
--
--
Stephen Pelc,
ste...@vfxforth.com
MicroProcessor Engineering, Ltd. - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel:
+44 (0)23 8063 1441, +44 (0)78 0390 3612,
+34 649 662 974
http://www.mpeforth.com - free VFX Forth downloads