Article View: comp.arch
Article #740Re: Large constants in RISC
From: John Savard
Date: Sun, 15 Nov 2026 01:51
Date: Sun, 15 Nov 2026 01:51
42 lines
3036 bytes
3036 bytes
On Sat, 14 Nov 2026 15:02:12 -0000 (UTC), antispam@fricas.org (Waldek Hebisch) wrote: >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. Yes, that's true enough. While I had trouble understanding your initial post, when I thought about the basic idea, I saw that it was indeed reasonable. I suppose if I did something like it in Concertina, it would have looked like this: 111 followed by 29 bits would shift floating register 31 by 32 bits to the right, putting 000 followed by those 29 bits at the beginning. One such instruction would put most of a 32-bit constant in the first 32 bits of that register, two most of a 64-bit constant in the first 64 bits, and four most of a 128-bit constant in the whole register. Then an instruction with an "immediate" value would only need to use 3, 6, or 12 bits of the value within the 32-bit instruction itself, so it could fit in 32 bits. A fancy implementation could process the entire 64, 96, or 160-bit sequence of instructions as a single instruction with a normal immediate, just also reproducing the side effect of affecting floating register 31. Given that, I guess one could say it's a solution to the problem - it avoids the need to change instruction lengths, it works in a simple implementation that processes instructions strictly 32 bits at a time. And it's not as if I hadn't tried something similar recently, but for a different purpose. I took integer register 8, and filled it with bits, but their purpose was not to serve as immediate values, but just to lengthen instructions by a few bits - packaging the extra bits for several instructions neatly into a 32-bit instruction preceding them. John Savard
Technical Details
Message-ID:
<6af90e3d.17589609@news.eternal-september.org>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-mailReferences:
<11d76uq$11cdc$1@paganini.bofh.team> <6af7b869.3087000@news.eternal-september.org> <11d9t5i$1b9c1$1@paganini.bofh.team>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: quadibloc@invalid.com (John Savard) Newsgroups: comp.arch Subject: Re: Large constants in RISC Date: Sun, 15 Nov 2026 01:51:51 GMT Organization: A noiseless patient Spider Lines: 42 Message-ID: <6af90e3d.17589609@news.eternal-september.org> References: <11d76uq$11cdc$1@paganini.bofh.team> <6af7b869.3087000@news.eternal-september.org> <11d9t5i$1b9c1$1@paganini.bofh.team> Injection-Date: Sun, 15 Nov 2026 01:51:53 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2555129"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19wOuBpz9MeecVOnjIViT1Xa29X0wUTg6U="; posting-host="ddc300d73b1664759c730a6e52f692cf" Cancel-Lock: sha1:+3+q0gMAJeT8/5YCj7eAe2tFibs= sha256:g2cd0vPoBqz9Yx+EnZ+bvyIvFNBYaU0M8iaieyz46vQ= sha1:kX9g90+WewER7iBmzvpsep5hzRQ= sha256:TW2oStsktKyx5yKVUg+5vS99+ZU6roPBhWjJWAF1dIs= X-Newsreader: Forte Free Agent 1.1/32.230