Patent Number: 6,167,506

Title: Replacing displacement in control transfer instruction with encoding indicative of target address, including offset and target cache line location

Abstract: The processor is configured to predecode instruction bytes prior to their storage within an instruction cache. During the predecoding, relative branch instructions are detected. The displacement included within the relative branch instruction is added to the address corresponding to the relative branch instruction, thereby generating the target address. The processor replaces the displacement field of the relative branch instruction with an encoding of the target address, and stores the modified relative branch instruction in the instruction cache. The branch prediction mechanism may select the target address from the displacement field of the relative branch instruction instead of performing an addition to generate the target address. In one embodiment, relative branch instructions having eight bit and 32-bit displacement fields are included in the instruction set executed by the processor. Additionally, the processor employs predecode information (stored in the instruction cache with the corresponding instruction bytes) including a start bit and a control transfer bit corresponding to each instruction byte. The combination of the start bit indicating that the byte is the start of an instruction and the corresponding control transfer bit identifies the instruction as either a branch instruction or a non-branch instruction. For relative branch instructions including an eight bit displacement, the control transfer bit corresponding to the displacement field is used in conjunction with the displacement field to store the encoded target address. Thirty-two bit displacement fields store the entirety of the target address, and hence the encoded target address comprises the target address.

Inventors: Witt; David B. (Austin, TX)

Assignee: Advanced Micro Devices, Inc.

International Classification: G06F 9/32 (20060101); G06F 12/08 (20060101); G06F 9/30 (20060101); G06F 9/38 (20060101); G06F 009/312 ()

Expiration Date: 12/26/2017