Thread View: comp.arch
2 messages
2 total messages
Started by John Savard
Tue, 01 Dec 2026 07:05
Fitting in Short Instructions
Author: John Savard
Date: Tue, 01 Dec 2026 07:05
Date: Tue, 01 Dec 2026 07:05
29 lines
2282 bytes
2282 bytes
A short operate instruction needs at least 17 bits; seven bits for opcode, and five each for source and destination register. That's obviously a problem. So I've thought of various ways around it. Don't use all the registers. Limit the opcode space. Restrict which registers can be used together. But something has occurred to me: there is a useful property of the code which I could exploit. Instead of using ten bits for a full destination and source register specification, I might be able to get away with just using seven. The destination register gets a five-bit field for a full register specification. The source register, though, is indicated by a two-bit field with the following meanings: 00 - the destination register of the previous instruction 01 - the destination register of the instruction before that and so on. Since the result registers of integer instructions are irrelevant to floating-point instructions and vice-versa, one could have two separate stacks of register pointers. Or eight, handling operands of each length separately. Maintaining the stacks is extra overhead, but it allows instructions to be specified in a very compact way - and the stacks only contain register pointers, not values, so it's simpler than an actual stack architecture. John Savard
Re: Fitting in Short Instructions
Author: MitchAlsup
Date: Wed, 02 Dec 2026 00:45
Date: Wed, 02 Dec 2026 00:45
53 lines
3125 bytes
3125 bytes
quadibloc@invalid.com (John Savard) posted:
> A short operate instruction needs at least 17 bits; seven bits for
> opcode, and five each for source and destination register.
> That's obviously a problem.
One must moderate the conceptualization of a perceived issue with the
cost of not fixing it.
One an ICache is big enough, ICache waiting time is rather small--
{simply because its miss rate is so small}. We used this argument
all the time back in 1982 when developing the fist generation
RISCs. {{The argument is less valid on DataBase than on Scientific/
engineering workloads. The argument is irrelevant for office
applications as any computer (post 2000) is vastly more powerful
than needed}}
Big enough seems to be ~8KB (and larger--although sets help).
You have been trying to fit in small instructions for quite some
time. With performance doubling every few years, you have already
consumed one of those doublings.
Code footprint is only (really) an issue for the very low end MCUs.
Is that your market ?? and how does a "do everything for everybody"
architecture fit in the price structure of that market ??
> So I've thought of various ways around it. Don't use all the
> registers. Limit the opcode space. Restrict which registers can be
> used together.
> But something has occurred to me: there is a useful property of the
> code which I could exploit.
>
> Instead of using ten bits for a full destination and source register
> specification, I might be able to get away with just using seven.
> The destination register gets a five-bit field for a full register
> specification.
> The source register, though, is indicated by a two-bit field with the
> following meanings:
> 00 - the destination register of the previous instruction
> 01 - the destination register of the instruction before that
> and so on.
>
> Since the result registers of integer instructions are irrelevant to
> floating-point instructions and vice-versa, one could have two
> separate stacks of register pointers. Or eight, handling operands of
> each length separately.
> Maintaining the stacks is extra overhead, but it allows instructions
> to be specified in a very compact way - and the stacks only contain
> register pointers, not values, so it's simpler than an actual stack
> architecture.
>
> John Savard
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads