Article View: comp.arch
Article #718Re: Large constants in RISC
From: Waldek Hebisch
Date: Sat, 14 Nov 2026 15:02
Date: Sat, 14 Nov 2026 15:02
41 lines
3052 bytes
3052 bytes
John Savard <quadibloc@invalid.com> wrote:
> I am entirely puzzled by your post, although I was wrestling with this
> issue myself.
> If the problem is that, since every instruction is 32 bits long,
> immediate values in instructions can't be 32 or 64 bits long, how does
> adding a register solve the problem?
> However, if the bit that says that register is 'live' also changes the
> *instruction set*, so that now a large portion of the opcode space is
> devoted to 32 bit instructions that are mostly data with only a few
> bits for the opcode, which is what it looked like you're suggesting...
> then it *addresses* the issue, even if I wouldn't say that it solves
> the problem.
The point is that you get multinstruction sequences which behave
very much like single longer instruction containing a constant.
So you can write programs like for machine with variable length
instruction set. But each element of such sequence is a valid
instruction, so instruction decoders can work fully in parallel.
For best efficiency you want instruction fusing, but this is
optional performace enhancing feature. On one end you can
execute parts as separate instructions, paying extra latency
during execution. You can partially fuse (say fuse pairs),
limiting (or eliminating for moderately sized constants)
execution latency, but complicating decoders. Or you can
fully fuse.
Note that with fixed length 32 bit instructions, whatever you
do there will be 32 bit constants that do not fit into single
instruction. In practice such constants need to be handled
either by providing extra data for instruction, say by using
variable length instructions (so rejection fixed length
principle) or by some more funky schemes like out of band data
(which again means that instructions really are not fixed
lenght), or by using multi instruction sequences. My choice
is to use multi instruction sequences. Compared to other
such schemes it has advantage of convenience for programmers:
the sequence is equivalent to a longer instruction, so various
irregularities in instruction selection are gone.
--
Waldek Hebisch
Technical Details
Message-ID:
<11d9t5i$1b9c1$1@paganini.bofh.team>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!paganini.bofh.team!not-for-mailReferences:
<11d76uq$11cdc$1@paganini.bofh.team> <6af7b869.3087000@news.eternal-september.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!paganini.bofh.team!not-for-mail
From: antispam@fricas.org (Waldek Hebisch)
Newsgroups: comp.arch
Subject: Re: Large constants in RISC
Date: Sat, 14 Nov 2026 15:02:12 -0000 (UTC)
Organization: bofh.team Usenet service
Message-ID: <11d9t5i$1b9c1$1@paganini.bofh.team>
References: <11d76uq$11cdc$1@paganini.bofh.team> <6af7b869.3087000@news.eternal-september.org>
Injection-Date: Sat, 14 Nov 2026 15:02:12 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="1418625"; mail-complaints-to="usenet@bofh.team"; posting-host="d028f9ad2fa2c51f22dbfed0d81d7daf"; posting-account="69e66f1681224ab92235b464ce7a90b6"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-9-amd64 (x86_64))
X-Postfilter: Postfilter-NG 2026.10.2