Patent ID: 7581082

Claim:
A method of code compression of an instruction stream of normal length instructions comprising the steps of: generating code including selecting normal length instructions and scheduling groups of normal length instructions that can be executed simultaneously in parallel into execute packets; forming said scheduled instructions into a plurality of fixed length fetch packets, plural instructions of each fetch packet to be fetched as a group, each fetch packet having a predetermined number of a plurality of instruction slots, each instruction slot capable of holding one normal length instruction, each instruction in each fetch packet including an indication of said corresponding execute packet; after said generating code step and said forming step, for each window of a plurality of instructions of at least two fetch packets of the instruction stream: determining which normal length instructions correspond to a half-length instruction in operation, forming said window of a plurality of instructions into sets of candidate fetch packets with each instruction slot of each candidate fetch packet including a selected one of a single normal length instruction or a pair of half-length instructions, said candidate fetch packets formed by replacing a pair of normal length instructions having corresponding half-length instructions with said corresponding half-length instructions and rearranging instructions between original fetch packets so that pairs of half-length instructions are within an instruction slot of a candidate fetch packet without rearranging instructions between execute packets, ranking each set of candidate fetch packets in order of most code compression, and coding new fetch packets corresponding to said set of candidate fetch packets having the most code compression; and resetting instruction pointers to correspond to fetch packet boundaries of said new fetch packets.