摘要 |
Instruction codes for a computer program are divided into blocks, which may correspond to cache lines. The blocks are compressed and the compression ratio is compared with a target ratio. If the ratio does not match the target, the blocks are rearranged and the process repeated. The process of rearranging may include inserting new instruction codes such as no-operation instruction codes. Target addresses in the instruction codes, such as those in branches, jumps and calls, may be adjusted to compensate for the added instructions. "Don't care" bits may be added to the blocks. The number of instructions in a block may be a power of 2 and the compression ratio may be an inverse power of 2. The instructions may be compressed using Huffman or arithmetic encoding. Reference bits giving the states of the instructions may be added to the compressed blocks. |