🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #705

Re: CISC are not "unreduced"

#705
From: Anton Ertl
Date: Fri, 13 Nov 2026 18:26
123 lines
7346 bytes
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>Anton Ertl [2026-11-12 06:21:21] wrote:
>> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>>Yeah, if we take CISC as motivated by the desire to provide an assembly
>>>language that is comfortable for humans, we can also take RISC as
>>>motivated by the desire to provide an assembly language that's
>>>convenient for compilers (which would rather not need to worry about
>>>tradeoffs between using LD+ADD+ST vs using some fancy addressing mode
>>>on ADD).
>> The fancy addressing mode is the same whether you use it with a LD, a
>> ST, or an ADD.
>
>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.

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.

>> Compilers actually have no problem using that addressing mode,
>> especially in an architecture like VAX: When the variable resides in a
>> register, use a register, when it's in memory, use the appropriate
>> addressing mode.
>
>What if explicit loads and stores are faster/slower?

If using the hardware as a load/store architecture is preferable, then
the compiler will just generate that code, and it will be just as hard
or simple as on a RISC.

If the load-op and RMW instructions are preferable, the compiler can
just use them when the operand is in memory.

>And how is the answer affected by subsequent operations accessing the
>same memory location?

Just the same as on a RISC: You run register allocation before
instruction selection, so if a value is accessed several times and
registers are available, the value will be allocated into a register,
on both architecture styles.  Then the instruction selection sees that
there is a register access for src1 of an add, and on either style of
architecture will just access it in a register, making the RISC case
much easier.

>> (optimality is more difficult, but for trees has been
>> reached with tree-parsing, as used in burg or iburg).
>
>And this is useful for CISC but much less so for RISC, so you can use
>a simpler compiler for RISC instruction sets.

It's also useful for RISCs, because it has instructions that combine a
constant with an operation, and instructions that add a constant and a
register, and then use the resulting address in a load (or store); not
to mention addressing modes of, e.g., the 88K architecture.  And
auto-increment/decrement addressing modes, such as available on ARM
A32 and A64, and HPPA, do not fit the tree parsing paradigm.

I taught the students to use iburg/burg when the compiler course was
run on an Alpha, and I am telling them to do that now, when the
compiler course runs on an AMD64 machine.  The usage of these tools
depends far more on the student than on the architecture.

>> AES instructions are not particularly convenient for CPU implementors,
>> probably on the contrary, because they need hardware that is not
>> useful for anything else.
>
>AFAIK, AES was designed specifically to give access to that extra
>hardware.  More specifically, manufacturers were eager to add more FPUs
>and the question they faced was how to make that hardware available to
>the programmer.
>IOW it's "more hardware" that caused AES rather than the other way around.

I read about CPU designers having to cut down their designs when the
realization comes closer (silicon diet).  So it's not that they had
silicon to spend on useless things.  I think they wanted to offer AES
because they expected people to actually use it (and I think they were
right).

And one other benefit of these instructions is that they avoid the
cache side channels that implementations based on other instructions
are likely to have.

>And AFAICT, AES is a fairly naive/simple way (for the CPU implementor)
>to give access to that hardware.

One you have decided to implement AES in hardware, the question is,
how.  The VAX way (as shown in POLY) is to have one instruction that
takes the key (maybe the preprocessed key) and does it all.  Intel
chose to have an instruction that performs a round, and use 9
instances of this instruction plus a separate one for the last round.
That looks like a rather RISCy approach to me, but of course it still
has the CISC property of having a memory operand.  It also has an
instruction for preprocessing the key, and I think you need to use
that multple times.

>> vVM is a microarchitectural mechanism,
>
>Is it?  I use it as a way to refer to the design of VEC+LOOP (which is
>so designed as to allow a particular micro-architecture).

Architecturally, LOOP is a branch (maybe it also deals with the loop
counter?), and VEC is a noop AFAIK.

- anton
-- 
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
  Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>
Technical Details
Message-ID: <2026Nov13.192642@mips.complang.tuwien.ac.at>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11cpqih$acf5$1@dont-email.me> <11cr2g5$q796$2@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>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: CISC are not "unreduced"
Date: Fri, 13 Nov 2026 18:26:42 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 123
Message-ID: <2026Nov13.192642@mips.complang.tuwien.ac.at>
References: <11cpqih$acf5$1@dont-email.me> <11cr2g5$q796$2@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>
Injection-Date: Fri, 13 Nov 2026 19:23:28 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1436312"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX182WjH1Jpwj8ML7yJrYV9Zm"; posting-host="a4b6f5891e16eec05578d4726effa55e"
Cancel-Lock: sha1:/90zpM1AmXHKArA2I6nePHrp2HU= sha256:Q1ySpO6xXOt6HPzRFXzFAYuy3GS8apXScnFeLtDsX+0=
	sha1:LxgQDjH6PFLqUVCC49pz33/0rgk= sha256:A+nCD9EYFN5j6NnGWNvcJIWz4xae25nEGd2L6r9/tWk=
X-newsreader: xrn 10.11