data processing apparatus comprising: a processor core having means for executing successive program instruction words of a predetermined plurality of instruction sets; a data memory for storing program instruction words to be executed; a program counter register for indicating the address of a next program instruction word in the data memory; means for modifying the contents of the program counter register in response to a current program instruction word; and control means, responsive to one or more predetermined indicator bits of the program counter register, for controlling the processor core to execute program instruction words of a current instruction set selected from the predetermined plurality of instruction sets and specified by the state of the one or more indicator bits of the program counter register.
|
0. 69. A processing apparatus comprising:
a pointer for identifying an address, which specifies the location in a memory of a next instruction that is written in a first instruction set of a plurality of instruction sets; and
a flag for identifying the first instruction set;
wherein:
the pointer and the flag are both written in response to an instruction from a second instruction set of the plurality of instruction sets, and
the value of the flag is not dependent upon the address that specifies the location in the memory of the next instruction.
0. 65. A method of selecting an instruction set comprising the steps of:
receiving a branching instruction written in a first instruction set of a plurality of instruction sets;
in response to the branching instruction, inserting an address of a second instruction, which specifies the location of the second instruction in a memory, into a register and setting the value of a flag, where the value of the flag is not dependent upon the address of the location of the second instruction in the memory;
selecting an instruction set based upon the value of the flag; and
acquiring the second instruction.
0. 27. A data processing apparatus capable of operating using instructions from a predetermined plurality of instruction sets, the data processing apparatus comprising:
(i) a processor core responsive to a first instruction to access a sequence of bits, the sequence of bits having an address portion that specifies the location of a second instruction in a memory and an instruction set indicator portion, the processor core using the instruction set indicator portion of the sequence of bits to set one or more control flags; and
(ii) a controller responsive to the one or more control flags, the state of the one or more control flags specifying a current instruction set selected from the predetermined plurality of instruction sets, to cause the processor core to execute the second instruction as an instruction from the current instruction set,
wherein the one or more control flags are set without regard to the location of the second instruction.
0. 39. A data processing architecture capable of operating using instructions from a predetermined plurality of instruction sets, the data processing architecture comprising:
(i) a processor core responsive to a first instruction to access a sequence of bits, the sequence of bits having an address portion that specifies the location of a second instruction in a memory and an instruction set indicator portion, the processor core using the instruction set indicator portion of the sequence of bits to set one or more control flags; and
(ii) a controller responsive to the one or more control flags, the state of the one or more control flags specifying a current instruction set selected from the predetermined plurality of instruction sets, to cause the processor core to execute the second instruction as an instruction from the current instruction set,
wherein the one or more control flags are set without regard to location of the second instruction.
0. 33. A data processing apparatus capable of operating using instructions from a predetermined plurality of instruction sets, the data processing apparatus comprising:
(i) a processor core responsive to a first instruction to access a sequence of bits, the sequence of bits having an address portion that specifies the location of a second instruction in a memory and an instruction set indicator portion and the instruction set indicator portion having at least one bit that is not part of the address portion of the sequence of bits;
(ii) the processor core using the instruction set indicator portion of the sequence of bits to set one or more control flags, the state of the one or more control flags specifying a current instruction set selected from the predetermined plurality of instruction sets; and
(iii) a controller responsive to the one or more control flags to cause the processor core to execute the second instruction as an instruction from the current instruction set.
0. 45. A data processing architecture capable of operating using instructions from a predetermined plurality of instruction sets, the data processing architecture comprising:
(i) a processor core responsive to a first instruction to access a sequence of bits, the sequence of bits having an address portion that specifies the location of a second instruction in a memory and an instruction set indicator portion and the instruction set indicator portion having at least one bit that is not part of the address portion of the sequence of bits;
(ii) the processor core using the instruction set indicator portion of the sequence of bits to set one or more control flags, the state of the one or more control flags specifying a current instruction set selected from the predetermined plurality of instruction sets; and
(iii) a controller responsive to the one or more control flags to cause the processor core to execute the second instruction as an instruction from the current instruction set.
0. 21. A method of switching between a predetermined plurality of instruction sets used by a data processing apparatus, the method comprising:
in response to a first instruction:
(i) accessing a sequence of bits, the sequence of bits having an address portion that identifies the location of a second instruction in a memory and an instruction set indicator portion, the instruction set indicator portion having at least one bit that is not part of the address portion of the sequence of bits;
(ii) identifying an instruction set selected from the predetermined plurality of instruction sets based on the instruction set indicator portion of the sequence of bits;
(iii) setting one or more control flags to indicate that a current instruction set for the data processing apparatus is the instruction set identified based on the instruction set indicator portion of the sequence of bits; and
retrieving the second instruction from the location specified by the address portion of the sequence of bits.
1. data processing apparatus comprising:
(i) a processor core operable to execute successive program instruction words of a predetermined plurality of instruction sets stored in a data memory;
(ii) a program counter register for indicating an address of a next program instruction word in said data memory;
(iii) logic operable to modify the contents of said program counter register in response to a current program instruction word;
(iv) a processor core controller, responsive to one or more predetermined indicator bits of said program counter register, operable to control said processor core to execute program instruction words of a current instruction set selected from said predetermined plurality of instruction sets and specified by the state of said one or more indicator bits of said program counter register; and
(v) a memory access controller operable to access program instruction words stored in said data memory, said access controller not being responsive to said one or more indicator bits of said program counter register.
0. 15. A method of switching between a predetermined plurality of instruction sets used by a data processing apparatus, the method comprising:
in response to a first instruction:
(i) accessing a sequence of bits, the sequence of bits having an address portion that identifies the location of a second instruction in a memory and an instruction set indicator portion;
(ii) identifying an instruction set selected from the predetermined plurality of instruction sets based on the instruction set indicator portion of the sequence of bits;
(iii) setting one or more control flags to indicate that a current instruction set for the data processing apparatus is the instruction set identified based on the instruction set indicator portion of the sequence of bits; and
retrieving the second instruction from the location specified by the address portion of the sequence of bits,
wherein the instruction set identified by the instruction set indicator portion of the sequence of bits is identifiable without regard to the address specified by the address portion of the sequence of bits.
0. 57. A method of operating a data processing apparatus, the method comprising:
(i) receiving a first instruction from a first instruction set selected from a predetermined plurality of instruction sets;
(ii) translating the first instruction to generate a first set of one or more control signals;
(iii) accessing a sequence of bits comprising an address portion that specifies the location of a second instruction in a memory and an instruction set indicator portion in response to the first set of one or more control signals, the instruction set indicator portion having at least one bit that is not part of the address portion of the sequence of bits;
(iv) setting one or more control flags based upon the value of the instruction set indicator portion of the sequence of bits to specify that a current instruction set is a second instruction set selected from a predetermined plurality of instruction sets;
(v) retrieving the second instruction from the location specified by the address portion of the sequence of bits; and
(vi) translating the second instruction as an instruction from the current instruction set to generate a second set of one or more control signals.
0. 51. A data processing apparatus capable of switching between a predetermined plurality of instruction sets, the data processing apparatus comprising:
(i) means for accessing a sequence of bits in response to a first instruction, the sequence of bits having an address portion that specifies the location of a second instruction in a memory and an instruction set indicator portion;
(ii) means for identifying an instruction set selected from the predetermined plurality of instruction sets based on the instruction set indicator portion of the sequence of bits in response to the first instruction;
(iii) means for setting one or more control flags to indicate that a current instruction set for the data processing apparatus is the instruction set identified based on the instruction set indicator portion of the sequence of bits in response to the first instruction; and
(iv) means for retrieving the second instruction from the location specified by the address portion of the sequence of bits in response to the first instruction,
wherein the instruction set identified by the instruction set portion of the sequence of bits is identifiable without regard to the location of the second instruction.
2. Apparatus according to
a first instruction decoder for decoding program instruction words of a first instruction set; and
a second instruction decoder for decoding program instruction words of a second instruction set;
and in which said processor core controller is operable to control either said first instruction decoder or said second instruction decoder to decode a current program instruction word.
3. Apparatus according to
program instruction words of said first instruction set are X-bit program instruction words; and
program instruction words of said second instruction set are Y-bit program instruction words;
Y being different to X.
4. Apparatus according to
program instruction words of a first instruction set are X-bit program instruction words; and
program instruction words of a second instruction set are Y-bit program instruction words;
Y being different to X.
5. Apparatus according to
6. Apparatus according to
7. Apparatus according to
8. Apparatus according to
9. Apparatus according to
10. Apparatus according to
11. Apparatus according to
12. Apparatus according to
13. Apparatus according to
14. Apparatus according to
0. 16. The method of claim 15, further comprising executing the second instruction as an instruction of the current instruction set.
0. 17. The method of claim 15 in which the predetermined plurality of instruction sets comprises a first instruction set and a second instruction set, and wherein instructions of the first instruction set are X-bit instructions and instructions of the second instruction set are Y-bit instructions, where Y is different from X.
0. 18. The method of claim 17 wherein X is 32 and Y is 16.
0. 19. The method of claim 15 wherein the instruction set indicator portion of the sequence of bits comprises one or more least significant bits of the sequence of bits.
0. 20. The method of claim 15 wherein the instruction set indicator portion of the sequence of bits comprises one or more most significant bits of the sequence of bits.
0. 22. The method of claim 21, further comprising executing the second instruction as an instruction of the current instruction set.
0. 23. The method of claim 21 in which the predetermined plurality of instruction sets comprises a first instruction set and a second instruction set, and wherein instructions of the first instruction set are X-bit instructions and instructions of the second instruction set are Y-bit instructions, where Y is different from X.
0. 24. The method of claim 23 wherein X is 32 and Y is 16.
0. 25. The method of claim 21 wherein the instruction set indicator portion of the sequence of bits comprises one or more least significant bits of the sequence of bits.
0. 26. The method of claim 21 wherein the instruction set indicator portion of the sequence of bits comprises one or more most significant bits of the sequence of bits.
0. 28. The apparatus of claim 27 wherein the one or more control flags comprise one or more predetermined bits in a program counter.
0. 29. The apparatus of claim 27, further comprising a memory system, wherein the memory system is not responsive to the one or more control flags.
0. 30. The apparatus of claim 27, further comprising a memory system wherein the one or more control flags are not provided to the memory system.
0. 31. The apparatus of claim 27 in which the predetermined plurality of instruction sets comprises a first instruction set and a second instruction set, and wherein instructions of the first instruction set are X-bit instructions and instructions of the second instruction set are Y-bit instructions, where Y is different from X.
0. 32. The apparatus of claim 31 wherein X is 32 and Y is 16.
0. 34. The apparatus of claim 33 wherein the one or more control flags comprise one or more predetermined bits in a program counter.
0. 35. The apparatus of claim 33, further comprising a memory system, wherein the memory system is not responsive to the one or more control flags.
0. 36. The apparatus of claim 33, further comprising a memory system wherein the one or more control flags are not provided to the memory system.
0. 37. The apparatus of claim 33 in which the predetermined plurality of instruction sets comprises a first instruction set and a second instruction set, and wherein instructions of the first instruction set are X-bit instructions and instructions of the second instruction set are Y-bit instructions, where Y is different from X.
0. 38. The apparatus of claim 37 wherein X is 32 and Y is 16.
0. 40. The data processing architecture of claim 39 wherein the one or more control flags comprise one or more predetermined bits in a program counter.
0. 41. The data processing architecture of claim 39, further comprising a memory system, wherein the memory system is not responsive to the one or more control flags.
0. 42. The data processing architecture of claim 39, further comprising a memory system wherein the one or more control flags are not provided to the memory system.
0. 43. The data processing architecture of claim 39 in which the predetermined plurality of instruction sets comprises a first instruction set and a second instruction set, and wherein instructions of the first instruction set are X-bit instructions and instructions of the second instruction set are Y-bit instructions, where Y is different from X.
0. 44. The data processing architecture of claim 43 wherein X is 32 and Y is 16.
0. 46. The data processing architecture of claim 45 wherein the one or more control flags comprise one or more predetermined bits in a program counter.
0. 47. The data processing architecture of claim 45, further comprising a memory system, wherein the memory system is not responsive to the one or more control flags.
0. 48. The data processing architecture of claim 45, further comprising a memory system wherein the one or more control flags are not provided to the memory system.
0. 49. The data processing architecture of claim 45 in which the predetermined plurality of instruction sets comprises a first instruction set and a second instruction set, and wherein instructions of the first instruction set are X-bit instructions and instructions of the second instruction set are Y-bit instructions, where Y is different from X.
0. 50. The data processing architecture of claim 49 wherein X is 32 and Y is 16.
0. 52. The data processing architecture of claim 51 wherein the one or more control flags comprise one or more predetermined bits in a program counter.
0. 53. The data processing architecture of claim 51, further comprising a memory system, wherein the memory system is not responsive to the one or more control flags.
0. 54. The data processing architecture of claim 51, further comprising a memory system wherein the one or more control flags are not provided to the memory system.
0. 55. The data processing architecture of claim 51 in which the predetermined plurality of instruction sets comprises a first instruction set and a second instruction set, and wherein instructions of the first instruction set are X-bit instructions and instructions of the second instruction set are Y-bit instructions, where Y is different from X.
0. 56. The apparatus of claim 55 wherein X is 32 and Y is 16.
0. 58. The method of claim 57 wherein the predetermined plurality of instruction sets consists of two instruction sets.
0. 59. The method of claim 58 wherein the first instruction set consists of X-bit instructions and the second instruction set consists of Y-bit instructions, Y being different from X.
0. 60. The method of claim 59 wherein X is 32 and Y is 16.
0. 61. The method of claim 59 wherein X is 16 and Y is 32.
0. 62. The method of claim 57 wherein the first instruction set consists of X-bit instructions and the second instruction set consists of Y-bit instructions, Y being different from X.
0. 63. The method of claim 62 wherein X is 32 and Y is 16.
0. 64. The method of claim 62 wherein X is 16 and Y is 32.
0. 66. The apparatus of claim 65, wherein:
the first instruction set is different from the second instruction set.
0. 67. The apparatus of claim 65, wherein:
the pointer and the flag are located in a single register.
0. 68. The apparatus of claim 65, wherein:
the pointer and the flag are not located in a single register, yet are written to as if portions of a single register.
|
This is a divisional of application Ser. No. 08/477,781 filed on Jun. 7, 1995 now U.S. Pat. No. 5,758,115.
1. Field of the Invention
This invention relates to the field of data processing, and in particular to data processing using multiple sets of program instruction words.
2. Description of the Prior Art
Data processing systems operate with a processor core acting under control of program instruction words which when decoded serve to generate core control signals to control the different elements in the processor to perform the necessary operations to achieve the processing specified in the program instruction word.
It is known to provide systems that execute program instruction words from two or more instruction sets, with means being provided to switch between use of the different instruction sets. The VAX11 computers of Digital Equipment Corporation have a VAX instruction mode and a compatibility mode that enables them to decode the instructions for the earlier PDP11 computers.
In order to switch between the different instruction sets, an instruction set switch may be hard-wired into the processor core necessitating a physical rewiring of the processor to switch instruction sets. Alternatively, a processor register may be used to specify the current instruction set to be used. In this case, the current instruction set can be selected by the operating software, by writing an instruction set-specifying value to that processor register. However, as described below, this technique requires additional program instruction words, which in turn require extra time during preparation of the software and extra memory space to store the program instruction words.
In order to execute a piece of code, a processor capable of using two or more instruction sets must have two pieces of information:
1) The address of the code in memory; and
2) The instruction set to use (i.e. the instruction set in which the code is written)
Typically, in the previously proposed processors, a call to a routine in a different instruction must be performed as described below.
1) The subroutine call is diverted from its original destination to an automatically generated instruction set selection sequence or veneer.
2) The veneer must then accomplish the following
This process can be made relatively transparent to the programmer by use of a conventional software tool called a Linker. However, the process has a five instruction overhead per routine which is called from a different instruction set, and it also introduces a significant processing overhead.
It is an object of the invention to improve the capabilities of data processing apparatus to switch between multiple instruction sets.
This invention provides a data processing apparatus comprising:
With the invention, a control flag or flags to select a current instruction set is provided in the program counter register. This allows the current instruction set to be changed when a new value is written into the program counter register, for example as part of the execution of a branch instruction.
The invention recognises that if the required instruction set and the next instruction address are encoded in separate processor registers as in the previously proposed processors described above (an instruction set register and a program counter register), it becomes difficult to change between instruction sets as the two separate registers have to be updated to accomplish a call to a section of code written in a different instruction set.
As an example, consider a program which is to perform a sorting or collation function. Typically this will call a generic sort routine to perform the sort. As this sort routine is generic, it must be capable of sorting in any given sequence. For example, it may be called to sort items in numerical order, alphabetical order, case insensitive alphabetical order, or any other order specified by the programmer. The means by which the programmer specifies the sorting order is to pass the address of a routine (called a compare routine) to the sort routine. This compare routine will then be called by the sort routine and will return a value to indicate whether, given two items of data, the first should be placed before or after the second in the sorted sequence.
If just the address of the compare routine is passed to the sort routine then the sort routine has no way of knowing which instruction set should be selected when the routine is to be called. If the wrong instruction set is current when an attempt is made to execute the compare routine, the results can be dramatically unsuccessful. Extra information must be passed to the sort routine to tell it what instruction set should be in force when the compare routine is called. However, many existing programs written in high level languages such as C & C++ make assumptions that all the information necessary to uniquely identify a target routine (in this case the address and the instruction set information) can be represented in a single machine word.
The invention addresses these problems by defining a predetermined bit or bits of the program counter register (PC) to indicate the instruction set to be used. In the specific example given above, the address of the compare routine passed to the sort routine can have the required instruction set encoded in the predetermined bit or bits of that address. The address, including the indicator bit or bits, is then simply moved to the program counter register when the compare routine is called.
Although certain bits of the program counter register can be reserved for use as the indicator bits, an alternative approach is to store portions of code to be executed using the various instruction sets in corresponding memory areas, so that while those memory areas are being accessed the program counter will contain a particular range of values specifying the appropriate instruction set to be used.
In order to decode instructions from the different instruction sets, it is preferred that the apparatus comprises a first instruction decoder for decoding program instruction words of the first instruction set; and a second instruction decoder for decoding program instruction words of the second instruction set; and that the control means is operable to control either the first instruction decoder or the second instruction decoder to decode a current program instruction word.
Preferably, program instruction words of the first instruction set are X-bit program instruction words; and program instruction words of the second instruction set are Y-bit program instruction words; where Y is different to X. In this way, a common processor core can be programmed with either an instruction set having longer program instruction words and allowing potentially more powerful and involved instructions, or an instruction set having shorter program instruction words, thus saving memory space where a potentially more limited instruction set can be tolerated.
In one preferred embodiment, the one or more bits of the program counter register are one or more most significant bits of the program counter register. In a program counter register of say, 32 bits, the highest order bits are seldom required since the maximum memory space that can be addressed by such a large program counter register is much more than the memory space normally used.
Alternatively, in another preferred embodiment, the one or more bits of the program counter register are one or more least significant bits of the program counter register. In this case, these bits are often not used where the minimum length of program instruction words or data words is at least two bytes.
In order to avoid invalid addresses in the data memory being accessed, it is preferred that means are provided for accessing a program instruction word stored in the data memory, the accessing means not being responsive to the one or more bits of the program counter register.
The above and other objects, features and advantages of the invention will be apparent from the following detailed description of illustrative embodiments which is to be read in connection with the accompanying drawings, in which:
The processor core 10 includes a register bank 30, a Booths multiplier 40, a barrel shifter 50, a 32-bit arithmetic logic unit (ALU) 60 and a write data register 70. Between the processor core 10 and the memory system 20 are: an instruction pipeline 80, a multiplexer 90, a first instruction decoder 100, a second instruction decoder 110, and a read data register 120.
A program counter (PC) register 130, which is part of the processor core 10, is shown addressing the memory system 20. A program counter controller 140 serves to increment the program counter value within the program counter register 130 as each instruction is executed and a new instruction must be fetched for the instruction pipeline 80. Also, when a branch instruction is executed, the target address of the branch instruction is loaded into the program counter 130 by the program counter controller 140.
The processor core 10 incorporates 32-bit data pathways between the various functional units. In operation, instructions within the instruction pipeline 80 are decoded by either the first instruction decoder 100 or the second instruction decoder 110 (under the control of the multiplexer 90) to produce various core control signals that are passed to the different functional elements of the processor core 10. In response to these core control signals, the different portions of the processor core conduct 32-bit processing operations, such as 32-bit multiplication, 32-bit addition and 32-bit logical operations.
The register bank 30 includes a current programming status register (CPSR) 150 and a saved programming status register (SPSR) 160. The current programming status register 150 holds various condition and status flags for the processor core 10. These flags may include processing mode flags (e.g. system mode, user mode, memory abort mode, etc.) as well as flags indicating the occurrence of zero results in arithmetic operations, carries and the like. The saved programming status register 160 (which may be one of a banked plurality of such saved programming status registers) is used to store temporarily the contents of the current programming status register 150 if an exception occurs that triggers a processing mode switch.
The program counter register 130 includes an instruction set flag, T. This instruction set flag is used to control the operation of the multiplexer 90, and therefore to control whether the first instruction decoder 100 or the second instruction decoder 110 is used to decode a current data processing instruction. In the present embodiment, two instruction sets are used: a first instruction set comprises 32-bit program instruction words and is decoded by the first instruction decoder 100, and a second instruction set comprises 16-bit program instruction words and is decoded by the second instruction decoder 110. The core control signals generated by the first instruction decoder 100 and the second instruction decoder 110 are compatible with the various functional units of the core 10.
The use of two instruction sets of different program instruction word length allows a common processing core 10 to be programmed with either the first instruction set having longer words and allowing potentially more powerful and involved instructions, or the second instruction set having shorter program instruction words, thus saving memory space where a potentially more limited instruction set can be tolerated.
The provision of an instruction set flag T enables the second instruction set to be non-orthogonal to the first instruction set. This is particularly useful in circumstances where the first instruction set is an existing instruction set without any free bits that could be used to enable an orthogonal further instruction set to be detected and decoded.
The instruction set flag T is “hidden” in normally unused bits of the program counter register. This means that the T flag can be set or reset by the program counter controller 140, but the state of the T flag need have no direct effect on the operation of the memory system 20 and the instruction pipeline 80.
The program counter register is a 32-bit register, which allows 232 bytes to be addressed in the memory system 20. However, since this equates to 4 gigabytes of addressable memory space, it is extremely unlikely that the full address range made possible by the 21-bit program counter register will be required.
Accordingly, the T bit in
A problem which must be overcome is that when the T bit is set, the program counter register 130′ may well point to a memory address which is far in excess of the address range of the memory system 20. In other words, the memory address pointed to by the 32-bits of the program counter register 130 is an invalid address as far as the memory system 20 is concerned.
This problem can be overcome in two straightforward ways. In one technique, the highest order bit (the T bit) of the program counter register 130′ is simply not supplied as an address bit o the memory system 20. Alternatively, the address decoding within the memory system 20 may detect only a certain number of lowest order bits (e.g. the lowest order 24 bits to address a 16 megabyte address space), with the state of the remaining higher order bits being irrelevant to the decoded address. This is a standard technique in memory address decoding when it is known in advance that only a certain number of address bits will be required.
As described above, the T bit is passed from the program counter register 130′ to the multiplexer 90, and determines the routing of instructions to either the first instruction decoder 100 or the second instruction decoder 110.
The lowest order bit of the program counter register is normally unused in a processor in which the minimum instruction or data word size is at least two bytes (16 bits in this case). Accordingly, in the present embodiment the instruction program words may be either 32 bits long (4 bytes) or 16 bits long (2 bytes) so the addresses supplied from the program counter 130 to the memory system 20 will always be a multiple of two and will therefore have a zero as the least significant bit of the address.
The least significant bit of the program counter register 130″ is used to store the T bit, which is supplied to the multiplexer 90 as described above. Also as described above, the lowest order bit of the program counter register 130″ is not supplied to the memory system, in order that invalid addresses are not accessed by the memory system 20.
The fact that the program counter 130 is controlled by the program counter controller 140 means that the T bit can be set as part of a branch instruction carried out by the core 10. For example, if the T bit is currently set to indicate the use of the first (32-bit) instruction set and it is desired to branch to a portion of a code employing the second (16-bit) instruction set, then a branch instruction can be executed to jump to the address of the 16-bit code to be executed and simultaneously to change the T bit in the program counter register, in particular, in the arrangement shown in
This process is illustrated schematically in
Referring to
When a switch is made between the two instruction sets by changing the T bit in the program counter 130, the actual switch-over by the multiplexer 90 may be delayed to allow for existing instructions currently stored in the pipeline 80.
In summary, the switch between different processing modes (in particular, the use of different instruction sets) can be made by writing a target address and a mode flag (T) to the program counter as part of the execution of a branch instruction.
In an alternative case where the first instruction set is pre-defined and used in existing processors, there may be logical restrictions within the existing first instruction set preventing the normally unused bits of the program counter register 130 from being changed by the instruction set. For backwards compatibility of processors incorporating the second alternative, instruction set, it may be necessary to employ a short instruction set selection sequence of code to switch in one direction from the first (existing) instruction set to the second instruction set. Since the second instruction set would generally be added at the same time that the switching mechanism is being added, the second instruction set can be defined without the restrictions on accessing normally unused bits of the program counter register 130. This means that the branching mechanism described above can be used to switch back from the second instruction set to the first instruction set.
An example of an instruction set selection sequence (known as a “veneer”) is as follows:
Label_Veneer
XOR
(PC,1)
Branch
Label
In this routine, the current contents of the program counter register 130″ of
In an alternative veneer routine, a subtract operation could be used instead of an exclusive-OR operation to change the T-bit of the program counter register 130″. This has the advantage that in some processors, the subtract operation also flushes or clears the instruction pipeline 80.
The following example assumes that the program counter 130″ points 8 bytes beyond the current instruction, and that the current instruction is a 32 bit (4 byte) instruction. Accordingly, to change the least significant bit of the program counter register 130″ to 1, it is necessary to add or subtract the following amounts to the current program counter register contents:
add 1
(to change the T bit to 1)
subtract 8
(to compensate for the program counter
pointing ahead of the current instruction)
add 4
(to compensate for the length of the current
----------
instruction)
subtract 3
(total change)
----------
The instruction sequence used is therefore:
Label_Veneer
SUB
(PC,PC,3)
(replace PC with PC-3)
Branch
Label
In summary, the use of the program counter to store the instruction-set-specifying bit or bits has at least the following advantages:
1. It provides a single, uniform method of identifying a target routine by representing both the target address and the corresponding instruction set in a single machine word.
2. The code size is reduced as fewer veneers are required.
3. The processor performance can be improved as there is no longer a need to execute a veneer on each inter-instruction set routine call.
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.
Patent | Priority | Assignee | Title |
10585667, | Mar 31 2004 | Intel Corporation | Method and system to provide user-level multithreading |
10613858, | Mar 31 2004 | Intel Corporation | Method and system to provide user-level multithreading |
10628153, | Mar 31 2004 | Intel Corporation | Method and system to provide user-level multithreading |
10635438, | Mar 31 2004 | Intel Corporation | Method and system to provide user-level multithreading |
11036519, | Oct 30 2015 | International Business Machines Corporation | Simultaneously capturing status information for multiple operating modes |
Patent | Priority | Assignee | Title |
4217638, | May 19 1977 | Tokyo Shibaura Electric Co., Ltd. | Data-processing apparatus and method |
4236204, | Mar 13 1978 | Motorola, Inc. | Instruction set modifier register |
4274138, | Jul 31 1976 | Tokyo Shibaura Denki Kabushiki Kaisha | Stored program control system with switching between instruction word systems |
4338663, | Oct 25 1977 | Digital Equipment Corporation | Calling instructions for a data processing system |
4346437, | Aug 31 1979 | Bell Telephone Laboratories, Incorporated | Microcomputer using a double opcode instruction |
4398243, | Apr 25 1980 | Data General Corporation | Data processing system having a unique instruction processor system |
4434459, | Apr 25 1980 | Data General Corporation | Data processing system having instruction responsive apparatus for both a basic and an extended instruction set |
4434461, | Sep 15 1980 | Motorola, Inc. | Microprocessor with duplicate registers for processing interrupts |
4459657, | Sep 24 1980 | Tokyo Shibaura Denki Kabushiki Kaisha | Data processing system having re-entrant function for subroutines |
4511966, | Feb 19 1982 | Sony Corporation | Digital signal processing system |
4514803, | Apr 26 1982 | International Business Machines Corporation | Methods for partitioning mainframe instruction sets to implement microprocessor based emulation thereof |
4554627, | Apr 25 1980 | Data General Corporation | Data processing system having a unique micro-sequencing system |
4685080, | Feb 22 1982 | International Business Machines Corp. | Microword generation mechanism utilizing separate programmable logic arrays for first and second microwords |
4695943, | Sep 27 1984 | Intel Corporation | Multiprocessor shared pipeline cache memory with split cycle and concurrent utilization |
4839797, | Jul 25 1984 | NEC Corporation; NEC CORPORATION, 33-1, SHIBA 5-CHOME, MINATO-KU, TOKYO, JAPAN | Microprocessor compatible with any software represented by different types of instruction formats |
4849922, | Jan 20 1987 | CSELT - Centro Studi e Laboratori Telecomunicazioni SpA | Circuit for computing the quantized coefficient discrete cosine transform of digital signal samples |
4870614, | Aug 02 1984 | Programmable controller ("PC") with co-processing architecture | |
4876639, | Sep 20 1983 | Method and circuitry for causing sixteen bit microprocessor to execute eight bit op codes to produce either internal sixteen bit operation or internal eight bit operation in accordance with an emulation bit | |
4905196, | Apr 26 1984 | BBC Brown, Boveri & Company Ltd. | Method and storage device for saving the computer status during interrupt |
4930068, | Nov 07 1986 | NEC Electronics Corporation | Data processor having different interrupt processing modes |
4931989, | Feb 22 1982 | International Business Machines Corporation | Microword generation mechanism utilizing a separate programmable logic array for first microwords |
5077659, | Aug 13 1987 | Kabushiki Kaisha Toshiba | Data processor employing the same microprograms for data having different bit lengths |
5115500, | Jan 11 1988 | International Business Machines Corporation | Plural incompatible instruction format decode method and apparatus |
5148536, | Jul 25 1988 | HEWLETT-PACKARD DEVELOPMENT COMPANY, L P | Pipeline having an integral cache which processes cache misses and loads data in parallel |
5187791, | Jan 26 1990 | Apple Inc | Microprocessor with improved interrupt response with data saving dependent upon processor status using status flag |
5193158, | Oct 19 1988 | Hewlett-Packard Company | Method and apparatus for exception handling in pipeline processors having mismatched instruction pipeline depths |
5276824, | Jan 08 1990 | Freescale Semiconductor, Inc | Data processor having a multi-stage instruction pipe and selection logic responsive to an instruction decoder for selecting one stage of the instruction pipe |
5303378, | May 21 1991 | HEWLETT-PACKARD DEVELOPMENT COMPANY, L P | Reentrant protected mode kernel using virtual 8086 mode interrupt service routines |
5327566, | Jul 12 1991 | Hewlett-Packard Company | Stage saving and restoring hardware mechanism |
5335331, | Jul 13 1990 | Kabushiki Kaisha Toshiba | Microcomputer using specific instruction bit and mode switch signal for distinguishing and executing different groups of instructions in plural operating modes |
5353420, | Aug 10 1992 | Intel Corporation | Method and apparatus for decoding conditional jump instructions in a single clock in a computer processor |
5363322, | Apr 02 1991 | Motorola, Inc.; MOTOROLA, INC , SCHAUMBURG, IL A CORP OF DE | Data processor with an integer multiplication function on a fractional multiplier |
5386563, | Oct 13 1992 | ARM Limited | Register substitution during exception processing |
5392408, | Sep 20 1993 | Apple Inc | Address selective emulation routine pointer address mapping system |
5404472, | Jul 07 1989 | Hitachi, Ltd. | Parallel processing apparatus and method capable of switching parallel and successive processing modes |
5416739, | Mar 17 1994 | VTECH COMPUTERS, LTD | Cache control apparatus and method with pipelined, burst read |
5420992, | Mar 11 1991 | MIPS Technologies, Inc | Backward-compatible computer architecture with extended word size and address space |
5475824, | Jan 23 1992 | Intel Corporation | Microprocessor with apparatus for parallel execution of instructions |
5481684, | Jan 11 1994 | SAMSUNG ELECTRONICS CO , LTD | Emulating operating system calls in an alternate instruction set using a modified code segment descriptor |
5481693, | Jul 20 1994 | SAMSUNG ELECTRONICS CO , LTD | Shared register architecture for a dual-instruction-set CPU |
5524211, | Feb 13 1991 | HEWLETT-PACKARD DEVELOPMENT COMPANY, L P | System for employing select, pause, and identification registers to control communication among plural processors |
5542059, | Jan 11 1994 | SAMSUNG ELECTRONICS CO , LTD | Dual instruction set processor having a pipeline with a pipestage functional unit that is relocatable in time and sequence order |
5561810, | Jun 10 1992 | NEC Corporation | Accumulating multiplication circuit executing a double-precision multiplication at a high speed |
5568646, | May 03 1994 | ARM Limited | Multiple instruction set mapping |
5574928, | Oct 29 1993 | GLOBALFOUNDRIES Inc | Mixed integer/floating point processor core for a superscalar microprocessor with a plurality of operand buses for transferring operand segments |
5583804, | Jul 14 1994 | ARM Limited | Data processing using multiply-accumulate instructions |
5598546, | Aug 31 1994 | SAMSUNG ELECTRONICS CO , LTD | Dual-architecture super-scalar pipeline |
5600845, | Jul 27 1994 | WAGNER & BROWN, LTD ; SeaSound, LLC | Integrated circuit computing device comprising a dynamically configurable gate array having a microprocessor and reconfigurable instruction execution means and method therefor |
5606714, | Dec 06 1991 | National Semiconductor Corporation | Integrated data processing system including CPU core and parallel, independently operating DSP module and having multiple operating modes |
5630083, | Mar 01 1994 | Intel Corporation | Decoder for decoding multiple instructions in parallel |
5630153, | Jan 18 1990 | National Semiconductor Corporation | Integrated digital signal processor/general purpose CPU with shared internal memory |
5638525, | Feb 10 1995 | Intel Corporation | Processor capable of executing programs that contain RISC and CISC instructions |
5642516, | Oct 14 1994 | Cirrus Logic, Inc.; Cirrus Logic, INC | Selective shadowing of registers for interrupt processing |
5664147, | Aug 24 1995 | International Business Machines Corp. | System and method that progressively prefetches additional lines to a distributed stream buffer as the sequentiality of the memory accessing is demonstrated |
5666355, | Jul 21 1994 | Intel Corporation | Power consumption control method and apparatus for a communication system subscriber unit |
5671422, | Nov 14 1994 | Intel Corporation | Method and apparatus for switching between the modes of a processor |
5689672, | Oct 29 1993 | Advanced Micro Devices, Inc. | Pre-decoded instruction cache and method therefor particularly suitable for variable byte-length instructions |
5692152, | Jun 29 1994 | SAMSUNG ELECTRONICS CO , LTD | Master-slave cache system with de-coupled data and tag pipelines and loop-back |
5701493, | Aug 03 1995 | ARM Limited | Exception handling method and apparatus in data processing systems |
5740461, | May 03 1994 | ARM Limited | Data processing with multiple instruction sets |
5758115, | Jun 10 1994 | ARM Limited | Interoperability with multiple instruction sets |
5781750, | Jan 11 1994 | SAMSUNG ELECTRONICS CO , LTD | Dual-instruction-set architecture CPU with hidden software emulation mode |
5784585, | Apr 05 1994 | Motorola, Inc. | Computer system for executing instruction stream containing mixed compressed and uncompressed instructions by automatically detecting and expanding compressed instructions |
5784636, | May 28 1996 | National Semiconductor Corporation | Reconfigurable computer architecture for use in signal processing applications |
5796973, | Oct 29 1993 | Advanced Micro Devices, Inc. | Method and apparatus for decoding one or more complex instructions into concurrently dispatched simple instructions |
5968161, | Aug 29 1996 | ALTERA CORPORATION A DELAWARE CORP | FPGA based configurable CPU additionally including second programmable section for implementation of custom hardware support |
5970254, | Jun 27 1997 | Intel Corporation | Integrated processor and programmable data path chip for reconfigurable computing |
6496922, | Oct 31 1994 | Sun Microsystems, Inc | Method and apparatus for multiplatform stateless instruction set architecture (ISA) using ISA tags on-the-fly instruction translation |
EP109567, | |||
EP169565, | |||
EP199173, | |||
EP306920, | |||
EP324308, | |||
EP109567, | |||
EP169565, | |||
EP199173, | |||
EP306920, | |||
EP324308, | |||
EP758464, | |||
GB2016755, | |||
GB20167550, | |||
GB2284492, | |||
JP1007129, | |||
JP3150633, | |||
JP476626, | |||
JP5240826, | |||
JP5265751, | |||
JP5268340, | |||
JP58155457, | |||
JP583040, | |||
JP6083615, | |||
JP62151938, | |||
JP6225334, | |||
JP62262146, | |||
JP63111533, | |||
JP683615, | |||
JP7281890, | |||
WO9724660, |
Executed on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
Feb 01 2002 | ARM Limited | (assignment on the face of the patent) | / |
Date | Maintenance Fee Events |
Date | Maintenance Schedule |
Mar 13 2015 | 4 years fee payment window open |
Sep 13 2015 | 6 months grace period start (w surcharge) |
Mar 13 2016 | patent expiry (for year 4) |
Mar 13 2018 | 2 years to revive unintentionally abandoned end. (for year 4) |
Mar 13 2019 | 8 years fee payment window open |
Sep 13 2019 | 6 months grace period start (w surcharge) |
Mar 13 2020 | patent expiry (for year 8) |
Mar 13 2022 | 2 years to revive unintentionally abandoned end. (for year 8) |
Mar 13 2023 | 12 years fee payment window open |
Sep 13 2023 | 6 months grace period start (w surcharge) |
Mar 13 2024 | patent expiry (for year 12) |
Mar 13 2026 | 2 years to revive unintentionally abandoned end. (for year 12) |