US20010002483A1 - System for configuring to reduce variance in the length of variable length instructions by compressing multiple prefix bytes into single compressed prefix byte - Google Patents
System for configuring to reduce variance in the length of variable length instructions by compressing multiple prefix bytes into single compressed prefix byte Download PDFInfo
- Publication number
- US20010002483A1 US20010002483A1 US09/158,440 US15844098A US2001002483A1 US 20010002483 A1 US20010002483 A1 US 20010002483A1 US 15844098 A US15844098 A US 15844098A US 2001002483 A1 US2001002483 A1 US 2001002483A1
- Authority
- US
- United States
- Prior art keywords
- instruction
- prefix
- instructions
- bytes
- byte
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 claims abstract description 25
- 230000004044 response Effects 0.000 claims abstract description 4
- 230000006835 compression Effects 0.000 claims description 3
- 238000007906 compression Methods 0.000 claims description 3
- 239000000872 buffer Substances 0.000 description 34
- 238000006073 displacement reaction Methods 0.000 description 14
- 238000010586 diagram Methods 0.000 description 12
- 230000007246 mechanism Effects 0.000 description 6
- 238000013519 translation Methods 0.000 description 6
- 238000003491 array Methods 0.000 description 4
- 230000008859 change Effects 0.000 description 4
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 4
- 238000012986 modification Methods 0.000 description 4
- 230000004048 modification Effects 0.000 description 4
- 230000002093 peripheral effect Effects 0.000 description 3
- 239000008186 active pharmaceutical agent Substances 0.000 description 2
- 230000008901 benefit Effects 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 239000003999 initiator Substances 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline or look ahead
- G06F9/3818—Decoding for concurrent execution
- G06F9/382—Pipelined decoding, e.g. using predecoding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30145—Instruction analysis, e.g. decoding, instruction word fields
- G06F9/3016—Decoding the operand specifier, e.g. specifier format
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30145—Instruction analysis, e.g. decoding, instruction word fields
- G06F9/3016—Decoding the operand specifier, e.g. specifier format
- G06F9/30167—Decoding the operand specifier, e.g. specifier format of immediate specifier, e.g. constants
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/3017—Runtime instruction translation, e.g. macros
- G06F9/30178—Runtime instruction translation, e.g. macros of compressed or encrypted instructions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30181—Instruction operation extension or modification
- G06F9/30185—Instruction operation extension or modification according to one or more bits in the instruction, e.g. prefix, sub-opcode
Definitions
- This invention relates to microprocessors and, more particularly, to decoding variable length instructions within a microprocessor.
- the x86 instruction set is relatively complex and is characterized by a plurality of variable-length instructions.
- a generic format illustrative of the x86 instruction set is shown in FIG. 1.
- an x86 instruction consists of from one to five optional prefix bytes 102 , followed by an operation code (opcode) field 104 , an optional addressing mode (Mod R/M) byte 106 , an optional scale-index-base (SIB) byte 108 , an optional displacement field 110 , and an optional immediate data field 112 .
- the opcode field 104 defines the basic operation for a particular instruction.
- the default operation of a particular opcode may be modified by one or more prefix bytes 102 .
- prefix bytes 102 may be used to change the address or operand size for an instruction, to override the default segment used in memory addressing, or to instruct the processor to repeat a string operation a number of times.
- the opcode field 104 follows prefix bytes 102 , if present, and may be one or two bytes in length.
- the addressing mode (Mod RIM) byte 106 specifies the registers used as well as memory addressing modes.
- the scale-index-base (SIB) byte 108 is used only in 32-bit base-relative addressing using scale and index factors.
- a base field within SIB byte 108 specifies which register contains the base value for the address calculation, and an index field within SIB byte 108 specifies which register contains the index value.
- a scale field within SIB byte 108 specifies the power of two by which the index value will be multiplied before being added, along with any displacement, to the base value.
- the next instruction field is a displacement field 110 , which is optional and may be from one to four bytes in length. Displacement field 110 contains a constant used in address calculations.
- the optional immediate field 112 which may also be from one to four bytes in length, contains a constant used as an instruction operand.
- the shortest x86 instructions are only one byte long, and comprise a single opcode byte.
- the 80286 sets a maximum length for an instruction at 10 bytes, while the 80386 and 80486 both allow instruction lengths of up to 15 bytes.
- Decoding instructions typically involves determining the boundaries of an instruction and then identifying each field within the instruction, e.g., the opcode and operand fields. Decoding typically takes place once the instruction is fetched from the instruction cache before execution.
- One method for determining the boundaries of instructions involves generating a number of predecode bits for each instruction byte read from main memory.
- the predecode bits provide information about the instruction byte they are associated with. For example, an asserted predecode start bit indicates that the associated instruction byte is the first byte of an instruction. Similarly, an asserted predecode end bit indicates that the associated instruction byte is the last byte of an instruction.
- the predecode bits for a particular instruction byte are calculated, they are stored together with the instruction byte in an instruction cache. When a “fetch” is performed, i.e., a number of instruction bytes are read from the instruction cache, the associated start and end bits are also read.
- the start and end bits may then be used to generate valid masks for the individual instructions with the fetch.
- a valid mask is a series of bits in which each bit corresponds to a particular instruction byte. Valid mask bits associated with the first byte of an instruction, the last byte of the instruction, and all bytes in between the first and last bytes of the instruction are asserted. All other valid mask bits are not asserted.
- FIG. 2 an exemplary valid mask is shown. The figure illustrates a portion of a fetch 120 and its associated start and end bits 122 and 124 . Assuming a valid mask 126 for instruction B 128 is to be generated, start and end bits 122 and 124 would be used to generate the mask. Valid mask 126 could then be used to mask off all bytes within fetch 120 that are not part of instruction B 128 .
- the fields within the instruction e.g., the opcode and operand fields
- the variable length of x86 instructions complicates the identification process.
- the optional prefix bytes within an x86 instruction create further complications. For example, in some instructions the opcode will begin with the first byte of the instruction, while others may begin with the second, third, or fourth byte.
- decoding may require a number of clock cycles and may create a significant delay before any instructions are available to the functional stages of the microprocessor's pipeline.
- instruction decoding may become a performance limiting factor. Therefore, a mechanism for simplifying the complexity and time required for instruction decoding is needed.
- a microprocessor configured to compress prefix bytes may comprise a predecode unit and an instruction cache.
- the predecode unit may be configured to receive variable length instructions from a memory subsystem. A subset of the instructions may have no prefix bytes, while others may have one or more prefix bytes.
- the predecode unit is configured to detect the prefix bytes associated with each instruction and compress them into a single compressed prefix byte.
- the predecode unit may also perform other decoding functions and or instruction padding.
- the instruction cache is coupled to the predecode unit and is configured to receive and store the partially decoded instructions and their associated compressed prefix bytes.
- the instruction cache is configured to output the instructions and their compressed prefix bytes in response to receiving corresponding fetch addresses.
- a computer system employing one or more microprocessors as described above in conjunction with other peripheral devices e.g., a communications modem
- a method for executing variable length instructions comprises reading a plurality of instruction bytes from a memory subsystem, and then predecoding the instruction bytes. Predecoding involves detecting starting, ending, and prefix bytes for each instruction. The prefix bytes are compressed into a single compressed prefix byte; and then stored with the instructions in an instruction cache. In one embodiment, the prefix bytes are compressed by encoding operand size prefix bytes address size prefix bytes into a single operand size bit, address size prefix bytes into a single address size bit, and segment override prefix bytes into a three-bit field, all within the single compressed prefix byte.
- a software program embodied on computer-readable media is also contemplated.
- the program is an optimizing compiler comprising three groups of instructions.
- the first group of instructions is configured to detect the boundaries of variable-length instructions.
- the second group of instructions is configured to detect prefix bytes associated with each variable-length instruction.
- the third group of instructions is configured to compress the prefix bytes into single compressed prefix bytes.
- the software program may be a dynamically linked library configured to receive said variable-length instructions as input and generate optimized instructions and compressed prefix bytes as output.
- FIG. 1 is a block diagram of a generic x86 instruction format.
- FIG. 2 is a block diagram illustrating one embodiment of a valid mask.
- FIG. 3 is a block diagram of one embodiment of a microprocessor.
- FIG. 4 is table illustrating one embodiment of a method for decoding variable-length instructions into fixed-length instructions.
- FIG. 5 is a table illustrating another embodiment of a method for decoding variable-length instructions into fixed-length instructions.
- FIG. 6A is a diagram illustrating one embodiment of a method for compressing prefix bytes.
- FIG. 6B is a diagram illustrating another method for compressing prefix bytes.
- FIG. 7 is a diagram illustrating one possible embodiment of the instruction cache from FIG. 3.
- FIG. 8 is a diagram illustrating another embodiment of the instruction cache from the microprocessor depicted in FIG. 3.
- FIG. 9 is a diagram illustrating another method for decoding variable-length instructions into fixed-length instructions.
- FIG. 10 is a diagram illustrating another embodiment of the instruction cache from the microprocessor depicted in FIG. 3.
- FIG. 11 is a diagram showing one embodiment of a computer system utilizing the microprocessor of FIG. 3.
- Microprocessor 10 includes a prefetch/predecode unit 12 , a branch prediction unit 14 , an instruction cache 16 , an instruction alignment unit 18 , a plurality of decode units 20 A- 20 C, a plurality of reservation stations 22 A- 22 C, a plurality of functional units 24 A- 24 C, a load/store unit 26 , a data cache 28 , a register file 30 , a reorder buffer 32 , and MROM unit 34 .
- Elements referred to herein with a particular reference number followed by a letter may be collectively referred to by the reference number alone.
- reservation stations 22 A- 22 C may be collectively referred to as reservation stations 22 .
- Prefetch/predecode unit 12 is coupled to receive instructions from a main memory subsystem (not shown), and is further coupled to instruction cache 16 and branch prediction unit 14 .
- branch prediction unit 14 is coupled to instruction cache 16 .
- branch prediction unit 14 is coupled to instruction alignment unit 18 and functional units 24 .
- Instruction cache 16 is further coupled to MROM unit 34 and instruction alignment unit 18 .
- Instruction alignment unit 18 is in turn coupled to load/store unit 26 and to respective decode units 20 A- 20 C.
- Respective decode units 20 A- 20 C are coupled to reservation stations 22 A- 22 C, which are further coupled to respective functional units 24 A- 24 C.
- instruction alignment unit 18 and reservation stations 22 are coupled to register file 30 and reorder buffer 32 .
- Functional units 24 are coupled to load/store unit 26 , register file 30 , and reorder buffer 32 as well.
- Data cache 28 is coupled to load/store unit 26 and to the main memory subsystem.
- MROM unit 34 is coupled to instruction alignment unit 18 .
- Instructions are prefetched from main memory by prefetch/predecode unit 12 .
- Prefetch/predecode unit 12 predecodes the variable-length instructions. This may entail generating predecode bits and or padding instructions to one of a predetermined number of fixed lengths instructions. Predecoding may also include compressing prefix bytes as explained in greater detail below.
- the predecoded instructions are then stored in instruction cache 16 . Instructions may be prefetched and predecoded before they are actually requested by using a prefetch scheme. A variety of prefetch schemes may be employed by prefetch/predecode unit 12 . Before proceeding with a more detailed description of predecode unit 12 , general aspects regarding the embodiment of exemplary microprocessor 10 shown in the figure will be described.
- Microprocessor 10 may employ branch prediction in order to speculatively fetch instructions subsequent to conditional branch instructions.
- Branch prediction unit 14 is included to perform branch prediction operations.
- up to two branch target addresses are stored for each 16-byte portion of each cache line in instruction cache 16 .
- Prefetch/predecode unit 12 determines initial branch targets when a particular line is predecoded. Subsequent updates to the branch targets corresponding to a cache line may occur due to the execution of instructions within the cache line.
- Instruction cache 16 provides an indication of the instruction address being fetched to branch prediction unit 14 . This allows branch prediction unit 14 to determine which branch target addresses to select when forming a branch prediction.
- Instruction alignment unit 18 and functional units 24 provide update information to branch prediction unit 14 .
- branch prediction unit 14 stores two targets per 16-byte portion of the cache line, predictions for some branch instructions within the line may not be stored in branch prediction unit 14 .
- Instruction alignment unit 18 may be configured to detect branch instructions which were not predicted by branch prediction unit 14 .
- Functional units 24 execute the branch instructions and determine if the predicted branch direction was mispredicted. The branch direction may be “taken”, in which subsequent instructions are fetched from the target address of the branch instruction. Conversely, the branch direction may be “not taken”, in which subsequent instructions are fetched from memory locations consecutive to the branch instruction. When a mispredicted branch instruction is detected, instructions subsequent to the mispredicted branch are discarded from the various units of microprocessor 10 .
- a variety of suitable branch prediction algorithms may be employed by branch prediction unit 14 .
- Instruction cache 16 is a high speed cache memory provided to store instructions received from prefetch/predecode unit 12 . Stored instructions are then fetched from instruction cache 16 and forwarded to instruction alignment unit 18 .
- instruction cache 16 may be configured as a set-associative structure.
- Instruction cache 16 may additionally employ a way prediction scheme in order to speed access times. For example, instead of accessing tags identifying each line of instructions and comparing the tags to the fetch address to select a way, instruction cache 16 may predict the way that is accessed. In this manner, the way is speculatively selected prior to accessing the array. Using way prediction, the access time of instruction cache 16 may be similar to a direct-mapped cache.
- instruction cache 16 may be implemented in fully associative, set associative, or direct mapped configurations.
- MROM unit 34 is a read-only memory that is configured to store sequences of “fast-path instructions.”
- Fast path instructions are instructions that may be decoded and executed by decoders 20 A-C and functional units 24 A-C.
- MROM instructions are instructions which are too complex for direct decoding or execution by decoders 20 A-C and functional units 24 A-C.
- instruction cache 16 outputs an MROM instruction
- MROM unit 34 responds by outputting a sequence of fast path instructions. More specifically, MROM unit 34 parses and translates the MROM instruction into a subset of defined fast path instructions to effectuate the desired operation. MROM unit 34 dispatches the subset of fast path instructions to decode units 20 A-C.
- instruction alignment unit 18 routes the instructions to one of decode unit 20 A-C. Register operand information is also detected and routed to register file 30 and reorder buffer 32 . Additionally, if the instructions require one or more memory operations to be performed, instruction alignment unit 18 dispatches the memory operations to load/store unit 26 . Each decoded instruction is dispatched to reservation stations 22 along with operand address information and displacement or immediate data which may be included with the instruction.
- Microprocessor 10 supports out-of-order execution, and thus employs reorder buffer 32 to keep track of the original program sequence for register read and write operations, to implement register renaming, to allow for speculative instruction execution and branch misprediction recovery, and to facilitate precise exceptions.
- a temporary storage location within reorder buffer 32 is reserved upon decode of an instruction that involves the update of a register. The temporary storage location stores the speculative register state that results from the speculative execution of an instruction. If a branch prediction is incorrect, the results from the speculatively-executed instructions along the mispredicted path can be invalidated in the reorder buffer 32 before they are written to register file 30 .
- exceptions are “precise” (i.e., instructions subsequent to the exception-causing instruction are not completed prior to the exception). It is noted that a particular instruction is speculatively executed if it is executed prior to instructions which precede the particular instruction in program order. Preceding instructions may be a branch instruction or an exception-causing instruction, in which case the speculative results may be discarded by reorder buffer 32 .
- each reservation station 22 is capable of holding instruction information (i.e., decoded instructions as well as operand values, operand tags and/or immediate data) for up to three pending instructions awaiting issue to the corresponding functional unit. It is noted that for the embodiment shown in the figure, each reservation station 22 is associated with a dedicated functional unit 24 . Accordingly, three dedicated “issue positions” are formed by reservation stations 22 and functional units 24 . In other words, issue position 0 is formed by reservation station 22 A and functional unit 24 A. Instructions aligned and dispatched to reservation station 22 A are executed by functional unit 24 A. Similarly, issue position I is formed by reservation station 22 B and functional unit 24 B; and issue position 2 is formed by reservation station 22 C and functional unit 24 C.
- register address information is routed to reorder buffer 32 and register file 30 simultaneously.
- the x86 register file includes eight 32-bit real registers (i.e., typically referred to as EAX, EBX, ECX, EDX, EBP, ESI, EDI and ESP).
- register file 30 comprises storage locations for each of the 32-bit real registers. Additional storage locations may be included within register file 30 for use by MROM unit 34 .
- Reorder buffer 32 contains temporary storage locations for results which change the contents of these registers to thereby allow out of order execution.
- a temporary storage location of reorder buffer 32 is reserved for each instruction which, upon decode, is determined to modify the contents of one of the real registers. Therefore, at various points during execution of a particular program, reorder buffer 32 may have one or more locations which contain the speculatively executed contents of a given register.
- reorder buffer 32 forwards to the corresponding reservation station either: 1) the value in the most recently assigned location, or 2) a tag for the most recently assigned location if the value has not yet been produced by the functional unit that will eventually execute the previous instruction. If reorder buffer 32 has a location reserved for a given register, the operand value (or reorder buffer tag) is provided from reorder buffer 32 rather than from register file 30 . If there is no location reserved for a required register in reorder buffer 32 , the value is taken directly from register file 30 . If the operand corresponds to a memory location, the operand value is provided to the reservation station through load/store unit 26 .
- reorder buffer 32 is configured to store and manipulate concurrently decoded instructions as a unit. This configuration will be referred to herein as “line-oriented”. By manipulating several instructions together, the hardware employed within reorder buffer 32 may be simplified. For example, a line-oriented reorder buffer included in the present embodiment allocates storage sufficient for instruction information pertaining to three instructions whenever one or more instructions are dispatched by instruction alignment unit 18 . By contrast, a variable amount of storage is allocated in conventional reorder buffers, dependent upon the number of instructions actually dispatched. A comparatively larger number of logic gates may be required to allocate the variable amount of storage. When each of the concurrently decoded instructions has executed, the instruction results are stored into register file 30 simultaneously.
- a reorder buffer tag identifying a particular instruction may be divided into two fields: a line tag and an offset tag.
- the line tag identifies the set of concurrently decoded instructions including the particular instruction
- the offset tag identifies which instruction within the set corresponds to the particular instruction. It is noted that storing instruction results into register file 30 and freeing the corresponding storage is referred to as “retiring” the instructions. It is further noted that any reorder buffer configuration may be employed in various embodiments of microprocessor 10 .
- reservation stations 22 store instructions until the instructions are executed by the corresponding functional unit 24 .
- An instruction is selected for execution if: (i) the operands of the instruction have been provided; and (ii) the operands have not yet been provided for instructions which are within the same reservation station 22 A- 22 C and which are prior to the instruction in program order. It is noted that when an instruction is executed by one of the functional units 24 , the result of that instruction is passed directly to any reservation stations 22 that are waiting for that result at the same time the result is passed to update reorder buffer 32 (this technique is commonly referred to as “result forwarding”). An instruction may be selected for execution and passed to a functional unit 24 A- 24 C during the clock cycle that the associated result is forwarded. Reservation stations 22 route the forwarded result to the functional unit 24 in this case.
- each functional units 24 A-C is configured to perform integer arithmetic operations of addition and subtraction, as well as shifts, rotates, logical operations, and branch operations. It is noted that a floating point unit (not shown) may also be employed to accommodate floating point operations. The floating point unit may be operated as a coprocessor, receiving instructions from MROM unit 34 and subsequently communicating with reorder buffer 32 to complete the instructions. Additionally, functional units 24 may be configured to perform address generation for load and store memory operations performed by load/store unit 26 .
- Each of the functional units 24 also provides information regarding the execution of conditional branch instructions to the branch prediction unit 14 . If a branch prediction was incorrect, branch prediction unit 14 flushes instructions subsequent to the mispredicted branch that have entered the instruction processing pipeline, and causes a fetch of the required instructions from instruction cache 16 or main memory. It is noted that in such situations, results of instructions in the original program sequence which occur after the mispredicted branch instruction are discarded, including those which were speculatively executed and temporarily stored in load/store unit 26 and reorder buffer 32 .
- Results produced by functional units 24 are sent to reorder buffer 32 if a register value is being updated, and to load/store unit 26 if the contents of a memory location are changed. If the result is to be stored in a register, reorder buffer 32 stores the result in the location reserved for the value of the register when the instruction was decoded.
- a plurality of result buses 38 are included for forwarding of results from functional units 24 and load/store unit 26 . Result buses 38 convey the result generated, as well as the reorder buffer tag identifying the instruction being executed.
- Load/store unit 26 provides an interface between functional units 24 and data cache 28 .
- load/store unit 26 is configured with a load/store buffer having eight storage locations for data and address information for pending loads or stores. When the buffer is full, instruction alignment unit 18 waits until load/store unit 26 has room for the pending load or store request information.
- Load/store unit 26 also performs dependency checking for load memory operations against pending store memory operations to ensure that data coherency is maintained.
- a memory operation is a transfer of data between microprocessor 10 and the main memory subsystem. Memory operations may be the result of an instruction which utilizes an operand stored in memory, or may be the result of a load/store instruction which causes the data transfer but no other operation.
- load/store unit 26 may include a special register storage for special registers such as the segment registers and other registers related to the address translation mechanism defined by the x86 microprocessor architecture.
- load/store unit 26 is configured to perform load memory operations speculatively.
- Store memory operations may be performed in program order, but may be speculatively stored into the predicted way. If the predicted way is incorrect, the data prior to the store memory operation is subsequently restored to the predicted way and the store memory operation is performed to the correct way.
- stores may be executed speculatively as well. Speculatively executed stores are placed into a store buffer, along with a copy of the cache line prior to the update. If the speculatively executed store is later discarded due to branch misprediction or exception, the cache line may be restored to the value stored in the buffer. It is noted that load/store unit 26 may be configured to perform any amount of speculative execution, including no speculative execution.
- Data cache 28 is a high speed cache memory provided to temporarily store data being transferred between load/store unit 26 and the main memory subsystem.
- data cache 28 has a capacity of storing up to sixteen kilobytes of data in an eight-way set-associative structure. Similar to instruction cache 16 , data cache 28 may employ a way prediction mechanism. It is understood that data cache 28 may be implemented in a variety of specific memory configurations, including set-associative and direct-mapped configurations.
- instruction cache 16 and data cache 28 are linearly addressed.
- the linear address is formed from the offset specified by the instruction and the base address specified by the segment portion of the x86 address translation mechanism.
- Linear addresses may optionally be translated to physical addresses for accessing a main memory.
- the linear to physical translation is specified by the paging portion of the x86 address translation mechanism.
- a linear addressed cache stores linear address tags.
- a set of physical tags (not shown) may be employed for mapping the linear addresses to physical addresses and for detecting translation aliases. Additionally, the physical tag block may perform linear to physical address translation.
- Sample code 60 represents a plurality of variable-length instructions, in this case x86 instructions. While this method may be used with a number of different types of variable-length instructions (e.g., 68000 instructions), x86 instructions are chosen for illustration purposes.
- predecode unit 12 is configured to receive each variable-length instruction and then pad each field within the variable-length instruction to a predetermined maximum field width. While any predetermined constant may be used, e.g., 90 16 , the examples herein use 00 16 as the padding constant.
- the prefix bytes are expanded to five bytes.
- the first byte may be reserved for segment override information and may comprise one of the following: 00 16 representing no segment override, 26 16 representing the ES segment, 2E 16 representing the CS segment, 36 16 representing the SS segment, 3E 16 representing the DS segment, 64 16 representing the FS segment, or 65 16 representing the GS segment.
- the second byte may be reserved for repeat information and may comprise one of the following: 00 16 representing no repeat information, F2 16 representing the REPNE/REPNZ operation, or F3 16 representing the REP/REPE/REPZ operation.
- the third byte may be reserved for hardware lock information for memory operations in multiprocessor environments and may comprise one of the following: 00 16 representing no lock information, or F0 16 representing an asserted hardware lock.
- the fourth byte may be reserved for operand size information and may comprise one of the following: 00 16 representing no change in operand size, or 66 16 for toggling the word size.
- the fifth byte may be reserved for address size information and may comprise one of the following: 00 16 representing no change in address size, or 67 16 for toggling between 16 and 32-bit addressing. Note the above nomenclature matches the existing x86 nomenclature, but other constants for each function may be selected in other embodiments.
- one major difficulty in decoding variable-length instructions is determining where each instruction begins and ends.
- each instruction is automatically aligned when it is read from instruction cache 16 .
- instruction alignment unit 18 and decoders 20 A-C may be simplified.
- one or more decode units 20 A- 20 C may be optimized to receive fixed-length instructions, thereby further improving decode speed.
- one or more decoder units 20 A- 20 C may be bypassed completely for fixed-length instructions.
- a second difficulty in decoding variable-length instructions is determining which instruction and operand fields are present and where those instruction fields begin and end. By predecoding instructions to the format illustrated, determining which fields are present in each instruction and which, if any, operands are required, may be simplified.
- FIG. 5 another embodiment of this method is illustrated.
- the five prefix bytes 102 from the previous embodiment's fixed-length instruction format 60 are compressed into a single prefix byte 130 .
- using this format the benefits of a fixed-length format may be preserved while reducing the amount of storage required for each fixed-length instruction.
- prefix byte 122 comprises a 3-bit segment override field 140 , a 2-bit repeat field 142 , a single lock bit 144 , a single operand size bit 146 , and a single address size bit 148 .
- Segment override information may be encoded into three bits of prefix byte 122 as follows.
- a prefix byte of 26 16 which indicates that the contents of the ES register are to be used to define the segment, may be replaced by the bit sequence 001 2 .
- a prefix byte of 2E 16 (ES register) may be replaced by the bit sequence 010 2 .
- a prefix byte of 36 16 may be replaced by 011 2 .
- a prefix byte of 3E 16 may be replaced by 100 2 .
- a prefix byte of 64 16 may be replaced by 101 2 .
- a prefix byte of 65 16 may be replaced by 110 2 . If there is no segment override, 000 2 may be used in segment override field 140 .
- the prefix repeat information may be encoded into a 2-bit repeat field 142 of prefix byte 122 as follows.
- a prefix byte of F2 (REPNE/REPNZ) may be replaced with the bit sequence 01 2 .
- a prefix byte of F3 (REP/REPE/REPZ) may be replaced by the bit sequence 10 2 . If there is no repeat information, 00 2 may be used in repeat field 142 .
- a lock instruction F0 16 is present, this information may be encoded into a single lock bit 144 .
- a toggle operand size byte 66 16 is present, this information may be encoded into a single bit 146 .
- toggle address size byte 67 16 may be encoded into bit 148 .
- all five bytes of prefix information may be compressed into a single prefix byte 122 .
- using this method saves space within instruction cache 16 while still providing clearly defined fields that do not vary from one instruction to the next.
- segment override field 140 operand size field 146
- address size field 148 may be encoded as described above.
- Two byte instruction field 160 is a single bit that indicates whether the corresponding instruction has a two-byte opcode (e.g., an x86 opcode beginning with 0F).
- Lock/repeat field 162 is two bits wide and combines the functionality of fields 142 and 144 from the previous embodiment.
- Lock/repeat field 162 may be encoded as follows: 00 indicating no lock or repeat prefix present, 01 indicating a lock prefix is present, 10 indicating a REP, REPE, or REPZ (F3H) prefix is present, and 11 indicating that a REPNE/REPNZ (F2H) prefix is present.
- This embodiment may advantageously reduced both prefix length variation and opcode length variation.
- instruction cache 16 comprises a lookup table 90 and an instruction storage array 92 .
- Lookup table 90 comprises a plurality of storage locations configured to store pointers to storage locations within instruction storage array 92 .
- Instruction storage array 92 comprises a plurality of instruction storage locations each configured to store a fixed-length instruction received from prefetch/predecode unit 12 .
- instruction cache 16 Upon receiving a predecoded fixed-length instruction for predecode unit 12 , instruction cache 16 stores the instruction in a particular storage location within instruction storage array 92 . Instruction cache 16 stores a pointer to that particular storage location in pointer array 90 . Pointer array 90 may be configured similarly to standard instruction caches, except smaller. For example, pointer array 90 may be configured as a set-associative cache with way prediction as previously disclosed. Instruction storage array 92 may be configured as direct mapped, or may also be configured in a set-associative structure.
- instruction cache 16 When an instruction is received from predecode unit 12 (e.g., 00 8B 00 D8 00 00 00 00 00 00 00 00 00 00 00 00 00 00), instruction cache 16 is configured to store this instruction into the next available storage location within instruction storage array 92 . Using the example configured from the figure, the instruction is stored into an instruction storage location having an index 07 16 . Thus, instruction cache 16 stores the index value 07 16 into pointer array 90 . The particular storage location within pointer array 90 is selected just as a cache line storage location would be selected in a standard instruction cache.
- pointer 07 16 may be stored in the location within pointer array 90 that corresponds to logical address 0A8D:0100.
- pointer array 90 may be linearly addressed.
- instruction cache 16 may access pointer array 90 and read the pointer that corresponds to the requested address, i.e., 07 16 . This pointer is then used access a storage location within instruction storage array 92 .
- the instruction stored therein i.e., 00 8B 00 D8 00 00 00 00 00 00 00 00 00 00 00 00
- instruction cache 16 is configured to store both variable and fixed-length versions of instructions.
- Instruction cache 16 comprises pointer array 90 , fixed-length instruction storage array 92 , and a variable-length instruction storage array 150 .
- Storage array 150 is configured to store variable-length instructions for use when receiving a requested address generated by a branch instruction that is taken.
- fixed-length instruction storage array 92 stores fixed-length instructions which are accessed by requested addresses from non-branch instructions and branch instructions that are not taken. Because predecoding involves padding fields within each variable length instruction, branch targets may become skewed as a result of the padding.
- this configuration may advantageously allow fast decoding of fixed-length instruction, while effectively compensating for the expansion of and shifting of instructions due to padding.
- This configuration may be particularly useful if the program contains branch or jump instructions that have a destination in the middle of an instruction. This is because such instructions may be detected and properly executed from variable-length instruction storage array 90 .
- Instruction cache may further comprise a multiplexer (not shown) to select between the output from fixed-length instruction storage array 92 and variable-length instruction storage array 150 .
- microprocessor 10 may be configured with two sets of decoders 20 A-C, one set for decoding variable-length instructions and one set for decoding fixed-length instructions.
- a single set of decoders 20 A-C may be used, wherein the decoders are allowed more clock cycles to perform variable-length decoding.
- one or more decoders may be optimized to handle fixed-length instructions, while the remaining decoders may be optimized to handle variable-length instructions.
- each instruction may be stored in two different forms. Non-branch instructions are requested serially and therefore the shifting caused by predecoding and padding the instructions is not a problem. However, after a branch instruction, instruction cache 16 will receive a requested address that may have no correlation to the address at which the branch instruction was stored. Thus, variable-length instruction storage array 150 provides a mechanism for fetching the proper instruction after such instructions.
- predecode unit 12 expands variable length instructions to one of three lengths: 5 bytes, 6 bytes, or 13 bytes.
- Predecode unit 12 may assign an instruction to a particular group based upon whether a particular field is present within the instruction. For example, if an instruction being predecoded does not have displacement or immediate data information, then the instruction is padded to a fixed length of five bytes and is stored as part of group 160 . If the instruction has data bytes but does not have displacement information, then the instruction is padded to a fixed length of nine bytes and is stored in group 142 .
- the instruction has both displacement bytes and data bytes, then the instruction is padded to the full thirteen bytes and is stored in group 144 .
- the prefix bytes may be compressed into a single byte.
- this method speeds decode while reducing the resources necessary to store fixed-length instructions within instruction cache 16 .
- predecode unit 12 may be configured to pad and group instructions in two or four byte increments, resulting in four or eight groups of instructions. Further note that other methods may be used to pad instructions to a predetermined length. For example, in one embodiment predecoder 12 may be configured to pad constants after the final byte of the variable-length instruction. While this method may not identify each field within the instruction, it may allow for faster predecoding while still reducing decoding (particularly alignment) times.
- pointer array 90 is configured to store pointers which point to storage locations within fixed-length instruction storage arrays 92 A-C.
- Each fixed-length instruction storage array 92 A-C (also referred to as sub-arrays) is configured to store one particular length of fixed-length instructions.
- Sub-array 92 C may be configured to store fixed-length instructions that are 13 bytes in length (e.g., instructions having displacement data).
- Sub-array 92 B may be configured to store fixed-length instructions that are 9 bytes in length (e.g., instruction without displacement data).
- sub-array 92 A may be configured to store fixed-length instructions that are only five bytes in length (e.g., instructions having no displacement bytes or data bytes).
- Pointer array 90 may be configured as in previous embodiments, with each storage location storing a pointer that points to one storage location within either sub-array 92 A, sub-array 92 B, or sub-array 92 C.
- variable-length instruction storage array 150 pointer array 90 , and fixed-length instruction storage arrays 92 A-C may all be incorporated into instruction cache 16 .
- the embodiment illustrated above may comprise two fixed-length instruction storage arrays storing 9-byte long instructions. The first array may be configured to store instructions not having displacement data, whereas the second array may be configured to store instructions not having immediate data.
- variable-length to fixed length conversion may take place as part of the compiling of high-level language instructions to object code (e.g., x86 instructions), or the conversion may be performed as an optimization step during or after object code has been generated.
- object code e.g., x86 instructions
- the compiler may optionally be configured to expand only certain speed-critical portions of code.
- This may improve the speed of decode for speed-critical sections of code while reducing the amount of code expansion that takes place.
- the compiler may be configured to indicate the start and end of fixed-length instruction sections by inserting special opcodes or special status bits.
- the compiler may also be configured to pad the variable-length instructions using selected constants, e.g., no operation instruction codes (NOPs).
- NOPs no operation instruction codes
- FIG. 11 a block diagram of one embodiment of a computer system 200 utilizing microprocessor 10 is shown.
- a main memory 204 is coupled to bus bridge 202 through a memory bus 206
- a graphics controller 208 is coupled to bus bridge 202 through an AGP bus 210 .
- a plurality of PCI devices 212 A- 212 B are coupled to bus bridge 202 through a PCI bus 214 .
- a secondary bus bridge 216 may further be provided to accommodate an electrical interface to one or more EISA or ISA devices 218 through an EISA/ISA bus 220 .
- Microprocessor 10 is coupled to bus bridge 202 through a CPU bus 224 .
- Bus bridge 202 provides an interface between microprocessor 10 , main memory 204 , graphics controller 208 , and devices attached to PCI bus 214 .
- bus bridge 202 identifies the target of the operation (e.g. a particular device or, in the case of PCI bus 214 , that the target is on PCI bus 214 ).
- Bus bridge 202 routes the operation to the targeted device.
- Bus bridge 202 generally translates an operation from the protocol used by the source device or bus to the protocol used by the target device or bus.
- secondary bus bridge 216 may further incorporate additional functionality, as desired.
- secondary bus bridge 216 includes a master PCI arbiter (not shown) for arbitrating ownership of PCI bus 214 .
- An input/output controller (not shown), either external from or integrated with secondary bus bridge 216 , may also be included within computer system 200 to provide operational support for a keyboard and mouse 222 and for various serial and parallel ports, as desired.
- An external cache unit (not shown) may further be coupled to CPU bus 224 between microprocessor 10 and bus bridge 202 in other embodiments. Alternatively, the external cache may be coupled to bus bridge 202 and cache control logic for the external cache may be integrated into bus bridge 202 .
- Main memory 204 is a memory in which application programs are stored and from which microprocessor 10 primarily executes.
- a suitable main memory 204 comprises DRAM (Dynamic Random Access Memory), and preferably a plurality of banks of SDRAM (Synchronous DRAM).
- PCI devices 212 A- 212 B are illustrative of a variety of peripheral devices such as, for example, network interface cards, video accelerators, audio cards, hard or floppy disk drives or drive controllers, SCSI (Small Computer Systems Interface) adapters and telephony cards.
- ISA device 218 is illustrative of various types of peripheral devices, such as a modem, a sound card, and a variety of data acquisition cards such as GPIB or field bus interface cards.
- Graphics controller 208 is provided to control the rendering of text and images on a display 226 .
- Graphics controller 208 may embody a typical graphics accelerator generally known in the art to render three-dimensional data structures which can be effectively shifted into and from main memory 204 .
- Graphics controller 208 may therefore be a master of AGP bus 210 in that it can request and receive access to a target interface within bus bridge 202 to thereby obtain access to main memory 204 .
- a dedicated graphics bus accommodates rapid retrieval of data from main memory 204 .
- graphics controller 208 may further be configured to generate PCI protocol transactions on AGP bus 210 .
- the AGP interface of bus bridge 202 may thus include functionality to support both AGP protocol transactions as well as PCI protocol target and initiator transactions.
- Display 226 is any electronic display upon which an image or text can be presented.
- a suitable display 226 includes a cathode ray tube (“CRT”), a liquid crystal display (“LCD”), etc.
- computer system 200 may be a multiprocessing computer system including additional microprocessors.
- a signal is “asserted” if it conveys a value indicative of a particular condition. Conversely, a signal is “deasserted” or “not asserted” if it conveys a value indicative of a lack of a particular condition.
- a signal may be defined to be asserted when it conveys a logical zero value or, conversely, when it conveys a logical one value.
- various values have been described as being discarded in the above discussion. A value may be discarded in a number of manners, but generally involves modifying the value such that it is ignored by logic circuitry which receives the value.
- the logic state of the value may be inverted to discard the value.
- the value is an n-bit value, one of the n-bit encodings may indicate that the value is invalid. Setting the value to the invalid encoding causes the value to be discarded.
- an n-bit value may include a valid bit indicative, when set, that the n-bit value is valid. Resetting the valid bit may comprise discarding the value. Other methods of discarding a value may be used as well.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Advance Control (AREA)
- Executing Machine-Instructions (AREA)
Abstract
A microprocessor configured to reduce variance in the length of variable length instructions by compressing multiple prefix bytes into a single byte is disclosed. The microprocessor is configured with a predecode unit and an instruction cache. The predecode unit is configured to receive variable length instructions, each having a variable number of prefix bytes. The predecode unit is configured to detect the prefix bytes and compress them into one compressed prefix byte for each instruction. The instruction cache is coupled to the predecode unit and is configured to receive and store the instructions and compressed prefix bytes from the predecode unit. The instruction cache may be configured to output one of the instructions and any corresponding compressed prefix bytes in response to receiving a fetch address. A computer system, method, and software program configured to compress prefix bytes are also disclosed.
Description
- 1. Field of the Invention
- This invention relates to microprocessors and, more particularly, to decoding variable length instructions within a microprocessor.
- 2. Description of the Relevant Art
- The number of software applications written for the x86 instruction set is quite large. As a result, despite the introduction of newer and more advanced instruction sets, microprocessor designers have continued to design microprocessors capable of executing the x86 instruction set.
- The x86 instruction set is relatively complex and is characterized by a plurality of variable-length instructions. A generic format illustrative of the x86 instruction set is shown in FIG. 1. As illustrated in the figure, an x86 instruction consists of from one to five
optional prefix bytes 102, followed by an operation code (opcode)field 104, an optional addressing mode (Mod R/M)byte 106, an optional scale-index-base (SIB)byte 108, anoptional displacement field 110, and an optionalimmediate data field 112. - The
opcode field 104 defines the basic operation for a particular instruction. The default operation of a particular opcode may be modified by one ormore prefix bytes 102. For example, one ofprefix bytes 102 may be used to change the address or operand size for an instruction, to override the default segment used in memory addressing, or to instruct the processor to repeat a string operation a number of times. Theopcode field 104 followsprefix bytes 102, if present, and may be one or two bytes in length. The addressing mode (Mod RIM)byte 106 specifies the registers used as well as memory addressing modes. The scale-index-base (SIB)byte 108 is used only in 32-bit base-relative addressing using scale and index factors. A base field withinSIB byte 108 specifies which register contains the base value for the address calculation, and an index field withinSIB byte 108 specifies which register contains the index value. A scale field withinSIB byte 108 specifies the power of two by which the index value will be multiplied before being added, along with any displacement, to the base value. The next instruction field is adisplacement field 110, which is optional and may be from one to four bytes in length.Displacement field 110 contains a constant used in address calculations. The optionalimmediate field 112, which may also be from one to four bytes in length, contains a constant used as an instruction operand. The shortest x86 instructions are only one byte long, and comprise a single opcode byte. The 80286 sets a maximum length for an instruction at 10 bytes, while the 80386 and 80486 both allow instruction lengths of up to 15 bytes. - The complexity of the x86 instruction set poses many difficulties in implementing high performance x86-compatible microprocessors. In particular, the variable length of x86 instructions makes decoding instructions difficult. Decoding instructions typically involves determining the boundaries of an instruction and then identifying each field within the instruction, e.g., the opcode and operand fields. Decoding typically takes place once the instruction is fetched from the instruction cache before execution.
- One method for determining the boundaries of instructions involves generating a number of predecode bits for each instruction byte read from main memory. The predecode bits provide information about the instruction byte they are associated with. For example, an asserted predecode start bit indicates that the associated instruction byte is the first byte of an instruction. Similarly, an asserted predecode end bit indicates that the associated instruction byte is the last byte of an instruction. Once the predecode bits for a particular instruction byte are calculated, they are stored together with the instruction byte in an instruction cache. When a “fetch” is performed, i.e., a number of instruction bytes are read from the instruction cache, the associated start and end bits are also read. The start and end bits may then be used to generate valid masks for the individual instructions with the fetch. A valid mask is a series of bits in which each bit corresponds to a particular instruction byte. Valid mask bits associated with the first byte of an instruction, the last byte of the instruction, and all bytes in between the first and last bytes of the instruction are asserted. All other valid mask bits are not asserted. Turning now to FIG. 2, an exemplary valid mask is shown. The figure illustrates a portion of a
fetch 120 and its associated start andend bits valid mask 126 forinstruction B 128 is to be generated, start andend bits Valid mask 126 could then be used to mask off all bytes withinfetch 120 that are not part ofinstruction B 128. - Once the boundaries of an instruction have been determined, the fields within the instruction, e.g., the opcode and operand fields, may be identified. Once again, the variable length of x86 instructions complicates the identification process. In particular, the optional prefix bytes within an x86 instruction create further complications. For example, in some instructions the opcode will begin with the first byte of the instruction, while others may begin with the second, third, or fourth byte.
- To perform the difficult task of decoding x86 instructions, a number of cascaded levels of logic are typically used. Thus, decoding may require a number of clock cycles and may create a significant delay before any instructions are available to the functional stages of the microprocessor's pipeline. As microprocessors increase the number of instructions they are able to execute per clock cycle, instruction decoding may become a performance limiting factor. Therefore, a mechanism for simplifying the complexity and time required for instruction decoding is needed.
- The problems outlined above are reduced in large part by a microprocessor capable of predecoding variable-length instructions in a manner that reduces length variations in the instructions set. By compressing each instruction's prefix bytes into a single compressed prefix byte, potential variation in instruction length is reduced. Advantageously, this may serve to decrease the time needed for decoding instructions.
- In one embodiment, a microprocessor configured to compress prefix bytes may comprise a predecode unit and an instruction cache. The predecode unit may be configured to receive variable length instructions from a memory subsystem. A subset of the instructions may have no prefix bytes, while others may have one or more prefix bytes. The predecode unit is configured to detect the prefix bytes associated with each instruction and compress them into a single compressed prefix byte. The predecode unit may also perform other decoding functions and or instruction padding. The instruction cache is coupled to the predecode unit and is configured to receive and store the partially decoded instructions and their associated compressed prefix bytes. The instruction cache is configured to output the instructions and their compressed prefix bytes in response to receiving corresponding fetch addresses. A computer system employing one or more microprocessors as described above in conjunction with other peripheral devices (e.g., a communications modem) is also contemplated.
- A method for executing variable length instructions is also contemplated. In one embodiment, the method comprises reading a plurality of instruction bytes from a memory subsystem, and then predecoding the instruction bytes. Predecoding involves detecting starting, ending, and prefix bytes for each instruction. The prefix bytes are compressed into a single compressed prefix byte; and then stored with the instructions in an instruction cache. In one embodiment, the prefix bytes are compressed by encoding operand size prefix bytes address size prefix bytes into a single operand size bit, address size prefix bytes into a single address size bit, and segment override prefix bytes into a three-bit field, all within the single compressed prefix byte.
- A software program embodied on computer-readable media is also contemplated. In one embodiment, the program is an optimizing compiler comprising three groups of instructions. The first group of instructions is configured to detect the boundaries of variable-length instructions. The second group of instructions is configured to detect prefix bytes associated with each variable-length instruction. The third group of instructions is configured to compress the prefix bytes into single compressed prefix bytes. In another embodiment, the software program may be a dynamically linked library configured to receive said variable-length instructions as input and generate optimized instructions and compressed prefix bytes as output.
- Other objects and advantages of the invention will become apparent upon reading the following detailed description and upon reference to the accompanying drawings in which:
- FIG. 1 is a block diagram of a generic x86 instruction format.
- FIG. 2 is a block diagram illustrating one embodiment of a valid mask.
- FIG. 3 is a block diagram of one embodiment of a microprocessor.
- FIG. 4 is table illustrating one embodiment of a method for decoding variable-length instructions into fixed-length instructions.
- FIG. 5 is a table illustrating another embodiment of a method for decoding variable-length instructions into fixed-length instructions.
- FIG. 6A is a diagram illustrating one embodiment of a method for compressing prefix bytes.
- FIG. 6B is a diagram illustrating another method for compressing prefix bytes.
- FIG. 7 is a diagram illustrating one possible embodiment of the instruction cache from FIG. 3.
- FIG. 8 is a diagram illustrating another embodiment of the instruction cache from the microprocessor depicted in FIG. 3.
- FIG. 9 is a diagram illustrating another method for decoding variable-length instructions into fixed-length instructions.
- FIG. 10 is a diagram illustrating another embodiment of the instruction cache from the microprocessor depicted in FIG. 3.
- FIG. 11 is a diagram showing one embodiment of a computer system utilizing the microprocessor of FIG. 3.
- While the invention is susceptible to various modifications and alternative forms, specific embodiments thereof are shown by way of example in the drawings and will be described in detail herein. It should be understood, however, that the drawings and detailed description thereto are not intended to limit the invention to the particular form disclosed, but on the contrary, the intention is to cover all modifications, equivalents and alternatives falling within the spirit and scope of the present invention as defined by the appended claims.
- Turning now to FIG. 3, a block diagram of one embodiment of a
microprocessor 10 is shown.Microprocessor 10 includes a prefetch/predecode unit 12, abranch prediction unit 14, aninstruction cache 16, aninstruction alignment unit 18, a plurality ofdecode units 20A-20C, a plurality ofreservation stations 22A-22C, a plurality offunctional units 24A-24C, a load/store unit 26, adata cache 28, aregister file 30, areorder buffer 32, andMROM unit 34. Elements referred to herein with a particular reference number followed by a letter may be collectively referred to by the reference number alone. For example,reservation stations 22A-22C may be collectively referred to as reservation stations 22. - Prefetch/
predecode unit 12 is coupled to receive instructions from a main memory subsystem (not shown), and is further coupled toinstruction cache 16 andbranch prediction unit 14. Similarly,branch prediction unit 14 is coupled toinstruction cache 16. Still further,branch prediction unit 14 is coupled toinstruction alignment unit 18 and functional units 24.Instruction cache 16 is further coupled toMROM unit 34 andinstruction alignment unit 18.Instruction alignment unit 18 is in turn coupled to load/store unit 26 and torespective decode units 20A-20C.Respective decode units 20A-20C are coupled toreservation stations 22A-22C, which are further coupled to respectivefunctional units 24A-24C. Additionally,instruction alignment unit 18 and reservation stations 22 are coupled to registerfile 30 and reorderbuffer 32. Functional units 24 are coupled to load/store unit 26,register file 30, and reorderbuffer 32 as well.Data cache 28 is coupled to load/store unit 26 and to the main memory subsystem. Finally,MROM unit 34 is coupled toinstruction alignment unit 18. - Instructions are prefetched from main memory by prefetch/
predecode unit 12. Prefetch/predecode unit 12 predecodes the variable-length instructions. This may entail generating predecode bits and or padding instructions to one of a predetermined number of fixed lengths instructions. Predecoding may also include compressing prefix bytes as explained in greater detail below. The predecoded instructions are then stored ininstruction cache 16. Instructions may be prefetched and predecoded before they are actually requested by using a prefetch scheme. A variety of prefetch schemes may be employed by prefetch/predecode unit 12. Before proceeding with a more detailed description ofpredecode unit 12, general aspects regarding the embodiment ofexemplary microprocessor 10 shown in the figure will be described. -
Microprocessor 10 may employ branch prediction in order to speculatively fetch instructions subsequent to conditional branch instructions.Branch prediction unit 14 is included to perform branch prediction operations. In one embodiment, up to two branch target addresses are stored for each 16-byte portion of each cache line ininstruction cache 16. Prefetch/predecode unit 12 determines initial branch targets when a particular line is predecoded. Subsequent updates to the branch targets corresponding to a cache line may occur due to the execution of instructions within the cache line.Instruction cache 16 provides an indication of the instruction address being fetched tobranch prediction unit 14. This allowsbranch prediction unit 14 to determine which branch target addresses to select when forming a branch prediction.Instruction alignment unit 18 and functional units 24 provide update information tobranch prediction unit 14. Becausebranch prediction unit 14 stores two targets per 16-byte portion of the cache line, predictions for some branch instructions within the line may not be stored inbranch prediction unit 14.Instruction alignment unit 18 may be configured to detect branch instructions which were not predicted bybranch prediction unit 14. Functional units 24 execute the branch instructions and determine if the predicted branch direction was mispredicted. The branch direction may be “taken”, in which subsequent instructions are fetched from the target address of the branch instruction. Conversely, the branch direction may be “not taken”, in which subsequent instructions are fetched from memory locations consecutive to the branch instruction. When a mispredicted branch instruction is detected, instructions subsequent to the mispredicted branch are discarded from the various units ofmicroprocessor 10. A variety of suitable branch prediction algorithms may be employed bybranch prediction unit 14. -
Instruction cache 16 is a high speed cache memory provided to store instructions received from prefetch/predecode unit 12. Stored instructions are then fetched frominstruction cache 16 and forwarded toinstruction alignment unit 18. In one embodiment,instruction cache 16 may be configured as a set-associative structure.Instruction cache 16 may additionally employ a way prediction scheme in order to speed access times. For example, instead of accessing tags identifying each line of instructions and comparing the tags to the fetch address to select a way,instruction cache 16 may predict the way that is accessed. In this manner, the way is speculatively selected prior to accessing the array. Using way prediction, the access time ofinstruction cache 16 may be similar to a direct-mapped cache. After the instruction bytes have been read, a tag comparison is performed for verification. If the way prediction is incorrect, the correct instruction bytes are fetched and the incorrect instruction bytes (which are further down the processing pipeline) are discarded. It is noted thatinstruction cache 16 may be implemented in fully associative, set associative, or direct mapped configurations. -
MROM unit 34 is a read-only memory that is configured to store sequences of “fast-path instructions.” Fast path instructions are instructions that may be decoded and executed bydecoders 20A-C andfunctional units 24A-C. In contrast, “MROM instructions” are instructions which are too complex for direct decoding or execution bydecoders 20A-C andfunctional units 24A-C. Wheninstruction cache 16 outputs an MROM instruction,MROM unit 34 responds by outputting a sequence of fast path instructions. More specifically,MROM unit 34 parses and translates the MROM instruction into a subset of defined fast path instructions to effectuate the desired operation.MROM unit 34 dispatches the subset of fast path instructions to decodeunits 20A-C. - Once instruction bytes are fetched from
instruction cache 16, they are conveyed toinstruction alignment unit 18.Instruction alignment unit 18 routes the instructions to one ofdecode unit 20A-C. Register operand information is also detected and routed to registerfile 30 and reorderbuffer 32. Additionally, if the instructions require one or more memory operations to be performed,instruction alignment unit 18 dispatches the memory operations to load/store unit 26. Each decoded instruction is dispatched to reservation stations 22 along with operand address information and displacement or immediate data which may be included with the instruction. -
Microprocessor 10 supports out-of-order execution, and thus employsreorder buffer 32 to keep track of the original program sequence for register read and write operations, to implement register renaming, to allow for speculative instruction execution and branch misprediction recovery, and to facilitate precise exceptions. A temporary storage location withinreorder buffer 32 is reserved upon decode of an instruction that involves the update of a register. The temporary storage location stores the speculative register state that results from the speculative execution of an instruction. If a branch prediction is incorrect, the results from the speculatively-executed instructions along the mispredicted path can be invalidated in thereorder buffer 32 before they are written to registerfile 30. Similarly, if a particular instruction causes an exception, instructions subsequent to the exception-causing instruction may be discarded. In this manner, exceptions are “precise” (i.e., instructions subsequent to the exception-causing instruction are not completed prior to the exception). It is noted that a particular instruction is speculatively executed if it is executed prior to instructions which precede the particular instruction in program order. Preceding instructions may be a branch instruction or an exception-causing instruction, in which case the speculative results may be discarded byreorder buffer 32. - The decoded instructions and immediate or displacement data provided at the outputs of
instruction alignment unit 18 are routed directly to respective reservation stations 22. In one embodiment, each reservation station 22 is capable of holding instruction information (i.e., decoded instructions as well as operand values, operand tags and/or immediate data) for up to three pending instructions awaiting issue to the corresponding functional unit. It is noted that for the embodiment shown in the figure, each reservation station 22 is associated with a dedicated functional unit 24. Accordingly, three dedicated “issue positions” are formed by reservation stations 22 and functional units 24. In other words,issue position 0 is formed byreservation station 22A andfunctional unit 24A. Instructions aligned and dispatched toreservation station 22A are executed byfunctional unit 24A. Similarly, issue position I is formed byreservation station 22B andfunctional unit 24B; andissue position 2 is formed byreservation station 22C andfunctional unit 24C. - Upon decode of a particular instruction, if a required operand is a register location, register address information is routed to reorder
buffer 32 and registerfile 30 simultaneously. Those of skill in the art will appreciate that the x86 register file includes eight 32-bit real registers (i.e., typically referred to as EAX, EBX, ECX, EDX, EBP, ESI, EDI and ESP). In embodiments ofmicroprocessor 10 which employ the x86 microprocessor architecture, registerfile 30 comprises storage locations for each of the 32-bit real registers. Additional storage locations may be included withinregister file 30 for use byMROM unit 34.Reorder buffer 32 contains temporary storage locations for results which change the contents of these registers to thereby allow out of order execution. A temporary storage location ofreorder buffer 32 is reserved for each instruction which, upon decode, is determined to modify the contents of one of the real registers. Therefore, at various points during execution of a particular program, reorderbuffer 32 may have one or more locations which contain the speculatively executed contents of a given register. - If following decode of a given instruction it is determined that reorder
buffer 32 has a previous location or locations assigned to a register used as an operand in the given instruction, reorderbuffer 32 forwards to the corresponding reservation station either: 1) the value in the most recently assigned location, or 2) a tag for the most recently assigned location if the value has not yet been produced by the functional unit that will eventually execute the previous instruction. Ifreorder buffer 32 has a location reserved for a given register, the operand value (or reorder buffer tag) is provided fromreorder buffer 32 rather than fromregister file 30. If there is no location reserved for a required register inreorder buffer 32, the value is taken directly fromregister file 30. If the operand corresponds to a memory location, the operand value is provided to the reservation station through load/store unit 26. - In one particular embodiment, reorder
buffer 32 is configured to store and manipulate concurrently decoded instructions as a unit. This configuration will be referred to herein as “line-oriented”. By manipulating several instructions together, the hardware employed withinreorder buffer 32 may be simplified. For example, a line-oriented reorder buffer included in the present embodiment allocates storage sufficient for instruction information pertaining to three instructions whenever one or more instructions are dispatched byinstruction alignment unit 18. By contrast, a variable amount of storage is allocated in conventional reorder buffers, dependent upon the number of instructions actually dispatched. A comparatively larger number of logic gates may be required to allocate the variable amount of storage. When each of the concurrently decoded instructions has executed, the instruction results are stored intoregister file 30 simultaneously. The storage is then free for allocation to another set of concurrently decoded instructions. Additionally, the amount of control logic circuitry employed per instruction is reduced because the control logic is amortized over several concurrently decoded instructions. A reorder buffer tag identifying a particular instruction may be divided into two fields: a line tag and an offset tag. The line tag identifies the set of concurrently decoded instructions including the particular instruction, and the offset tag identifies which instruction within the set corresponds to the particular instruction. It is noted that storing instruction results intoregister file 30 and freeing the corresponding storage is referred to as “retiring” the instructions. It is further noted that any reorder buffer configuration may be employed in various embodiments ofmicroprocessor 10. - As noted earlier, reservation stations22 store instructions until the instructions are executed by the corresponding functional unit 24. An instruction is selected for execution if: (i) the operands of the instruction have been provided; and (ii) the operands have not yet been provided for instructions which are within the
same reservation station 22A-22C and which are prior to the instruction in program order. It is noted that when an instruction is executed by one of the functional units 24, the result of that instruction is passed directly to any reservation stations 22 that are waiting for that result at the same time the result is passed to update reorder buffer 32 (this technique is commonly referred to as “result forwarding”). An instruction may be selected for execution and passed to afunctional unit 24A-24C during the clock cycle that the associated result is forwarded. Reservation stations 22 route the forwarded result to the functional unit 24 in this case. - In one embodiment, each
functional units 24A-C is configured to perform integer arithmetic operations of addition and subtraction, as well as shifts, rotates, logical operations, and branch operations. It is noted that a floating point unit (not shown) may also be employed to accommodate floating point operations. The floating point unit may be operated as a coprocessor, receiving instructions fromMROM unit 34 and subsequently communicating withreorder buffer 32 to complete the instructions. Additionally, functional units 24 may be configured to perform address generation for load and store memory operations performed by load/store unit 26. - Each of the functional units24 also provides information regarding the execution of conditional branch instructions to the
branch prediction unit 14. If a branch prediction was incorrect,branch prediction unit 14 flushes instructions subsequent to the mispredicted branch that have entered the instruction processing pipeline, and causes a fetch of the required instructions frominstruction cache 16 or main memory. It is noted that in such situations, results of instructions in the original program sequence which occur after the mispredicted branch instruction are discarded, including those which were speculatively executed and temporarily stored in load/store unit 26 and reorderbuffer 32. - Results produced by functional units24 are sent to reorder
buffer 32 if a register value is being updated, and to load/store unit 26 if the contents of a memory location are changed. If the result is to be stored in a register, reorderbuffer 32 stores the result in the location reserved for the value of the register when the instruction was decoded. A plurality ofresult buses 38 are included for forwarding of results from functional units 24 and load/store unit 26.Result buses 38 convey the result generated, as well as the reorder buffer tag identifying the instruction being executed. - Load/
store unit 26 provides an interface between functional units 24 anddata cache 28. In one embodiment, load/store unit 26 is configured with a load/store buffer having eight storage locations for data and address information for pending loads or stores. When the buffer is full,instruction alignment unit 18 waits until load/store unit 26 has room for the pending load or store request information. Load/store unit 26 also performs dependency checking for load memory operations against pending store memory operations to ensure that data coherency is maintained. A memory operation is a transfer of data betweenmicroprocessor 10 and the main memory subsystem. Memory operations may be the result of an instruction which utilizes an operand stored in memory, or may be the result of a load/store instruction which causes the data transfer but no other operation. Additionally, load/store unit 26 may include a special register storage for special registers such as the segment registers and other registers related to the address translation mechanism defined by the x86 microprocessor architecture. - In one embodiment, load/
store unit 26 is configured to perform load memory operations speculatively. Store memory operations may be performed in program order, but may be speculatively stored into the predicted way. If the predicted way is incorrect, the data prior to the store memory operation is subsequently restored to the predicted way and the store memory operation is performed to the correct way. In another embodiment, stores may be executed speculatively as well. Speculatively executed stores are placed into a store buffer, along with a copy of the cache line prior to the update. If the speculatively executed store is later discarded due to branch misprediction or exception, the cache line may be restored to the value stored in the buffer. It is noted that load/store unit 26 may be configured to perform any amount of speculative execution, including no speculative execution. -
Data cache 28 is a high speed cache memory provided to temporarily store data being transferred between load/store unit 26 and the main memory subsystem. In one embodiment,data cache 28 has a capacity of storing up to sixteen kilobytes of data in an eight-way set-associative structure. Similar toinstruction cache 16,data cache 28 may employ a way prediction mechanism. It is understood thatdata cache 28 may be implemented in a variety of specific memory configurations, including set-associative and direct-mapped configurations. - In one particular embodiment of
microprocessor 10 employing the x86 microprocessor architecture,instruction cache 16 anddata cache 28 are linearly addressed. The linear address is formed from the offset specified by the instruction and the base address specified by the segment portion of the x86 address translation mechanism. Linear addresses may optionally be translated to physical addresses for accessing a main memory. The linear to physical translation is specified by the paging portion of the x86 address translation mechanism. It is noted that a linear addressed cache stores linear address tags. A set of physical tags (not shown) may be employed for mapping the linear addresses to physical addresses and for detecting translation aliases. Additionally, the physical tag block may perform linear to physical address translation. - Turning now to FIG. 4, one method for predecoding variable-length instructions into fixed length instructions is shown.
Sample code 60 represents a plurality of variable-length instructions, in this case x86 instructions. While this method may be used with a number of different types of variable-length instructions (e.g., 68000 instructions), x86 instructions are chosen for illustration purposes. In this embodiment,predecode unit 12 is configured to receive each variable-length instruction and then pad each field within the variable-length instruction to a predetermined maximum field width. While any predetermined constant may be used, e.g., 9016, the examples herein use 0016 as the padding constant. - The prefix bytes are expanded to five bytes. The first byte may be reserved for segment override information and may comprise one of the following: 0016 representing no segment override, 2616 representing the ES segment, 2E16 representing the CS segment, 3616 representing the SS segment, 3E16 representing the DS segment, 6416 representing the FS segment, or 6516 representing the GS segment. The second byte may be reserved for repeat information and may comprise one of the following: 0016 representing no repeat information, F216 representing the REPNE/REPNZ operation, or F316 representing the REP/REPE/REPZ operation. The third byte may be reserved for hardware lock information for memory operations in multiprocessor environments and may comprise one of the following: 0016 representing no lock information, or F016 representing an asserted hardware lock. The fourth byte may be reserved for operand size information and may comprise one of the following: 0016 representing no change in operand size, or 6616 for toggling the word size. Similarly, the fifth byte may be reserved for address size information and may comprise one of the following: 0016 representing no change in address size, or 6716 for toggling between 16 and 32-bit addressing. Note the above nomenclature matches the existing x86 nomenclature, but other constants for each function may be selected in other embodiments.
- As previously noted, one major difficulty in decoding variable-length instructions is determining where each instruction begins and ends. By predecoding instructions to a fixed-length, each instruction is automatically aligned when it is read from
instruction cache 16. Advantageously,instruction alignment unit 18 anddecoders 20A-C may be simplified. In some embodiments, one ormore decode units 20A-20C may be optimized to receive fixed-length instructions, thereby further improving decode speed. In other embodiments, one ormore decoder units 20A-20C may be bypassed completely for fixed-length instructions. - A second difficulty in decoding variable-length instructions is determining which instruction and operand fields are present and where those instruction fields begin and end. By predecoding instructions to the format illustrated, determining which fields are present in each instruction and which, if any, operands are required, may be simplified.
- Turning now to FIG. 5, another embodiment of this method is illustrated. In this embodiment, the five
prefix bytes 102 from the previous embodiment's fixed-length instruction format 60 are compressed into asingle prefix byte 130. This results in a fixed length of thirteen bytes for each fixed-length instruction. Advantageously, using this format the benefits of a fixed-length format may be preserved while reducing the amount of storage required for each fixed-length instruction. - Turning now to FIG. 6A, details of one embodiment of prefix compression are shown. In this embodiment,
prefix byte 122 comprises a 3-bitsegment override field 140, a 2-bit repeat field 142, asingle lock bit 144, a singleoperand size bit 146, and a singleaddress size bit 148. Segment override information may be encoded into three bits ofprefix byte 122 as follows. A prefix byte of 2616, which indicates that the contents of the ES register are to be used to define the segment, may be replaced by thebit sequence 0012. Similarly, a prefix byte of 2E16 (ES register) may be replaced by the bit sequence 0102. A prefix byte of 3616 (ES register) may be replaced by 0112. A prefix byte of 3E16 (DS register) may be replaced by 1002. A prefix byte of 6416 (FS register) may be replaced by 1012. A prefix byte of 6516 (GS register) may be replaced by 1102. If there is no segment override, 0002 may be used insegment override field 140. - The prefix repeat information may be encoded into a 2-
bit repeat field 142 ofprefix byte 122 as follows. A prefix byte of F2 (REPNE/REPNZ) may be replaced with thebit sequence 012. Similarly, a prefix byte of F3 (REP/REPE/REPZ) may be replaced by thebit sequence 102. If there is no repeat information, 002 may be used inrepeat field 142. If a lock instruction F016 is present, this information may be encoded into asingle lock bit 144. Similarly, if a toggle operand size byte 6616 is present, this information may be encoded into asingle bit 146. The presence of a toggle address size byte 6716 may be encoded intobit 148. Thus, all five bytes of prefix information may be compressed into asingle prefix byte 122. Advantageously, using this method saves space withininstruction cache 16 while still providing clearly defined fields that do not vary from one instruction to the next. - Turning to FIG. 6B, another embodiment of prefix compression is illustrated. In this embodiment,
segment override field 140,operand size field 146, and addresssize field 148 may be encoded as described above. Twobyte instruction field 160 is a single bit that indicates whether the corresponding instruction has a two-byte opcode (e.g., an x86 opcode beginning with 0F). Lock/repeat field 162 is two bits wide and combines the functionality offields repeat field 162 may be encoded as follows: 00 indicating no lock or repeat prefix present, 01 indicating a lock prefix is present, 10 indicating a REP, REPE, or REPZ (F3H) prefix is present, and 11 indicating that a REPNE/REPNZ (F2H) prefix is present. This embodiment may advantageously reduced both prefix length variation and opcode length variation. - Turning now to FIG. 7, details of one embodiment of
instruction cache 16 are shown. In this embodiment,instruction cache 16 comprises a lookup table 90 and aninstruction storage array 92. Lookup table 90 comprises a plurality of storage locations configured to store pointers to storage locations withininstruction storage array 92.Instruction storage array 92 comprises a plurality of instruction storage locations each configured to store a fixed-length instruction received from prefetch/predecode unit 12. - Upon receiving a predecoded fixed-length instruction for
predecode unit 12,instruction cache 16 stores the instruction in a particular storage location withininstruction storage array 92.Instruction cache 16 stores a pointer to that particular storage location inpointer array 90.Pointer array 90 may be configured similarly to standard instruction caches, except smaller. For example,pointer array 90 may be configured as a set-associative cache with way prediction as previously disclosed.Instruction storage array 92 may be configured as direct mapped, or may also be configured in a set-associative structure. - An example of the operation of this embodiment of
instruction cache 16 is now illustrated. When an instruction is received from predecode unit 12 (e.g., 008B 00D8 00 00 00 00 00 00 00 00 00),instruction cache 16 is configured to store this instruction into the next available storage location withininstruction storage array 92. Using the example configured from the figure, the instruction is stored into an instruction storage location having anindex 0716. Thus,instruction cache 16 stores theindex value 0716 intopointer array 90. The particular storage location withinpointer array 90 is selected just as a cache line storage location would be selected in a standard instruction cache. For example, assuming the first byte of instruction 8BD8 was located at logical address 0A8D:0100, thepointer 0716 may be stored in the location withinpointer array 90 that corresponds to logical address 0A8D:0100. As previously noted, in otherembodiments pointer array 90 may be linearly addressed. - Upon receiving a request for the instruction residing as logical address 0A8D:0100,
instruction cache 16 may accesspointer array 90 and read the pointer that corresponds to the requested address, i.e., 0716. This pointer is then used access a storage location withininstruction storage array 92. The instruction stored therein (i.e., 008B 00D8 00 00 00 00 00 00 00 00) is then read and output toinstruction alignment unit 18. - Turning now to FIG. 8, another embodiment of
instruction cache 16 is shown. In this embodiment,instruction cache 16 is configured to store both variable and fixed-length versions of instructions.Instruction cache 16 comprisespointer array 90, fixed-lengthinstruction storage array 92, and a variable-lengthinstruction storage array 150.Storage array 150 is configured to store variable-length instructions for use when receiving a requested address generated by a branch instruction that is taken. In contrast, fixed-lengthinstruction storage array 92 stores fixed-length instructions which are accessed by requested addresses from non-branch instructions and branch instructions that are not taken. Because predecoding involves padding fields within each variable length instruction, branch targets may become skewed as a result of the padding. By storing both variable and fixed-length formats, this configuration may advantageously allow fast decoding of fixed-length instruction, while effectively compensating for the expansion of and shifting of instructions due to padding. This configuration may be particularly useful if the program contains branch or jump instructions that have a destination in the middle of an instruction. This is because such instructions may be detected and properly executed from variable-lengthinstruction storage array 90. Instruction cache may further comprise a multiplexer (not shown) to select between the output from fixed-lengthinstruction storage array 92 and variable-lengthinstruction storage array 150. - In this embodiment,
microprocessor 10 may be configured with two sets ofdecoders 20A-C, one set for decoding variable-length instructions and one set for decoding fixed-length instructions. Alternatively, a single set ofdecoders 20A-C may be used, wherein the decoders are allowed more clock cycles to perform variable-length decoding. In another embodiment, one or more decoders may be optimized to handle fixed-length instructions, while the remaining decoders may be optimized to handle variable-length instructions. - As the figure illustrates, each instruction may be stored in two different forms. Non-branch instructions are requested serially and therefore the shifting caused by predecoding and padding the instructions is not a problem. However, after a branch instruction,
instruction cache 16 will receive a requested address that may have no correlation to the address at which the branch instruction was stored. Thus, variable-lengthinstruction storage array 150 provides a mechanism for fetching the proper instruction after such instructions. - Turning now to FIG. 9, another method for predecoding variable length instructions into fixed-length instruction is shown. In this embodiment,
predecode unit 12 expands variable length instructions to one of three lengths: 5 bytes, 6 bytes, or 13 bytes.Predecode unit 12 may assign an instruction to a particular group based upon whether a particular field is present within the instruction. For example, if an instruction being predecoded does not have displacement or immediate data information, then the instruction is padded to a fixed length of five bytes and is stored as part ofgroup 160. If the instruction has data bytes but does not have displacement information, then the instruction is padded to a fixed length of nine bytes and is stored ingroup 142. If the instruction has both displacement bytes and data bytes, then the instruction is padded to the full thirteen bytes and is stored ingroup 144. As in previous embodiments, the prefix bytes may be compressed into a single byte. Advantageously, this method speeds decode while reducing the resources necessary to store fixed-length instructions withininstruction cache 16. - Note that other group configurations and sizes based upon other fields are possible and contemplated. For example, an instruction that does not have any prefix, displacement, or data bytes may be padded to a length of four bytes. In another configuration,
predecode unit 12 may be configured to pad and group instructions in two or four byte increments, resulting in four or eight groups of instructions. Further note that other methods may be used to pad instructions to a predetermined length. For example, in oneembodiment predecoder 12 may be configured to pad constants after the final byte of the variable-length instruction. While this method may not identify each field within the instruction, it may allow for faster predecoding while still reducing decoding (particularly alignment) times. - Turning now to FIG. 10, an embodiment of
instruction cache 16 that is configured to pad and store instructions into groups is shown. In this embodiment,pointer array 90 is configured to store pointers which point to storage locations within fixed-lengthinstruction storage arrays 92A-C. Each fixed-lengthinstruction storage array 92A-C (also referred to as sub-arrays) is configured to store one particular length of fixed-length instructions. Sub-array 92C may be configured to store fixed-length instructions that are 13 bytes in length (e.g., instructions having displacement data).Sub-array 92B may be configured to store fixed-length instructions that are 9 bytes in length (e.g., instruction without displacement data). Similarly, sub-array 92A may be configured to store fixed-length instructions that are only five bytes in length (e.g., instructions having no displacement bytes or data bytes).Pointer array 90 may be configured as in previous embodiments, with each storage location storing a pointer that points to one storage location within either sub-array 92A, sub-array 92B, or sub-array 92C. - Other embodiments are also contemplated. For example, in one embodiment variable-length
instruction storage array 150,pointer array 90, and fixed-lengthinstruction storage arrays 92A-C may all be incorporated intoinstruction cache 16. In another embodiment, there may be more than one storage array having the same length of instructions. For example, the embodiment illustrated above may comprise two fixed-length instruction storage arrays storing 9-byte long instructions. The first array may be configured to store instructions not having displacement data, whereas the second array may be configured to store instructions not having immediate data. - A software compiler configured to compile variable length instructions into fixed-length instructions is also contemplated. The variable-length to fixed length conversion may take place as part of the compiling of high-level language instructions to object code (e.g., x86 instructions), or the conversion may be performed as an optimization step during or after object code has been generated. The same methods illustrated above may be used. However, the compiler may optionally be configured to expand only certain speed-critical portions of code. Advantageously, this may improve the speed of decode for speed-critical sections of code while reducing the amount of code expansion that takes place. The compiler may be configured to indicate the start and end of fixed-length instruction sections by inserting special opcodes or special status bits. The compiler may also be configured to pad the variable-length instructions using selected constants, e.g., no operation instruction codes (NOPs).
- Turning now to FIG. 11, a block diagram of one embodiment of a
computer system 200 utilizingmicroprocessor 10 is shown. Other embodiments are possible and contemplated. In the depicted system, amain memory 204 is coupled to bus bridge 202 through amemory bus 206, and agraphics controller 208 is coupled to bus bridge 202 through anAGP bus 210. Finally, a plurality ofPCI devices 212A-212B are coupled to bus bridge 202 through a PCI bus 214. A secondary bus bridge 216 may further be provided to accommodate an electrical interface to one or more EISA orISA devices 218 through an EISA/ISA bus 220.Microprocessor 10 is coupled to bus bridge 202 through aCPU bus 224. - Bus bridge202 provides an interface between
microprocessor 10,main memory 204,graphics controller 208, and devices attached to PCI bus 214. When an operation is received from one of the devices connected to bus bridge 202, bus bridge 202 identifies the target of the operation (e.g. a particular device or, in the case of PCI bus 214, that the target is on PCI bus 214). Bus bridge 202 routes the operation to the targeted device. Bus bridge 202 generally translates an operation from the protocol used by the source device or bus to the protocol used by the target device or bus. - In addition to providing an interface to an ISA/EISA bus for PCI bus214, secondary bus bridge 216 may further incorporate additional functionality, as desired. For example, in one embodiment, secondary bus bridge 216 includes a master PCI arbiter (not shown) for arbitrating ownership of PCI bus 214. An input/output controller (not shown), either external from or integrated with secondary bus bridge 216, may also be included within
computer system 200 to provide operational support for a keyboard and mouse 222 and for various serial and parallel ports, as desired. An external cache unit (not shown) may further be coupled toCPU bus 224 betweenmicroprocessor 10 and bus bridge 202 in other embodiments. Alternatively, the external cache may be coupled to bus bridge 202 and cache control logic for the external cache may be integrated into bus bridge 202. -
Main memory 204 is a memory in which application programs are stored and from whichmicroprocessor 10 primarily executes. A suitablemain memory 204 comprises DRAM (Dynamic Random Access Memory), and preferably a plurality of banks of SDRAM (Synchronous DRAM). -
PCI devices 212A-212B are illustrative of a variety of peripheral devices such as, for example, network interface cards, video accelerators, audio cards, hard or floppy disk drives or drive controllers, SCSI (Small Computer Systems Interface) adapters and telephony cards. Similarly,ISA device 218 is illustrative of various types of peripheral devices, such as a modem, a sound card, and a variety of data acquisition cards such as GPIB or field bus interface cards. -
Graphics controller 208 is provided to control the rendering of text and images on adisplay 226.Graphics controller 208 may embody a typical graphics accelerator generally known in the art to render three-dimensional data structures which can be effectively shifted into and frommain memory 204.Graphics controller 208 may therefore be a master ofAGP bus 210 in that it can request and receive access to a target interface within bus bridge 202 to thereby obtain access tomain memory 204. A dedicated graphics bus accommodates rapid retrieval of data frommain memory 204. For certain operations,graphics controller 208 may further be configured to generate PCI protocol transactions onAGP bus 210. The AGP interface of bus bridge 202 may thus include functionality to support both AGP protocol transactions as well as PCI protocol target and initiator transactions.Display 226 is any electronic display upon which an image or text can be presented. Asuitable display 226 includes a cathode ray tube (“CRT”), a liquid crystal display (“LCD”), etc. - It is noted that, while the AGP, PCI, and ISA or EISA buses have been used as examples in the above description, any bus architectures may be substituted as desired. It is further noted that
computer system 200 may be a multiprocessing computer system including additional microprocessors. - It is still further noted that the present discussion may refer to the assertion of various signals. As used herein, a signal is “asserted” if it conveys a value indicative of a particular condition. Conversely, a signal is “deasserted” or “not asserted” if it conveys a value indicative of a lack of a particular condition. A signal may be defined to be asserted when it conveys a logical zero value or, conversely, when it conveys a logical one value. Additionally, various values have been described as being discarded in the above discussion. A value may be discarded in a number of manners, but generally involves modifying the value such that it is ignored by logic circuitry which receives the value. For example, if the value comprises a bit, the logic state of the value may be inverted to discard the value. If the value is an n-bit value, one of the n-bit encodings may indicate that the value is invalid. Setting the value to the invalid encoding causes the value to be discarded. Additionally, an n-bit value may include a valid bit indicative, when set, that the n-bit value is valid. Resetting the valid bit may comprise discarding the value. Other methods of discarding a value may be used as well.
- Numerous variations and modifications will become apparent to those skilled in the art once the above disclosure is fully appreciated. It is intended that the following claims be interpreted to embrace all such variations and modifications.
Claims (20)
1. A microprocessor comprising:
a predecode unit configured to receive variable length instructions, wherein a subset of said variable length instructions comprise a plurality of prefix bytes, wherein said predecode unit is configured to detect said prefix bytes and compress said prefix bytes into a single compressed prefix byte for each instruction;
an instruction cache coupled to said predecode unit, wherein said instruction cache is configured to receive said instructions and said compressed prefix bytes from said predecode unit, wherein said instruction cache is configured to store said instructions and said compressed prefix bytes, and wherein said instruction cache is configured to output a one of said instructions and one of said corresponding compressed prefix bytes in response to receiving a fetch address.
2. The microprocessor as recited in , wherein said variable length instructions are x86 instructions, and wherein said compressed predecode byte comprises:
claim 1
three bits indicative of said corresponding instruction's segment prefix,
a single bit indicative of an operand size override,
a single bit indicative of an address override,
two bits indicative of a repeat prefix, and
one bit indicative of a lock prefix.
3. The microprocessor as recited in , wherein said variable length instructions are x86 instructions, and wherein said compressed predecode byte comprises:
claim 1
three bits indicative of said corresponding instruction's segment prefix,
a single bit indicative of an operand size override,
a single bit indicative of an address override,
two bits indicative of repeat and lock prefixes, and
one bit indicative of a two byte long opcode.
4. The microprocessor as recited in , wherein said predecode unit is configured to generate one or more predecode bits for each instruction byte, wherein said predecode unit is configured to incorporate said predecode bits into said compressed prefix byte.
claim 3
5. The microprocessor as recited in , wherein said compressed predecode byte further comprises a single bit indicative of the starting byte of the instruction.
claim 4
6. A method for executing variable length instructions comprising:
reading a plurality of instruction bytes from a memory subsystem;
predecoding the instruction bytes by:
detecting a starting byte for an instruction,
detecting an ending bytes for the instruction,
detecting any prefix bytes corresponding to the instruction, and
compressing the prefix bytes into a single compressed prefix byte; and
storing the instruction and the single compressed prefix byte into an instruction cache.
7. The method as recited in , wherein said compressing comprises:
claim 6
encoding operand size prefix bytes into a single operand size bit within the single compressed prefix byte;
encoding address size prefix bytes into a single address size bit within the single compressed prefix byte; and
encoding segment override prefix bytes into a three-bit field within the single compressed prefix byte.
8. The method as recited in , wherein said compressing further comprises:
claim 7
encoding repeat and lock prefix bytes into a two-bit field within the single compressed prefix byte.
9. The method as recited in , wherein said compressing further comprises:
claim 7
encoding repeat prefix bytes into a two-bit field within the single compressed prefix byte, and
encoding lock information into a single lock bit within the single compressed prefix byte.
10. A software program embodied on computer-readable media comprising:
a first plurality of instructions configured to detect the boundaries of variable-length instructions;
a second plurality of instructions configured to detect prefix bytes associated with each variable-length instruction; and
a third plurality of instructions configured to compress said prefix bytes into single compressed prefix bytes.
11. The software program as recited in , wherein said software program is an optimizing compiler configured to output said variable-length instructions and said compressed prefix bytes.
claim 10
12. The software program as recited in , wherein said software program is a dynamically linked library configured to receive said variable-length instructions as input and generate optimized instructions and compressed prefix bytes for output.
claim 10
13. The software program as recited in , wherein said single compressed prefix bytes each comprise:
claim 12
three bits indicative of said corresponding instruction's segment prefix,
a single bit indicative of an operand size override,
a single bit indicative of an address override,
two bits indicative of a repeat prefix, and
one bit indicative of a lock prefix.
14. The software program as recited in , wherein said single compressed prefix bytes each comprise:
claim 12
three bits indicative of said corresponding instruction's segment prefix,
a single bit indicative of an operand size override,
a single bit indicative of an address override,
two bits indicative of repeat and lock prefixes, and
one bit indicative of a two byte long opcode.
15. The software program as recited in , wherein said software program comprises a fourth plurality of instructions configured to pad said variable-length instructions to one of a predetermined number of lengths with predetermined constants.
claim 14
16. The software program as recited in , wherein said software program comprises a fourth plurality of instructions configured to pad said variable-length instructions to a predetermined length with predetermined constants.
claim 14
17. The software program as recited in , wherein said software program comprises a fifth plurality of instructions configured to remap branch target and destination maps to reflect the address adjustment created by prefix byte compression and instruction padding.
claim 16
18. A computer system comprising:
a first microprocessor coupled to a CPU bus, wherein said first microprocessor comprises:
a predecode unit configured to receive variable length instructions, wherein a subset of said variable length instructions comprise a plurality of prefix bytes, wherein said predecode unit is configured to detect said prefix bytes and compress said prefix bytes into a single compressed prefix byte for each instruction;
an instruction cache coupled to said predecode unit, wherein said instruction cache is configured to receive said instructions and said compressed prefix bytes from said predecode unit, wherein said instruction cache is configured to store said instructions and said compressed prefix bytes, and wherein said instruction cache is configured to output a one of said instructions and one of said corresponding compressed prefix bytes in response to receiving a fetch address; and
a modem coupled to said CPU bus via a bus bridge.
19. The computer system as recited in , wherein said single compressed prefix byte comprises:
claim 18
three bits indicative of said corresponding instruction's segment prefix,
a single bit indicative of an operand size override,
a single bit indicative of an address override,
two bits indicative of repeat and lock prefixes, and
one bit indicative of a two byte long opcode.
20. The computer system as recited in , further comprising:
claim 19
a second microprocessor coupled to said first microprocessor via said CPU bus.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US09/158,440 US6275927B2 (en) | 1998-09-21 | 1998-09-21 | Compressing variable-length instruction prefix bytes |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US09/158,440 US6275927B2 (en) | 1998-09-21 | 1998-09-21 | Compressing variable-length instruction prefix bytes |
Publications (2)
Publication Number | Publication Date |
---|---|
US20010002483A1 true US20010002483A1 (en) | 2001-05-31 |
US6275927B2 US6275927B2 (en) | 2001-08-14 |
Family
ID=22568132
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US09/158,440 Expired - Fee Related US6275927B2 (en) | 1998-09-21 | 1998-09-21 | Compressing variable-length instruction prefix bytes |
Country Status (1)
Country | Link |
---|---|
US (1) | US6275927B2 (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060218170A1 (en) * | 2005-03-24 | 2006-09-28 | Microsoft Corporation | Method and apparatus for compressing a data set |
US20100042812A1 (en) * | 2008-08-14 | 2010-02-18 | International Business Machines Corporation | Data Dependent Instruction Decode |
US20120060011A1 (en) * | 2010-09-03 | 2012-03-08 | International Business Machines Corporation | Allocating register halves independently |
US20120066478A1 (en) * | 2010-09-09 | 2012-03-15 | Cohen Robert B | Method for fast parallel instruction length determination |
GB2486905A (en) * | 2010-12-30 | 2012-07-04 | Cambridge Silicon Radio Ltd | Amalgamating instructions by replacing unencoded space |
US11237974B2 (en) * | 2019-08-27 | 2022-02-01 | Arm Limited | Operation cache compression |
CN117093271A (en) * | 2023-09-06 | 2023-11-21 | 上海耀芯电子科技有限公司 | Branch instruction prefetching method and device |
Families Citing this family (23)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3790607B2 (en) * | 1997-06-16 | 2006-06-28 | 松下電器産業株式会社 | VLIW processor |
US6418527B1 (en) * | 1998-10-13 | 2002-07-09 | Motorola, Inc. | Data processor instruction system for grouping instructions with or without a common prefix and data processing system that uses two or more instruction grouping methods |
US6401144B1 (en) * | 1999-02-26 | 2002-06-04 | Intel Corporation | Method and apparatus for managing data transfers between peripheral devices by encoding a start code in a line of data to initiate the data transfers |
US6687806B1 (en) * | 2000-06-15 | 2004-02-03 | Advanced Micro Devices, Inc. | Apparatus and method for generating 64 bit displacement and immediate values |
US7028286B2 (en) * | 2001-04-13 | 2006-04-11 | Pts Corporation | Methods and apparatus for automated generation of abbreviated instruction set and configurable processor architecture |
EP1367485B1 (en) * | 2002-05-31 | 2012-10-31 | STMicroelectronics Limited | Pipelined processing |
US6968430B1 (en) * | 2002-10-22 | 2005-11-22 | Lsi Logic Corporation | Circuit and method for improving instruction fetch time from a cache memory device |
US7103757B1 (en) | 2002-10-22 | 2006-09-05 | Lsi Logic Corporation | System, circuit, and method for adjusting the prefetch instruction rate of a prefetch unit |
US7782853B2 (en) * | 2002-12-06 | 2010-08-24 | Stmicroelectronics, Inc. | Apparatus and method of using fully configurable memory, multi-stage pipeline logic and an embedded processor to implement multi-bit trie algorithmic network search engine |
US7162481B2 (en) * | 2002-12-06 | 2007-01-09 | Stmicroelectronics, Inc. | Method for increasing storage capacity in a multi-bit trie-based hardware storage engine by compressing the representation of single-length prefixes |
US7389408B1 (en) * | 2003-08-05 | 2008-06-17 | Sun Microsystems, Inc. | Microarchitecture for compact storage of embedded constants |
US7702882B2 (en) * | 2003-09-10 | 2010-04-20 | Samsung Electronics Co., Ltd. | Apparatus and method for performing high-speed lookups in a routing table |
US7827355B1 (en) * | 2004-07-08 | 2010-11-02 | Globalfoundries Inc. | Data processor having a cache with efficient storage of predecode information, cache, and method |
US7421568B2 (en) * | 2005-03-04 | 2008-09-02 | Qualcomm Incorporated | Power saving methods and apparatus to selectively enable cache bits based on known processor state |
US7840786B2 (en) * | 2007-04-16 | 2010-11-23 | Advanced Micro Devices, Inc. | Techniques for storing instructions and related information in a memory hierarchy |
US7836278B2 (en) * | 2007-07-25 | 2010-11-16 | Advanced Micro Devices, Inc. | Three operand instruction extension for X86 architecture |
US8255398B2 (en) * | 2008-09-30 | 2012-08-28 | International Business Machines Corporation | Compression of sorted value indexes using common prefixes |
US9483271B2 (en) | 2013-12-31 | 2016-11-01 | International Business Machines Corporation | Compressed indirect prediction caches |
US9870305B2 (en) | 2015-09-30 | 2018-01-16 | International Business Machines Corporation | Debugging of prefixed code |
US10761852B2 (en) | 2015-09-30 | 2020-09-01 | International Business Machines Corporation | Extending data range addressing |
US10877759B2 (en) | 2015-09-30 | 2020-12-29 | International Business Machines Corporation | Managing the capture of information in applications with prefix instructions |
US10394568B2 (en) * | 2015-09-30 | 2019-08-27 | International Business Machines Corporation | Exception handling for applications with prefix instructions |
CN111209044B (en) * | 2018-11-21 | 2022-11-25 | 展讯通信(上海)有限公司 | Instruction compression method and device |
Family Cites Families (24)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5057837A (en) | 1987-04-20 | 1991-10-15 | Digital Equipment Corporation | Instruction storage method with a compressed format using a mask word |
US5438668A (en) * | 1992-03-31 | 1995-08-01 | Seiko Epson Corporation | System and method for extraction, alignment and decoding of CISC instructions into a nano-instruction bucket for execution by a RISC computer |
US5586277A (en) | 1994-03-01 | 1996-12-17 | Intel Corporation | Method for parallel steering of fixed length fields containing a variable length instruction from an instruction buffer to parallel decoders |
US5644755A (en) | 1995-02-24 | 1997-07-01 | Compaq Computer Corporation | Processor with virtual system mode |
US5991869A (en) | 1995-04-12 | 1999-11-23 | Advanced Micro Devices, Inc. | Superscalar microprocessor including a high speed instruction alignment unit |
US5758114A (en) * | 1995-04-12 | 1998-05-26 | Advanced Micro Devices, Inc. | High speed instruction alignment unit for aligning variable byte-length instructions according to predecode information in a superscalar microprocessor |
US5933642A (en) | 1995-04-17 | 1999-08-03 | Ricoh Corporation | Compiling system and method for reconfigurable computing |
US5822778A (en) | 1995-06-07 | 1998-10-13 | Advanced Micro Devices, Inc. | Microprocessor and method of using a segment override prefix instruction field to expand the register file |
US5809273A (en) * | 1996-01-26 | 1998-09-15 | Advanced Micro Devices, Inc. | Instruction predecode and multiple instruction decode |
JP2806359B2 (en) | 1996-04-30 | 1998-09-30 | 日本電気株式会社 | Instruction processing method and instruction processing device |
US5896519A (en) | 1996-06-10 | 1999-04-20 | Lsi Logic Corporation | Apparatus for detecting instructions from a variable-length compressed instruction set having extended and non-extended instructions |
US5905893A (en) | 1996-06-10 | 1999-05-18 | Lsi Logic Corporation | Microprocessor adapted for executing both a non-compressed fixed length instruction set and a compressed variable length instruction set |
US6049863A (en) * | 1996-07-24 | 2000-04-11 | Advanced Micro Devices, Inc. | Predecoding technique for indicating locations of opcode bytes in variable byte-length instructions within a superscalar microprocessor |
US6038645A (en) | 1996-08-28 | 2000-03-14 | Texas Instruments Incorporated | Microprocessor circuits, systems, and methods using a combined writeback queue and victim cache |
US5774710A (en) | 1996-09-19 | 1998-06-30 | Advanced Micro Devices, Inc. | Cache line branch prediction scheme that shares among sets of a set associative cache |
US5978906A (en) | 1996-11-19 | 1999-11-02 | Advanced Micro Devices, Inc. | Branch selectors associated with byte ranges within an instruction cache for rapidly identifying branch predictions |
US5958046A (en) | 1996-11-26 | 1999-09-28 | Texas Instruments Incorporated | Microprocessor with reduced microcode space requirements due to improved branch target microaddress circuits, systems, and methods |
US5925124A (en) * | 1997-02-27 | 1999-07-20 | International Business Machines Corporation | Dynamic conversion between different instruction codes by recombination of instruction elements |
TW357318B (en) | 1997-03-18 | 1999-05-01 | Ind Tech Res Inst | Branching forecast and reading device for unspecified command length extra-purity pipeline processor |
US6012125A (en) | 1997-06-20 | 2000-01-04 | Advanced Micro Devices, Inc. | Superscalar microprocessor including a decoded instruction cache configured to receive partially decoded instructions |
US6016545A (en) | 1997-12-16 | 2000-01-18 | Advanced Micro Devices, Inc. | Reduced size storage apparatus for storing cache-line-related data in a high frequency microprocessor |
US5951671A (en) * | 1997-12-18 | 1999-09-14 | Advanced Micro Devices, Inc. | Sharing instruction predecode information in a multiprocessor system |
US6014735A (en) | 1998-03-31 | 2000-01-11 | Intel Corporation | Instruction set extension using prefixes |
US6061786A (en) | 1998-04-23 | 2000-05-09 | Advanced Micro Devices, Inc. | Processor configured to select a next fetch address by partially decoding a byte of a control transfer instruction |
-
1998
- 1998-09-21 US US09/158,440 patent/US6275927B2/en not_active Expired - Fee Related
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060218170A1 (en) * | 2005-03-24 | 2006-09-28 | Microsoft Corporation | Method and apparatus for compressing a data set |
US7653643B2 (en) * | 2005-03-24 | 2010-01-26 | Microsoft Corporation | Method and apparatus for compressing a data set |
US20100042812A1 (en) * | 2008-08-14 | 2010-02-18 | International Business Machines Corporation | Data Dependent Instruction Decode |
US8028153B2 (en) * | 2008-08-14 | 2011-09-27 | International Business Machines Corporation | Data dependent instruction decode |
US20120060011A1 (en) * | 2010-09-03 | 2012-03-08 | International Business Machines Corporation | Allocating register halves independently |
US9696975B2 (en) * | 2010-09-03 | 2017-07-04 | International Business Machines Corporation | Allocating register halves independently |
US20120066478A1 (en) * | 2010-09-09 | 2012-03-15 | Cohen Robert B | Method for fast parallel instruction length determination |
GB2486905A (en) * | 2010-12-30 | 2012-07-04 | Cambridge Silicon Radio Ltd | Amalgamating instructions by replacing unencoded space |
US9223576B2 (en) | 2010-12-30 | 2015-12-29 | Qualcomm Technologies International, Ltd. | Reducing a set of instructions for execution on a processor and expanding a set of instructions on a processor |
US11237974B2 (en) * | 2019-08-27 | 2022-02-01 | Arm Limited | Operation cache compression |
CN117093271A (en) * | 2023-09-06 | 2023-11-21 | 上海耀芯电子科技有限公司 | Branch instruction prefetching method and device |
Also Published As
Publication number | Publication date |
---|---|
US6275927B2 (en) | 2001-08-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6275927B2 (en) | Compressing variable-length instruction prefix bytes | |
US6081884A (en) | Embedding two different instruction sets within a single long instruction word using predecode bits | |
US6041405A (en) | Instruction length prediction using an instruction length pattern detector | |
US6339822B1 (en) | Using padded instructions in a block-oriented cache | |
US6185675B1 (en) | Basic block oriented trace cache utilizing a basic block sequence buffer to indicate program order of cached basic blocks | |
US6125441A (en) | Predicting a sequence of variable instruction lengths from previously identified length pattern indexed by an instruction fetch address | |
KR100586058B1 (en) | Register renaming in which moves are accomplished by swapping rename tags | |
US6279106B1 (en) | Method for reducing branch target storage by calculating direct branch targets on the fly | |
US6349365B1 (en) | User-prioritized cache replacement | |
US6253287B1 (en) | Using three-dimensional storage to make variable-length instructions appear uniform in two dimensions | |
US6092182A (en) | Using ECC/parity bits to store predecode information | |
US6260134B1 (en) | Fixed shift amount variable length instruction stream pre-decoding for start byte determination based on prefix indicating length vector presuming potential start byte | |
US6684323B2 (en) | Virtual condition codes | |
US6240506B1 (en) | Expanding instructions with variable-length operands to a fixed length | |
US6460116B1 (en) | Using separate caches for variable and generated fixed-length instructions | |
WO2007019001A1 (en) | Call return stack way prediction repair | |
US6453387B1 (en) | Fully associative translation lookaside buffer (TLB) including a least recently used (LRU) stack and implementing an LRU replacement strategy | |
JP2003515214A (en) | Method and apparatus for performing calculations with narrow operands | |
US6212621B1 (en) | Method and system using tagged instructions to allow out-of-program-order instruction decoding | |
US6460132B1 (en) | Massively parallel instruction predecoding | |
KR100603067B1 (en) | Branch prediction with return selection bits to categorize type of branch prediction | |
US5987235A (en) | Method and apparatus for predecoding variable byte length instructions for fast scanning of instructions | |
US6405303B1 (en) | Massively parallel decoding and execution of variable-length instructions | |
US6539470B1 (en) | Instruction decode unit producing instruction operand information in the order in which the operands are identified, and systems including same | |
US5951671A (en) | Sharing instruction predecode information in a multiprocessor system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
AS | Assignment |
Owner name: ADVANCED MICRO DEVICES, INC., CALIFORNIA Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:ROBERTS, JAMES S.;REEL/FRAME:009483/0741 Effective date: 19980917 |
|
FPAY | Fee payment |
Year of fee payment: 4 |
|
REMI | Maintenance fee reminder mailed | ||
LAPS | Lapse for failure to pay maintenance fees | ||
STCH | Information on status: patent discontinuation |
Free format text: PATENT EXPIRED DUE TO NONPAYMENT OF MAINTENANCE FEES UNDER 37 CFR 1.362 |
|
FP | Lapsed due to failure to pay maintenance fee |
Effective date: 20090814 |