By: Anon (no.delete@this.spam.com), June 5, 2022 3:09 pm
Room: Moderated Discussions
anonymou5 (no.delete@this.spam.com) on June 5, 2022 12:32 pm wrote:
> In practice, instructions tend to follow the classic distribution.
>
> About half of them are comprised of the popular basics: add, shift,
> branch, load, store, etc. Plus one or two outliers, often vector or
> cisc, due to some popular algorithm. You will see 2-4 dozen total,
> adding up to that first half.
>
> The second half is then comprised of everything else: one long tail
> of tiny bits and pieces, simply adding up. Got two thousand total?
> You will see hundreds of them over time.
>
> So yes, Huffman will help for the super popular ones, but overall it
> really won't: the numbers simply are against you.
Encoding is not only about opcodes, there are register fields as well, in classic RISC register fields take 15 bits, and the same register usually is used several times, the simple solution is to encode most popular opcodes and and top register in 16 bits instead of 32, but that's not the only option, and this option also ignore that some instructions follows others way more often than others, so it is also possible to improve density by encoding sequences of instructions.
> In practice, instructions tend to follow the classic distribution.
>
> About half of them are comprised of the popular basics: add, shift,
> branch, load, store, etc. Plus one or two outliers, often vector or
> cisc, due to some popular algorithm. You will see 2-4 dozen total,
> adding up to that first half.
>
> The second half is then comprised of everything else: one long tail
> of tiny bits and pieces, simply adding up. Got two thousand total?
> You will see hundreds of them over time.
>
> So yes, Huffman will help for the super popular ones, but overall it
> really won't: the numbers simply are against you.
Encoding is not only about opcodes, there are register fields as well, in classic RISC register fields take 15 bits, and the same register usually is used several times, the simple solution is to encode most popular opcodes and and top register in 16 bits instead of 32, but that's not the only option, and this option also ignore that some instructions follows others way more often than others, so it is also possible to improve density by encoding sequences of instructions.