Article View: comp.arch
Article #1004Re: CISC are not "unreduced"
From: MitchAlsup
Date: Tue, 01 Dec 2026 18:54
Date: Tue, 01 Dec 2026 18:54
97 lines
5580 bytes
5580 bytes
antispam@fricas.org (Waldek Hebisch) posted:
> Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
> > Stefan Monnier <monnier@iro.umontreal.ca> writes:
--------------
> >>That's beside the point. With a load/store architecture you don't need
> >>to choose between using the ADD-with-addressing mode or using explicit
> >>loads and stores. Makes life simpler for the compiler.
> >
> > No. With an architecture like the VAX, RISC is actually harder:
> >
> > VAX: If operand src1 is in memory, accessed with d(SP), use the ADD
> > instruction with d(SP) as second operand. Likewise for src2 and dst.
> >
> > RISC: If operand src2 is in memory, allocate a register for it (but
> > why is it in memory? Probably because there are no registers
> > available, so first spill some other value); then load the operand
> > from d(SP) into the register; possibly do the same for the other
> > source operand (but don't spill the register for src2). If the
> > destination is in memory, allocate a register for storing it in the
> > meantime (again with the potential for spilling). Finally do the add.
> > Store the result if necessary. And now refill all the spilled values.
> >
> > It's all doable, but simpler? No.
>
> Partially playing devil's advocate: if you reserve registers for
> arguments and for handlinig addressing modes, then all one has
> to do is generating code for loads. But some loads seem to be
> neccessary even for VAX, so you need function which generates
> loads in the compiler anyway.
> For RISC, you generate much more
> loads than for VAX, but decision when to generate a load is
> quite simple.
The data does not substantiate that statement. CISC machines operated
with an inbound memory reference about 50% of instructions. RISC
machines trimmed this down to 20%.
A variable is used (typically) 1.2 times after it gets loaded.
A CISC will simply use the D$ and produce 2 address modes,
whereas RISC will LD the location and use it 1.2 times.
> I estimate that for typical instructions one
> needs to reserve between 3 and 8 registers, that is 2 for
> arguments, one for result and additional registers to handle
> addressing modes.
Registers 00..08 are for arguments {R0 is return address}
Registers 09..15 are temporary {unused arguments are also temp}
Registers 16..31 are preserved. R30 is FP, R31 is SP
> IIUC Risc-V and ARM need at least one
> register to generate large constants which may be needed for
> addressing.
That is a typical RISC problem--but not for my ISA
> Now, with 4 registers reserved on 32 bit ARM
> there remain 11 general purpose registers (plus PC), that is
> significantly less than 15 general purpose registers on VAX.
Don't forget the free access to memory via address modes.
> But Risc-V and 64 bit ARM even after reserving a few still
> have more usable general purpose registers than VAX.
But less than me !!
> Of course, that assumes out of order RISC. For superscalar
> in-order RISC one needs to schedule instructions and that
> significantly complicates register allocation.
>
> > For the more common CISC style with load-and-op and read-modify-write,
> > things are harder than on the VAX, but RISC still is not simpler.
>
> In simple (almost naive) compiler main issue is how much you
> care about possibly redundant temporary registers. Due to
Does redundant mean the same value is in more than one register ??
> software conventions, it seems that one actually does not
> need to care much. That is, there is limited supply of
> registers usable for local variables. More precisely,
> to avoid excessive spill code around calls variables that
> need to persists after function call need to be allocated
> in call-preserved registers, and those are relatively small
> fraction of all registers.'
Where "small fraction" = a full 50% of them.
> And in a simple compiler it
> is reasonable to assume that all variables that are allocated
> to registers should survive after function call (otherwise
> compiler need to do some real work like livenes ananlysis,
> rage splitting etc.). So there are plenty of registers that
> are usable only for temporaries.
>
Technical Details
Message-ID:
<1796151298-5857@newsgrouper.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!newsgrouper.org!.POSTED!not-for-mailReferences:
<11cpqih$acf5$1@dont-email.me> <2026Nov9.071302@mips.complang.tuwien.ac.at> <11cru1e$11qpi$1@dont-email.me> <2026Nov9.091404@mips.complang.tuwien.ac.at> <11cti0c$1lilf$4@dont-email.me> <11cuoa4$21279$1@dont-email.me> <jwvcxscsjsa.fsf-monnier+comp.arch@gnu.org> <1794357499-5857@newsgrouper.org> <jwvik23o10u.fsf-monnier+comp.arch@gnu.org> <2026Nov12.072121@mips.complang.tuwien.ac.at> <jwvy0axmx8f.fsf-monnier+comp.arch@gnu.org> <2026Nov13.192642@mips.complang.tuwien.ac.at> <11ekc0r$2dni3$1@paganini.bofh.team>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!newsgrouper.org!.POSTED!not-for-mail From: MitchAlsup <user5857@newsgrouper.org.invalid> Newsgroups: comp.arch Subject: Re: CISC are not "unreduced" References: <11cpqih$acf5$1@dont-email.me> <2026Nov9.071302@mips.complang.tuwien.ac.at> <11cru1e$11qpi$1@dont-email.me> <2026Nov9.091404@mips.complang.tuwien.ac.at> <11cti0c$1lilf$4@dont-email.me> <11cuoa4$21279$1@dont-email.me> <jwvcxscsjsa.fsf-monnier+comp.arch@gnu.org> <1794357499-5857@newsgrouper.org> <jwvik23o10u.fsf-monnier+comp.arch@gnu.org> <2026Nov12.072121@mips.complang.tuwien.ac.at> <jwvy0axmx8f.fsf-monnier+comp.arch@gnu.org> <2026Nov13.192642@mips.complang.tuwien.ac.at> <11ekc0r$2dni3$1@paganini.bofh.team> Date: Tue, 01 Dec 2026 18:54:58 GMT Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID: <1796151298-5857@newsgrouper.org> Injection-Info: newsgrouper.org; mail-complaints-to="newsgrouper@yahoo.com"; posting-account=user5857 Injection-Date: Tue, 01 Dec 2026 18:54:58 GMT User-Agent: Newsgrouper/0.9.0