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


Groups > comp.lang.forth > #135600

Re: First result in riscv optimiser

From Kragen Javier Sitaker <kragen@canonical.org>
Newsgroups comp.lang.forth
Subject Re: First result in riscv optimiser
Date 2026-09-08 02:21 -0300
Organization Primarily biological and memetic
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>

Show all headers | 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