Patent Publication Number: US-2015082007-A1

Title: Register mapping with multiple instruction sets

Description:
BACKGROUND OF THE INVENTION 
     This application is a continuation of U.S. patent application Ser. No. 13/309,732, filed Dec. 2, 2011, the entire contents of which are hereby incorporated by reference in this application. 
     FIELD OF THE INVENTION 
     This invention relates to the field of data processing systems. More particularly, this invention relates to the field of data processing systems supporting multiple different instruction sets. 
     DESCRIPTION OF THE PRIOR ART 
     It is known to provide data processing systems supporting multiple instruction sets. For example, known processes designed by ARM Limited of Cambridge, England support both the ARM and the Thumb instruction sets. These instruction sets share a register file and share a mapping between register specifiers and registers within that register file. 
     The ARM and Thumb instruction sets referred to above are closely related and accordingly it is possible for the same mapping to be used between register specifiers and architectural registers storing operands. However, it may be desirable to support instruction set architectures with a significant degree of difference between the ways in which architectural registers are addressed by program instructions of those different instruction sets. One way of dealing with this is to provide separate mechanisms for the register addressing to be used by the instructions from the different instruction set. However, this disadvantageously increases the required circuit resources and power consumption. 
     SUMMARY OF THE INVENTION 
     Viewed from one aspect the present invention provides an apparatus for processing data comprising: 
     processing circuitry configured to perform processing operations; 
     an architectural register file having a plurality of architectural registers for storing operand values; 
     first decoder circuitry configured to decode program instructions of a first instruction set to generate control signals for controlling said processing circuitry to perform processing operations; and 
     second decoder circuitry configured to decode program instructions of a second instruction set to generate control signals for controlling said processing circuitry to perform processing operations; wherein 
     program instructions of said first instruction set include first logical register specifiers specifying first logical registers holding operand values, said first logical registers corresponding to architectural registers within said architectural register file and having a plurality of different sizes corresponding to different numbers of words of data up to a maximum number of words of data; 
     program instructions of said second instruction set include second logical register specifiers specifying second logical registers holding operand values, said second logical registers corresponding to architectural registers within said architectural register file and having a plurality of different sizes corresponding to different numbers of words of data up to said maximum number of words of data; 
     said first decoder circuitry is configured to map said first logical specifiers using a first mapping to a common address format; 
     said second decoder circuitry is configured to map said second logical specifiers using a second mapping to said common address format; and 
     said second mapping is divergent from said first mapping such that at least some values used as both a first logical register specifier and a second logical register specifier map to different architectural registers. 
     The present invention recognises that the first decoder&#39;s circuitry and the second decoder&#39;s circuitry used to decode program instructions of respective instruction sets may be configured to map their register specifiers to a common address format despite the divergence between them in which some values used as both first logical register specifiers and second logical register specifiers are mapped to different architectural registers. The resolving of the different mappings into a common address format permits a common (shared) set of subsequent circuitry to be used for the processing of register specifiers using that common address format thereby permitting a reduction in circuit overhead and power consumption. 
     In some embodiments the architectural registers may be addressed as an array of architectural registers arranged as a plurality of banks and a plurality of rows with the common addressed format comprising a bank specifier and a row specifier within the array. In this way, the bank specifier and the row specifier may be viewed as Cartesian coordinates for addressing a particular architectural register within an array of architectural registers. 
     In some embodiments the plurality of banks permit first logical registers and second logical registers having the maximum number of words to be stored within a single row of the array. Storing operands of the maximum size within a single row facilitates the use of single port access to the register file thereby reducing circuit overhead and complexity. 
     The first mapping and the second mapping may take a variety of different forms. In some embodiments one of the first logical registers of the maximum number of words corresponds to a group of architectural register that are all mapped by the first mapping to a plurality of logical registers at each different lower size. Thus, for example, a single quad word register may correspond to two double word registers and four single word registers. 
     Either in combination with the above, or separate therefrom, the second mapping may be such that one of the second logical registers of the maximum number of words corresponds to a group of architectural registers at least one of which is mapped by the second mapping to a single second logical register at each different lower size. Thus, a quad word register corresponds to a single double word register (with some excess space) and a single single word register (with some excess space). 
     Within embodiments utilizing register naming there may be provided a plurality of physical registers configured to store data values to be manipulated and renaming circuitry configured to store register mapping data mapping between a bank specifier value and a row specifier value identifying an architectural register and one of the physical registers to be used in place of the architectural register for speculative execution of a program instruction. Thus, the common register addressing format may be used as an input to common renaming circuitry. 
     In circumstances where a plurality of architectural registers correspond to one of the first logical register or the second logical register, energy may be saved by identifying the plurality of architectural registers using a single architectural register value in the common address format and a size qualifier to indicate how many of the architectural registers are combined with the one specified in the single architectural register value. 
     Viewed from another aspect present invention provides an apparatus for processing data comprising: 
     processing means for performing processing operations; 
     a plurality of architectural register means for storing operand values; 
     first decoder means for decoding program instructions of a first instruction set to generate control signals for controlling said processing means to perform processing operations; and 
     second decoder means for decoding program instructions of a second instruction set to generate control signals for controlling said processing means to perform processing operations; wherein 
     program instructions of said first instruction set include first logical register specifiers specifying first logical register means for holding operand values, said first logical register means corresponding to architectural register means and having a plurality of different sizes corresponding to different numbers of words of data up to a maximum number of words of data; 
     program instructions of said second instruction set include second logical register specifiers specifying second logical register means for holding operand values, said second logical register means corresponding to architectural register means and having a plurality of different sizes corresponding to different numbers of words of data up to said maximum number of words of data; 
     said first decoder means maps said first logical specifiers using a first mapping to a common address format; 
     said second decoder means maps said second logical specifiers using a second mapping to said common address format; and 
     said second mapping is divergent from said first mapping such that at least some values used as both a first logical register specifier and a second logical register specifier map to different architectural register means. 
     Viewed from a further aspect the invention provides a method of processing data comprising the steps of: 
     performing processing operations with processing circuitry; 
     storing operand values in a plurality of architectural registers of an architectural register file; 
     decoding program instructions of a first instruction set to generate control signals for controlling said processing circuitry to perform processing operations; and 
     decoding program instructions of a second instruction set to generate control signals for controlling said processing circuitry to perform processing operations; wherein 
     program instructions of said first instruction set include first logical register specifiers specifying first logical registers holding operand values, said first logical registers corresponding to architectural registers within said architectural register file and having a plurality of different sizes corresponding to different numbers of words of data up to a maximum number of words of data; 
     program instructions of said second instruction set include second logical register specifiers specifying second logical registers holding operand values, said second logical registers corresponding to architectural registers within said architectural register file and having a plurality of different sizes corresponding to different numbers of words of data up to said maximum number of words of data; further comprising the steps of: 
     using a first mapping to map said first logical specifiers to a common address format; and 
     using a second mapping to map said second logical specifiers to said common address format; wherein 
     said second mapping is divergent from said first mapping such that at least some values used as both a first logical register specifier and a second logical register specifier map to different architectural registers. 
     The above, and other objects, features and advantages of this invention will be apparent from the following detailed description of illustrative embodiments which is to be read in connection with the accompanying drawings. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         FIG. 1  schematically illustrates a data processing apparatus including decoding circuitry, renaming circuitry, register circuitry and processing circuitry: 
         FIG. 2  schematically illustrates a first mapping between logical register specifiers and architectural registers and a second mapping between logical register specifiers and architectural registers; 
         FIG. 3  schematically illustrates an architectural register file containing registers of different sizes: 
         FIG. 4  schematically illustrates a common register address format: 
         FIGS. 5A ,  5 B and  5 C schematically illustrate a first register mapping: 
         FIGS. 6A ,  6 B and  6 C schematically illustrate a second register mapping: and 
         FIG. 7  is a flow diagram and schematically illustrating how logical register specifiers may be mapped to a common format using either a first mapping or a second mapping. 
     
    
    
     DESCRIPTION OF THE EMBODIMENTS 
       FIG. 1  schematically illustrates a portion  2  of a data processing apparatus. The data processing apparatus may be a processor core supporting out-of-order program instruction execution. It will be appreciated that such a processor core will typically contain many more circuit elements that are illustrated in  FIG. 1 . These additional circuit elements have been omitted from  FIG. 1  for the sake of clarity. 
     The circuitry of  FIG. 1  includes first decoder circuitry  4  and second decoder circuitry  6  which receive program instruction from a memory (not illustrated) and decode these instruction using respectively a first mapping and a second mapping to produce register specifiers having a common register address format (atag). 
     It will be appreciated that the first decoder circuitry  4  and second decoder circuitry  6  will typically produce many other outputs, such as control signals for controlling other aspects of the processor core, such as the processing circuitry  8  which performs the processing operations specified by the program instruction. 
     The common register address format register specifiers output by the first decoder  4  and the second decoder  6  are supplied to renaming circuitry  10  which includes register mapping data  12  and a free list  14 . The renaming circuitry  10  applies register renaming techniques, as typically used in out-of-order processors, to generate a renamed register specifier (rtag). This renamed register specifier is supplied to a physical register file  16  which together with an architectural register file  18  and commit queue  20  form part of register circuitry  22 . The physical registers in the physical register files  16  are used for storing speculative operands. When these operands become non-speculative, the commit queue circuitry  20  manages their writing (retirement) into the architectural register file  18 . The register mapping data  12  tracks which architectural registers are mapped to which physical registers. The free list  14  tracks which physical registers are available for allocation to store speculative operand values in accordance with register renaming techniques. 
     The renamed register specifiers produced by the renaming circuitry  10  also include the destination tag identifying the destination physical register for a program instruction. When an architectural register is not currently mapped to any physical register, the common register address format register specifier may be used by the architectural register file  18  to supply the required operand to the processing circuitry  8 . 
     It will be appreciated by those familiar with this technical field that the portion of the processor shown in  FIG. 1  may additionally include dispatch and issue mechanisms disposed between the renaming circuitry and the processing circuitry and the register circuitry. These dispatch and issue mechanisms will receive the renamed register specifiers and the common register address format register specifiers and pass these forward to the processing circuitry  8  and the register circuitry  22 . 
       FIG. 2  schematically illustrates a first mapping and a second mapping between logical register specifiers and architectural registers within the architectural register file  18 . The three columns for each mapping represent the same addressable entity accessed with different register widths. In the case of the first mapping, a single quad word logical register is stored within four architectural registers. These four architectural registers may also be addressed using two logical register specifiers for double word operands or four logical register specifiers for single word operands as illustrated. 
     The correspondence between the elements within the columns is such that S1 in the first mapping corresponds to the block immediately below S0 in the second mapping. The same position within the diagrams showing the first and second mappings corresponds to the same physical register storage locations—for example S2 in the first mapping corresponds to the block S0 in the first mapping and S4 from the first mapping corresponds to S1 in the second mapping as shown in  FIGS. 5B and 6B  discussed below. 
     In accordance with the second mapping a logical register specifier for a quad word operand again corresponds to four architectural registers. However, in this case these four architectural registers may be used to store either a single double word logical register or a single single word logical register. These two mappings are divergent in that it will be seen that a single value of a logical register specifier (as specified by a program instruction) such as “S1” maps to different architectural registers when subject to the first mapping compared to when subject to the second mapping. 
       FIG. 3  schematically illustrates the architectural register file  18 . The architectural register file is composed of four banks of architectural registers with each of these banks containing 32 architectural registers. Thus, the architectural register file  18  comprises an array of registers including four banks and 32 rows. An individual architectural register within the architectural register file may be addressed using a 2-bit bank specifier and a 5-bit row specifier. In practice, if the register being addressed is greater in size than a single architectural register, then it may be specified using a single row specifier and bank specifier value together with a size field indicating how many architectural registers together form the logical register being manipulated. 
       FIG. 3  shows how the architectural register file may contain a mixture of quad word operands, double word operands and single word operands stored within respective architectural registers. 
       FIG. 4  illustrates the common register addressing format generated by the first decoder  4  and the second decoder  6 . This common register addressing format comprises 5-bits of row specifier, 2-bits of bank specifier and a field specifying the size of the register in terms of the number of architectural registers it comprises in total. Another way to consider this common register addressing format is that each row within the architectural register file  18  comprises a quad word with the individual registers being addressed by the bank specifier and the size indicating the number of architectural registers treated together as storing that logical register value. Double word registers are even aligned within the architectural register file  18 . 
     The general format of the register specifiers illustrated in  FIGS. 5A ,  5 B,  5 C,  6 A,  6 B and  6 C is that in the left hand illustration the logical specifier is given and in the right hand illustration the common register address format is given. 
       FIGS. 5A ,  5 B and  5 C illustrate in more detail the first example mapping used respectively for double word registers, single word registers and quad word registers. The double word registers are even aligned and each corresponds to two architectural registers within one of the rows of the architectural register file  18 . The single word registers are not constrained to odd or even alignment and each corresponds to a single architectural register within one of the rows of the array. The quad word registers are aligned such that each corresponds to a complete row within the architectural file array. Thus, a single write port may be used to write a full quad word operand into the array and a single read port used to read a full quad word operand from the array. 
       FIGS. 6A ,  6 B and  6 C respectively indicate the second example mapping used for double word registers, single word registers and quad word registers. The double word registers of the logical register specifiers of the second instruction set only map to bank0 and bank1. Other instructions may be provided which will provide access to the other architectural registers within bank2 and bank3. These will not however be directly accessible using double word logical register specifiers as employed by the program instructions of the second instruction set. 
       FIG. 6B  illustrates the second mapping used for single word registers. All of the logical specifiers for the single word registers are mapped to the architectural registers within bank0. Again, the architectural registers in the other banks may be accessed by other instructions but not directly used in single word logical register specifiers. 
     The second mapping used for quad word registers is such that each logical register specifier corresponds to a row within the array. 
       FIG. 7  schematically illustrates a flow diagram of how a logical register specifier may be mapped to a common format register specifier. It will be appreciated that the flow diagram of  FIG. 7  is a representation of what may be considered logically to take place but in practice the hardware used to implement such behaviour may operate in a different manor with a different sequence of events. 
     At step  24 , processing waits until an instruction is received. Step  26  determines whether or not that instruction is from the first instruction set. If the instruction is from the first instruction set, then step  28  applies a first mapping (see  FIGS. 5A ,  5 B and  5 C) to form a common register addressing format register specifier. Processing then proceeds to step  30  where the common format register specifier (including the size indicating the number of architectural registers concerned) is issued to the renaming circuitry  10 . 
     If the determination at step  26  is that the instruction received is not from the first instruction set, then the instruction will be from the second instruction set and processing proceeds to step  32  at which the second mapping is applied between the logical register specifier and the common format register specifier (see  FIGS. 6A ,  6 B and  6 C). Processing again proceeds subsequent to this mapping to step  30 . 
     Although illustrative embodiments of the invention have been described in detail herein with reference to the accompanying drawings, it is to be understood that the invention is not limited to those precise embodiments, and that various changes and modifications can be effected therein by one skilled in the art without departing from the scope and spirit of the invention as defined by the appended claims