Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

One Bell System - it sometimes works.


devel / comp.arch / Re: AMD CPU funny

SubjectAuthor
* Re: AMD CPU funnyTheo
+- Re: AMD CPU funnyMitchAlsup
`* Re: AMD CPU funnyVir Campestris
 +* Re: AMD CPU funnyScott Lurndal
 |`* Re: AMD CPU funnyVir Campestris
 | +* Re: AMD CPU funnyMichael S
 | |`* Re: AMD CPU funnyMitchAlsup
 | | `* Re: AMD CPU funnyMichael S
 | |  `- Re: AMD CPU funnyMitchAlsup
 | `* Re: AMD CPU funnyAndy Burns
 |  `* Re: AMD CPU funnyChris M. Thomasson
 |   `- Re: AMD CPU funnyChris M. Thomasson
 +* Re: AMD CPU funnyMitchAlsup
 |`* Re: AMD CPU funnyVir Campestris
 | `* Re: AMD CPU funnyTheo
 |  `* Re: AMD CPU funnyMitchAlsup
 |   `* Re: AMD CPU funnyTheo
 |    +- Re: AMD CPU funnyMitchAlsup
 |    `* Re: AMD CPU funnyVir Campestris
 |     `* Re: AMD CPU funnyThomas Koenig
 |      `* Re: AMD CPU funnyDavid Brown
 |       `* Re: AMD CPU funnyVir Campestris
 |        +- Re: AMD CPU funnyDavid Brown
 |        `* Re: AMD CPU funnyMichael S
 |         `* Re: AMD CPU funnyVir Campestris
 |          `* Re: AMD CPU funnyAndy Burns
 |           `* Re: AMD CPU funnyTerje Mathisen
 |            `* Re: AMD CPU funnyBGB
 |             `* Re: AMD CPU funnyMitchAlsup
 |              +* Re: AMD CPU funnyBGB
 |              |+- Re: AMD CPU funnyMitchAlsup
 |              |`* Re: AMD CPU funnyPancho
 |              | +* Re: AMD CPU funnyDaniel James
 |              | |+* Re: AMD CPU funnyPancho
 |              | ||+* Re: AMD CPU funnyTerje Mathisen
 |              | |||+* Re: AMD CPU funnyPancho
 |              | ||||`- Re: AMD CPU funnyMitchAlsup
 |              | |||`- Re: AMD CPU funnyMitchAlsup
 |              | ||+- Re: AMD CPU funnyPancho
 |              | ||`* Re: AMD CPU funnyDaniel James
 |              | || +* Re: AMD CPU funnyTim Rentsch
 |              | || |`* Re: AMD CPU funnyTerje Mathisen
 |              | || | `- Re: AMD CPU funnyTim Rentsch
 |              | || `* Re: AMD CPU funnyPancho
 |              | ||  `- Re: AMD CPU funnyTim Rentsch
 |              | |+* Re: AMD CPU funnyMitchAlsup
 |              | ||`- Re: AMD CPU funnyTerje Mathisen
 |              | |`* Re: AMD CPU funnyTim Rentsch
 |              | | +* Re: AMD CPU funnyTerje Mathisen
 |              | | |+- Re: AMD CPU funnyMitchAlsup
 |              | | |`* Re: AMD CPU funnyTim Rentsch
 |              | | | `* Re: AMD CPU funnyTerje Mathisen
 |              | | |  `- Re: AMD CPU funnyTim Rentsch
 |              | | `* Re: AMD CPU funnyBGB
 |              | |  `- Re: AMD CPU funnyTim Rentsch
 |              | `* Re: AMD CPU funnyTim Rentsch
 |              |  `* Re: AMD CPU funnyThomas Koenig
 |              |   +* Re: AMD CPU funnyMitchAlsup
 |              |   |+* Re: AMD CPU funnyTerje Mathisen
 |              |   ||`- Re: AMD CPU funnyTim Rentsch
 |              |   |`* Re: AMD CPU funnyThomas Koenig
 |              |   | +- Re: AMD CPU funnyMitchAlsup
 |              |   | `- Re: AMD CPU funnyTerje Mathisen
 |              |   `* Re: AMD CPU funnyTim Rentsch
 |              |    +* Re: AMD CPU funnyTerje Mathisen
 |              |    |`* Re: AMD CPU funnyTim Rentsch
 |              |    | +* Re: AMD CPU funnyMitchAlsup
 |              |    | |`- Re: AMD CPU funnyTim Rentsch
 |              |    | `* Re: AMD CPU funnyTerje Mathisen
 |              |    |  +* Re: AMD CPU funnyMitchAlsup
 |              |    |  |+* Re: AMD CPU funnyTerje Mathisen
 |              |    |  ||`* Re: AMD CPU funnyMitchAlsup
 |              |    |  || +- Re: AMD CPU funnyTim Rentsch
 |              |    |  || `* Re: AMD CPU funnyTerje Mathisen
 |              |    |  ||  `* Re: AMD CPU funnyTerje Mathisen
 |              |    |  ||   +* Re: AMD CPU funnyTim Rentsch
 |              |    |  ||   |`* Re: AMD CPU funnyTerje Mathisen
 |              |    |  ||   | `* Re: AMD CPU funnyTim Rentsch
 |              |    |  ||   |  `* Re: AMD CPU funnyTerje Mathisen
 |              |    |  ||   |   `- Re: AMD CPU funnyTim Rentsch
 |              |    |  ||   `* Re: AMD CPU funnyMitchAlsup
 |              |    |  ||    `* Re: AMD CPU funnyMitchAlsup
 |              |    |  ||     `- Re: AMD CPU funnyTim Rentsch
 |              |    |  |`- Re: AMD CPU funnyTim Rentsch
 |              |    |  `* Re: AMD CPU funnyTim Rentsch
 |              |    |   `* Re: AMD CPU funnyTerje Mathisen
 |              |    |    `* Re: AMD CPU funnyTim Rentsch
 |              |    |     `- Re: AMD CPU funnyTerje Mathisen
 |              |    `* Re: AMD CPU funnyThomas Koenig
 |              |     +* Re: AMD CPU funnyTim Rentsch
 |              |     |`- Re: AMD CPU funnyTerje Mathisen
 |              |     `* Re: AMD CPU funnyMitchAlsup
 |              |      `* Re: AMD CPU funnyPaul A. Clayton
 |              |       +* Re: AMD CPU funnyAnton Ertl
 |              |       |+- Re: AMD CPU funnyMitchAlsup
 |              |       |`* Re: AMD CPU funnyGeorge Neuner
 |              |       | `- Re: AMD CPU funnyAnton Ertl
 |              |       `- Re: AMD CPU funnyBGB-Alt
 |              `- Re: AMD CPU funnyTerje Mathisen
 `* Re: AMD CPU funnyAndy Burns
  +* Re: AMD CPU funnyAndy Burns
  `- Re: AMD CPU funnyMitchAlsup

Pages:12345
Re: AMD CPU funny

<2024Jan9.084151@mips.complang.tuwien.ac.at>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=36750&group=comp.arch#36750

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: AMD CPU funny
Date: Tue, 09 Jan 2024 07:41:51 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 34
Message-ID: <2024Jan9.084151@mips.complang.tuwien.ac.at>
References: <ulv7j4$l0o0$1@dont-email.me> <umn15d$svun$6@dont-email.me> <kv8gt0Fca4nU6@mid.individual.net> <ump7l3$19ud7$1@dont-email.me> <umpn9d$1c212$1@dont-email.me> <bc7bd58cc9f25ca592dc5c62f415ceec@news.novabbs.com> <umq8hi$1ebuo$1@dont-email.me> <umrb9a$1m3mj$1@dont-email.me> <86cyuksoc0.fsf@linuxsc.com> <umvfc1$1qq5r$1@newsreader4.netcologne.de> <86y1d8qh1m.fsf@linuxsc.com> <un0rpm$1rkc9$1@newsreader4.netcologne.de> <b0a868b435300a4eb248824c47c81eb7@news.novabbs.com> <unh0kq$1ig5u$1@dont-email.me>
Injection-Info: dont-email.me; posting-host="de04c99a761c1ef70f89a4b703d0aa02";
logging-data="2041604"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19CoaaoodwrX5i/RBmy67yA"
Cancel-Lock: sha1:H9KUL1Q0RzR7D22xC3yFaOWhsoM=
X-newsreader: xrn 10.11
 by: Anton Ertl - Tue, 9 Jan 2024 07:41 UTC

"Paul A. Clayton" <paaronclayton@gmail.com> writes:
>I also vaguely recall reading at some point that even
>recursion that was "easy" to convert to tail recursion was
>not handled by gcc (also many years ago).

What looks like a tail-call to a Lisp or Scheme programmer actually is
not when it comes to C. That's because in C calling conventions, the
caller is responsible for cleaning up the stack, and this aspect of
the calling conventions is necessitated by the combination of varargs
and the optionality of function declarations.

So when in a C program you have

...
return foo(...);
}

in assembly language this is:

call foo
add $96, %rsp ;or something like that
return

and tail-call elimination of that is not possible in general. gcc has
something called sib-call elimination ("sib" for sibling), and AFAIK
this includes tail-recursion elimination, but I expect that even that
does not work at all times, e.g., because a pointer is passed to the
called function, and the C compiler cannot prove that it does not
point to something that is on the stack frame of the caller.

- anton
--
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>

Re: AMD CPU funny

<unkd9l$25ead$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=36764&group=comp.arch#36764

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bohannonindustriesllc@gmail.com (BGB-Alt)
Newsgroups: comp.arch
Subject: Re: AMD CPU funny
Date: Tue, 9 Jan 2024 15:19:49 -0600
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <unkd9l$25ead$1@dont-email.me>
References: <ulv7j4$l0o0$1@dont-email.me> <um1h21$13l52$1@dont-email.me>
<e2bb329488167ada6ece600c8f28d3ed@news.novabbs.com>
<um43of$1j3jj$1@dont-email.me> <eVh*Lrxyz@news.chiark.greenend.org.uk>
<3d2dcfa36ceca1ee856b9de3ab416a01@news.novabbs.com>
<fVh*Dgyyz@news.chiark.greenend.org.uk> <um7jom$27ikh$3@dont-email.me>
<um7o72$1bj9r$1@newsreader4.netcologne.de> <umc56l$32ucu$1@dont-email.me>
<umhbqp$3um9d$1@dont-email.me> <20231227183842.00001b4f@yahoo.com>
<umn15d$svun$6@dont-email.me> <kv8gt0Fca4nU6@mid.individual.net>
<ump7l3$19ud7$1@dont-email.me> <umpn9d$1c212$1@dont-email.me>
<bc7bd58cc9f25ca592dc5c62f415ceec@news.novabbs.com>
<umq8hi$1ebuo$1@dont-email.me> <umrb9a$1m3mj$1@dont-email.me>
<86cyuksoc0.fsf@linuxsc.com> <umvfc1$1qq5r$1@newsreader4.netcologne.de>
<86y1d8qh1m.fsf@linuxsc.com> <un0rpm$1rkc9$1@newsreader4.netcologne.de>
<b0a868b435300a4eb248824c47c81eb7@news.novabbs.com>
<unh0kq$1ig5u$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 9 Jan 2024 21:19:49 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a4401b75323688b0c925a04af17e1b61";
logging-data="2275661"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX199zpUu+PRj+bLG5zR6t9Ku47gpKnYbzLo="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:FnJIzmzRBVlnOYLIhArd6/1BALo=
In-Reply-To: <unh0kq$1ig5u$1@dont-email.me>
Content-Language: en-US
 by: BGB-Alt - Tue, 9 Jan 2024 21:19 UTC

On 1/8/2024 8:25 AM, Paul A. Clayton wrote:
> On 1/2/24 2:10 PM, MitchAlsup wrote:
>> Thomas Koenig wrote:
>>
>>> Compilers often do not do a good job of replacing recursion
>>> with iteration (is there a verb for that? Maybe it can be called
>>> iterationizing?), so it is something to consider if an algorithm
>>> is at all time critical or stack space is problematic.
>>
>>
>> Tail recursion elimination.
>
> I thought compilers generally were good at tail recursion
> elimination but did not attempt "flattening" something like
> flood-fill (which is not "tail recursion" but could avoid
> some of the function call overhead). (I.e., I vaguely
> remember over a decade ago noticing that this case was not
> optimized — for the samegnome game which has a small board
> so recursive depth and call overhead was not really significant.)
>
> I also vaguely recall reading at some point that even
> recursion that was "easy" to convert to tail recursion was
> not handled by gcc (also many years ago).

AFAIK:
Tail-call optimization is not really a thing in general in C;
But, at the same time, for the most part people are not writing
tail-recursive code in C, with the rare exception of a function whose
sole purpose is to wrap a call to another function, which could
in-premise be optimized into potentially a few register moves and
similar followed by a branch.

Granted, I guess trying to optimize the "function which just calls
another function" case could be something worth looking into whether it
would make sense to try to add an optimization case for it.

Re: AMD CPU funny

<da2666e6117551ffa1703cc66d1cae82@www.novabbs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=36773&group=comp.arch#36773

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchalsup@aol.com (MitchAlsup)
Newsgroups: comp.arch
Subject: Re: AMD CPU funny
Date: Wed, 10 Jan 2024 03:16:13 +0000
Organization: novaBBS
Message-ID: <da2666e6117551ffa1703cc66d1cae82@www.novabbs.com>
References: <ulv7j4$l0o0$1@dont-email.me> <umn15d$svun$6@dont-email.me> <kv8gt0Fca4nU6@mid.individual.net> <ump7l3$19ud7$1@dont-email.me> <umpn9d$1c212$1@dont-email.me> <bc7bd58cc9f25ca592dc5c62f415ceec@news.novabbs.com> <umq8hi$1ebuo$1@dont-email.me> <umrb9a$1m3mj$1@dont-email.me> <86cyuksoc0.fsf@linuxsc.com> <umvfc1$1qq5r$1@newsreader4.netcologne.de> <86y1d8qh1m.fsf@linuxsc.com> <un0rpm$1rkc9$1@newsreader4.netcologne.de> <b0a868b435300a4eb248824c47c81eb7@news.novabbs.com> <unh0kq$1ig5u$1@dont-email.me> <2024Jan9.084151@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="2916045"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Rslight-Posting-User: ebd9cd10a9ebda631fbccab5347a0f771d5a2118
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Site: $2y$10$FQWvwziet9Q7sp.fSWu5aexp9jj5BDlODN3rzZxTZb49hZVLFt6sW
 by: MitchAlsup - Wed, 10 Jan 2024 03:16 UTC

Anton Ertl wrote:

> "Paul A. Clayton" <paaronclayton@gmail.com> writes:
>>I also vaguely recall reading at some point that even
>>recursion that was "easy" to convert to tail recursion was
>>not handled by gcc (also many years ago).

> What looks like a tail-call to a Lisp or Scheme programmer actually is
> not when it comes to C. That's because in C calling conventions, the
> caller is responsible for cleaning up the stack, and this aspect of
> the calling conventions is necessitated by the combination of varargs
> and the optionality of function declarations.

Both the caller and the callee are responsible for cleaning up their own
parts of the stack including argument passing and result returning.

My 66000 ABU is varargs compliant and yet the caller does not need to
know the function it is calling is varargs. Caller just lobs up to 8
arguments into R1..R8 with argument[9]+ on the stack at [SP]+; when the
callee is varargs, callee pushes R8..R1 onto the stack creating a vector
of arguments which can be indexed as subroutine consumes one varags after
another..

> So when in a C program you have

> ...
> return foo(...);
> }

> in assembly language this is:

> call foo
> add $96, %rsp ;or something like that
> return

The add $96 is the "subroutine calling foo()" cleaning itself up.

> and tail-call elimination of that is not possible in general.

Prior to control transfer, the stack must be as expected at the entry
point and the local data must already be in its expected place {stack,
registers}. This makes it harder, but not impossible. So, tail call
elimination requires running through the epilogue so you can branch
back to the prologue. If you understand this, you can tail-call to
post prologue code and leave the stack alone.

So, instead of::

foo:
prologue
foo__body:
body
bc foo__epilogue
call foo()
foo__epilogue:
epilogue
RET
one can write:

foo:
prologue
foo__body:
body
bc foo__body
epilogue
RET

The reason it works well and smoothly in LISP and Scheme is that both
languages would be DOA without it.

> gcc has
> something called sib-call elimination ("sib" for sibling), and AFAIK
> this includes tail-recursion elimination, but I expect that even that
> does not work at all times, e.g., because a pointer is passed to the
> called function, and the C compiler cannot prove that it does not
> point to something that is on the stack frame of the caller.

> - anton

Re: AMD CPU funny

<bi9upidqoqb51s2ll632ge3or72vjfp42f@4ax.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=36796&group=comp.arch#36796

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: gneuner2@comcast.net (George Neuner)
Newsgroups: comp.arch
Subject: Re: AMD CPU funny
Date: Wed, 10 Jan 2024 18:27:34 -0500
Organization: i2pn2 (i2pn.org)
Message-ID: <bi9upidqoqb51s2ll632ge3or72vjfp42f@4ax.com>
References: <ump7l3$19ud7$1@dont-email.me> <umpn9d$1c212$1@dont-email.me> <bc7bd58cc9f25ca592dc5c62f415ceec@news.novabbs.com> <umq8hi$1ebuo$1@dont-email.me> <umrb9a$1m3mj$1@dont-email.me> <86cyuksoc0.fsf@linuxsc.com> <umvfc1$1qq5r$1@newsreader4.netcologne.de> <86y1d8qh1m.fsf@linuxsc.com> <un0rpm$1rkc9$1@newsreader4.netcologne.de> <b0a868b435300a4eb248824c47c81eb7@news.novabbs.com> <unh0kq$1ig5u$1@dont-email.me> <2024Jan9.084151@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: i2pn2.org;
logging-data="3015974"; mail-complaints-to="usenet@i2pn2.org";
posting-account="h5eMH71iFfocGZucc+SnA0y5I+72/ecoTCcIjMd3Uww";
User-Agent: ForteAgent/8.00.32.1272
X-Spam-Checker-Version: SpamAssassin 4.0.0
 by: George Neuner - Wed, 10 Jan 2024 23:27 UTC

On Tue, 09 Jan 2024 07:41:51 GMT, anton@mips.complang.tuwien.ac.at
(Anton Ertl) wrote:

>"Paul A. Clayton" <paaronclayton@gmail.com> writes:
>>I also vaguely recall reading at some point that even
>>recursion that was "easy" to convert to tail recursion was
>>not handled by gcc (also many years ago).
>
>What looks like a tail-call to a Lisp or Scheme programmer actually is
>not when it comes to C. That's because in C calling conventions, the
>caller is responsible for cleaning up the stack, and this aspect of
>the calling conventions is necessitated by the combination of varargs
>and the optionality of function declarations.
>
>So when in a C program you have
>
> ...
> return foo(...);
>}
>
>in assembly language this is:
>
>call foo
>add $96, %rsp ;or something like that
>return
>
>and tail-call elimination of that is not possible in general. gcc has
>something called sib-call elimination ("sib" for sibling), and AFAIK
>this includes tail-recursion elimination, but I expect that even that
>does not work at all times, e.g., because a pointer is passed to the
>called function, and the C compiler cannot prove that it does not
>point to something that is on the stack frame of the caller.
>
>- anton

You can tail-call and continuation-pass in C with the
Cheney-on-the-MTA technique.

https://plover.com/~mjd/misc/hbaker-archive/CheneyMTA.html

TLDR; the idea is to bookmark the stack with setjmp(), allow it to
grow until some high-water mark is passed, then longjmp() to release
it all at once.

YMMV,
George

Re: AMD CPU funny

<2024Jan11.085916@mips.complang.tuwien.ac.at>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=36812&group=comp.arch#36812

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: AMD CPU funny
Date: Thu, 11 Jan 2024 07:59:16 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 41
Message-ID: <2024Jan11.085916@mips.complang.tuwien.ac.at>
References: <ump7l3$19ud7$1@dont-email.me> <umpn9d$1c212$1@dont-email.me> <bc7bd58cc9f25ca592dc5c62f415ceec@news.novabbs.com> <umq8hi$1ebuo$1@dont-email.me> <umrb9a$1m3mj$1@dont-email.me> <86cyuksoc0.fsf@linuxsc.com> <umvfc1$1qq5r$1@newsreader4.netcologne.de> <86y1d8qh1m.fsf@linuxsc.com> <un0rpm$1rkc9$1@newsreader4.netcologne.de> <b0a868b435300a4eb248824c47c81eb7@news.novabbs.com> <unh0kq$1ig5u$1@dont-email.me> <2024Jan9.084151@mips.complang.tuwien.ac.at> <bi9upidqoqb51s2ll632ge3or72vjfp42f@4ax.com>
Injection-Info: dont-email.me; posting-host="44eee21e9d3a9d877471ba40aa76ed51";
logging-data="3072264"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+2Yix71qoEoTFr6vxytXrK"
Cancel-Lock: sha1:+jX+tJaZDP6gaEq0l+LR+qqBCy0=
X-newsreader: xrn 10.11
 by: Anton Ertl - Thu, 11 Jan 2024 07:59 UTC

George Neuner <gneuner2@comcast.net> writes:
>On Tue, 09 Jan 2024 07:41:51 GMT, anton@mips.complang.tuwien.ac.at
>(Anton Ertl) wrote:
>>So when in a C program you have
>>
>> ...
>> return foo(...);
>>}
>>
>>in assembly language this is:
>>
>>call foo
>>add $96, %rsp ;or something like that
>>return
>>
>>and tail-call elimination of that is not possible in general. gcc has
>>something called sib-call elimination ("sib" for sibling), and AFAIK
>>this includes tail-recursion elimination, but I expect that even that
>>does not work at all times, e.g., because a pointer is passed to the
>>called function, and the C compiler cannot prove that it does not
>>point to something that is on the stack frame of the caller.
>>
>>- anton
>
>You can tail-call and continuation-pass in C with the
>Cheney-on-the-MTA technique.
>
>https://plover.com/~mjd/misc/hbaker-archive/CheneyMTA.html
>
>TLDR; the idea is to bookmark the stack with setjmp(), allow it to
>grow until some high-water mark is passed, then longjmp() to release
>it all at once.

Yes, you can implement the aspect that tail calls are guaranteed to be
unlimited in languages like Scheme in that way, but it's not
particularly efficient.

- anton
--
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>

Pages:12345
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor