Sujet : Re: Locals revisited
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.lang.forthDate : 27. Mar 2025, 08:48:35
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2025Mar27.084835@mips.complang.tuwien.ac.at>
References : 1 2
User-Agent : xrn 10.11
Paul Rubin <
no.email@nospam.invalid> writes:
albert@spenarnc.xs4all.nl writes:
(I get 30 registers in RISCV that can serve as a stack pointer.)
All 31 can serve as a stack pointer, but not all at the same time.
You want at least two registers for temporary values, for implementing
a word such as "+". And you typically want to keep the top-of-stack
of many stacks in a register, too. Or several stack items.
In some models of the RISCV, only 14, I think.
There is the E subspecification of the RISC-V specification with 16
registers. I don't know if anybody has implemented this.
And in almost all
models, 8 of them are more efficient to address than the rest, because
of the compressed instruction format.
More efficient in code size. In instruction execution, typically the
same speed.
- anton
-- M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.htmlcomp.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/