Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #135600

Re: First result in riscv optimiser

Path csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From Kragen Javier Sitaker <kragen@canonical.org>
Newsgroups comp.lang.forth
Subject Re: First result in riscv optimiser
Date Tue, 08 Sep 2026 02:21:32 -0300
Organization Primarily biological and memetic
Lines 40
Message-ID <87y0dcgvxf.fsf@debian> (permalink)
References <nnd$172defd2$1b2df6f6@e430673098f06a19> <2026Sep1.173341@mips.complang.tuwien.ac.at> <87ecf96ljg.fsf@debian> <nnd$23c5006f$6f768ed1@9c6c99f017e8c6d5>
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
Injection-Date Tue, 08 Sep 2026 05:23:50 +0000 (UTC)
Injection-Info dont-email.me; logging-data="4099120"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19DqYA3YmL3CXU03n8p+C+D"; posting-host="d8b2792e0f4b3d7e1e2ac925ec3696b1"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock sha1:yG8gX3fXuvGP5Z+hmWuHgu0AT3c= sha1:76ajvfPV574SoDwbkb962HwiUrs= sha256:ZQbQpUhol7RM31xJdd/63kHDHXsVLlwz/4vyz41jnWQ= sha1:Q9OnCH5xUcvp2T43fe3ubOBr0ro= sha256:5VHuVl/9z/4FkIAxV9wny3W6CKbz8uc7L/iD1eUR3/Y=
Xref csiph.com comp.lang.forth:135600

Show key headers only | View raw


albert@spenarnc.xs4all.nl writes:
> In article <87ecf96ljg.fsf@debian>,
> Kragen Javier Sitaker  <kragen@canonical.org> wrote:
>>anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
>>> (...) in general I don't think that full constant folding will trigger
>>> often, (...)
>>
>>This is contextual.  (...)
>
> You bet it is.
> This is a test  of the optimiser for i86 (that is unfinished but
> partly working)
> -------------------------------------
> \ Test of annihilating.
> : test6 BASE @ IF SWAP THEN 2DROP ;
>
> ...
>
> : test6
> DROP   DROP
> ;
>
> After inlining of code words:
>
>    POP|X, AX|
>    POP|X, AX|

This is not quite constant folding, but it’s a related optimization.  I
don’t remember if it has an accepted name — it’s close to register
allocation, but of course you aren’t allocating any registers.  Clearly
it makes a great improvement in `test6`.  However, how does such code
arise?  You surely wouldn’t intentionally write it that way in
production code.  Conditional compilation with [ifdef] and the like?
Subroutine inlining?

That is, this kind of optimization can be extremely powerful — but
generally only in synergy with other optimizations which create
opportunities for it.

Kragen

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

First result in riscv optimiser albert@spenarnc.xs4all.nl - 2026-09-01 10:49 +0200
  Re: First result in riscv optimiser anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-09-01 15:33 +0000
    Re: First result in riscv optimiser albert@spenarnc.xs4all.nl - 2026-09-01 18:54 +0200
    Re: First result in riscv optimiser albert@spenarnc.xs4all.nl - 2026-09-02 11:18 +0200
    Re: First result in riscv optimiser Kragen Javier Sitaker <kragen@canonical.org> - 2026-09-04 13:14 -0300
      Re: First result in riscv optimiser albert@spenarnc.xs4all.nl - 2026-09-05 13:06 +0200
        Re: First result in riscv optimiser Kragen Javier Sitaker <kragen@canonical.org> - 2026-09-08 02:21 -0300
          Re: First result in riscv optimiser albert@spenarnc.xs4all.nl - 2026-09-08 12:38 +0200
            Re: First result in riscv optimiser Kragen Javier Sitaker <kragen@canonical.org> - 2026-09-11 07:50 -0300
              Re: First result in riscv optimiser Paul Rubin <no.email@nospam.invalid> - 2026-09-11 17:09 -0700
              Re: First result in riscv optimiser albert@spenarnc.xs4all.nl - 2026-09-13 14:03 +0200
            Re: First result in riscv optimiser antispam@fricas.org (Waldek Hebisch) - 2026-09-13 02:53 +0000

csiph-web