🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Paul Clayton Thu, 12 Nov 2026 03:19
Re: Really compressed instruction streams
#700
Author: Paul Clayton
Date: Thu, 12 Nov 2026 03:19
100 lines
5860 bytes
On 9/24/26 4:04 PM, Thomas Koenig wrote:
[snip]
> So, the idea of using actual compression seems interesting.
> This has been tried in the past, but it didn't catch on.
> 
> There are a few basic problems to be solved.  One that comes to
> mind immediately is branch addresses.  If the instruction stream
> is compressed, any bit of the compressed stream can start an
> instruction, and calculating the target of a branch instruction
> is not straightforward.  To avoid having to decode the whole
> program, it would be necessary to create blocks of some sort,
> which could be decoded on loading into a suitable cache level.
> 
> For example, one could make the Icache into a micro-op-store
> and decode on fetching from L2.
> 
> Branch targets could then be in the form block,instruction in
> block.  There would have to be an upper limit on the number
> of instructions per block, leading to some waste for easily
> compressible instructions.  Also, instructions which no
> longer fit in a block would reduce the efficieny.

The branch target only needs to decode to the start of the
instruction within a block (i.e., the instruction could be
contained in multiple blocks), so the only case in which an
instruction would not 'fit' would be a branch target whose
intrablock instruction number would be greater than the
maximum allowed. Easily compressible instructions might still
cause a target to have too large of instruction count
offset.

(Borrowing bits across block boundaries could be complex,
beyond the already significant complexity of such a compression
scheme.)

It might be possible to mark branch entry points or some
other coarser-grained block-internal "addresses" without losing
too much compression.

> 
> One would also have to look at PC-relative branches; these
> would probably become block-relative + instruction in block.
> 
> Writing binutils for this kind of architecture would be fun,
> in the sense of absoutely no fun at all.  Object code would
> probably be uncompressed, with the poor guy implementing the
> linker having to do all the dirty work.
> 
> The ISA to be compressed would not be limited by having to
> fit into a container determined by byte or word sizes.
> If one so desired, one could chose an ISA based on any
> bit size, although having instructions based on an n-bit
> package size (with multiples) would still make sense for
> further decoding of the micro-ops.
> 
> Other thoughts?

One issue would be what the instruction cache format should be.
The branch target specification might urge for decompressing
branch targets into a BTB-like structure, which could complicate
replacement in the instruction cache.

Variable size expansion introduces problems that trace caches 
and µop caches have to deal with. (Function calls and "always"
— within cache lifetime — taken branches have a similar internal
fragmentation issue.)

One might also want to design the compression system to support
an L2 cache format as well as an L1 and L3/memory format.
Besides L3 typically being capacity-oriented (such that
decompression latency might be less significant), it can also be
convenient to avoid a compression step before eviction from the
last level cache.

This might urge for inclusive caching (to avoid recompression on
eviction) which partially defeats the benefit of compression.
This seems to imply that recompression should not be too 
difficult. Extra metadata to speed recompression would not be as
latency (or access energy) sensitive as L1 cache storage,
facilitating placement that does not impact L1 accesses and a
moderate amount of extra buffering to handle recompression
latency might not be wasteful of storage compared to inclusive
caching.

Having an intermediate (compressed) format might also facilitate
changing the "machine code" (Icache) format using fusion,
cracking, and other transformations (similar to trace and µop
cache optimizations). Such would complicate single stepping
(which must respect the architectural definition of
instructions) and some exception handling.

Since some of the information redundancy can come from register
destinations being register sources nearby, the instruction
cache format might make register renaming easier.

Intending to have different levels/forms of instruction caching
seems appealing to me. Loop buffers (and µop caches) and
scheduler entry reuse for loops do not seem to require (or
benefit?) from architectural design, but there may be some
advantage to more co-design between these layers.
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