🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #713

Re: CISC are not "unreduced"

#713
From: Anton Ertl
Date: Sat, 14 Nov 2026 09:12
40 lines
3489 bytes
anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
>Actually, normally register allocation is performed after instruction
>selection.  So if the operand is a local variable that can be in a
>register (no address taken), it will be assumed to be in a register,
>for instruction selection.  Later the register allocator actually
>tries to allocate a register for the variable, and if not, on a RISC
>spill code is inserted with additional live ranges, and the register
>allocator has to run again (at least that's the way that Chaitin and
>Briggs described this).  On a VAX, you just use a memory operand for
>those variables that do not fit into registers.

The latter is oversimplified, too.

E.g., if you have a statement

c[i] = a[i] + b[i];

If a, b, c, and i are all in (pseudo-)registers, this can be one
instruction on the VAX, and any somewhat sophisticated instruction
selector will select it, whether optimal or not.  But if it turns out
that the pseudo-register for a does not fit in a real register, and
has to be spilled to d(SP), the whole thing does not fit in an
instruction*, and, e.g., there has to be a load of a into a register
first, leading to all the same problems that RISCs already have for
c=a+b.  There is a reason why bugs tend to hide in register
allocation; I remember reading that one register allocator needed to
process 10 million lines of code until all bugs had been found (and
10M lines was a lot at the time).

* I have not examined the VAX instruction set to see if it has an
  addressing mode that covers this case.  If it has, then this
  particular example does not show the problem, but given that VAX
  instructions are finite, one can construct an example where an
  in-register value fits in the instruction, while the in-memory value
  does not.

- anton
-- 
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
  Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>
Technical Details
Message-ID: <2026Nov14.101255@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> <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> <2026Nov13.225125@mips.complang.tuwien.ac.at>

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: Sat, 14 Nov 2026 09:12:55 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 40
Message-ID: <2026Nov14.101255@mips.complang.tuwien.ac.at>
References: <11cpqih$acf5$1@dont-email.me> <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> <2026Nov13.225125@mips.complang.tuwien.ac.at>
Injection-Date: Sat, 14 Nov 2026 09:32:06 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1908528"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19RSmnNYjvajaDuakK2rPTr"; posting-host="1f8070772fba74d92d9e990a0b816aef"
Cancel-Lock: sha1:UslcqnplGsihd7iJcqLePSuuTbs= sha256:Gi0RFoEBJ6K6Ezn9R+2natq/miqDuR7OIWEC6WoMOUg=
	sha1:Uz+2KNnp0NL+OuJ5gkF82ciax10= sha256:Vvd+P5hqjj11uAvWd6d76/3tgkVN2TErRe5BIPCCxyM=
X-newsreader: xrn 10.11