Re: Locals revisited

Liste des GroupesRevenir à cl forth 
Sujet : Re: Locals revisited
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.lang.forth
Date : 28. Mar 2025, 09:27:03
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2025Mar28.092703@mips.complang.tuwien.ac.at>
References : 1 2 3 4
User-Agent : xrn 10.11
Paul Rubin <no.email@nospam.invalid> writes:
anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
There is the E subspecification of the RISC-V specification with 16
registers.  I don't know if anybody has implemented this.
>
The CH32V003 uses it and is of some interest as a Forth target.  It has
16k of flash and 2k of ram.

Interesting.  But with 2KB of RAM, one is even less likely to want to
use so many stack pointers than in less restricted settings.  One
probably just wants to use a data and a return stack, that's all.

https://www.cnx-software.com/2022/10/22/10-cents-ch32v003-risc-v-mcu-offers-2kb-sram-16kb-flash-in-sop8-to-qfn20-packages/

I see no mention of RV32E here, but searching further, I see

https://wch-ic.com/downloads/CH32V003DS0_PDF.html

which says "RV32EC instruction set".

https://dl.acm.org/doi/10.1145/3578360.3580261 indicates some minor
speed differences, not always favorable.

The abstract says:

|Binaries compiled for better compression show changes in their
|execution time of at most ± 1.5 %. We analyze these against LLVM’s
|spilling metrics, and conclude that the effect is probably not
|systemic but a random fluctuation in the register allocation
|heuristic.

This sounds like what someone (Preston Briggs?) called IIRC
"NP-completeness noise" (or something along these lines).  The idea is
that optimal register allocation is an NP-complete problem, so we use
heuristics to get a good, but not necessarily optimal solution.  Some
of the decisions taken may lead to more suboptimality than others, and
that's what the creator of the term saw.

However, the performance effects may also be due to other effects that
have little to do with register allocation itself, such as the effects
of branch target alignment relative to instruction fetch granularity
units, and of instructions straddling the fetch granularity boundaries
or not.

In any case, this work more supports than contradicts my statement
"typically the same speed".

- 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 2023 proceedings: http://www.euroforth.org/ef23/papers/
EuroForth 2024 proceedings: http://www.euroforth.org/ef24/papers/

Date Sujet#  Auteur
25 Mar 25 * Locals revisited12albert
26 Mar 25 `* Re: Locals revisited11Paul Rubin
27 Mar 25  +* Re: Locals revisited2mhx
27 Mar 25  i`- Stacks (was: Locals revisited)1Anton Ertl
27 Mar 25  +* Re: Locals revisited4Anton Ertl
27 Mar 25  i+- Re: Locals revisited1albert
27 Mar 25  i`* Re: Locals revisited2Paul Rubin
28 Mar 25  i `- Re: Locals revisited1Anton Ertl
28 Mar 25  `* Re: Locals revisited4dxf
30 Mar 25   `* Re: Locals revisited3dxf
30 Mar 25    `* Re: Locals revisited2dxf
31 Mar 25     `- Re: Locals revisited1sjack

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal