• Re: Really compressed instruction streams

    From Robert Finch@robfi680@gmail.com to comp.arch on Sat Nov 14 21:17:37 2026
    From Newsgroup: comp.arch

    On 2026-09-24 4:04 p.m., Thomas Koenig wrote:
    It seems that the different CISC and compressed instruction sets
    are ad-hoc (and not very good) attempts at compression of the
    actual instructions that machines execute. Pure RISCS have very
    little compression, RISC-V has some, CISC has some more. AMD's
    micro-op cache goes some way towards this when it splits
    x86_64 instructions into micro-ops.

    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.

    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 thing I experimented with is using a write-able instruction set.
    There were 16-bit opcodes dedicated to storing the 1024 most frequently
    used instructions. The buffer for the instruction could be loaded with instructions then when the processor sees one of the 16-bit instructions
    it loads the instruction (which may be quite a bit larger) from the
    buffer. IDK if it had any better compression than something like RISCV-C
    or ARM thumb.

    Branches were not allowed to be stored that way.


    --- Synchronet 3.22a-Linux NewsLink 1.2