The present invention contains subject matter related to Korean Patent Application No. 2013-042986, filed in the Korean Patent Office on Apr. 18, 2013, the entire contents of which are incorporated herein by reference.
The present invention relates to a 32-bit processor called an extendable instruction set computer (EISC) processor using a 16-bit instruction set, and more particularly, to a method of efficiently generating an extension register (ER) value for operating an immediate value in the EISC processor.
A conventional complex instruction set computer (CISC) microprocessor is advantageous in code density. However, it is difficult to implement a high-speed CISC microprocessor. Meanwhile, a reduced instruction set computer (RISC) microprocessor generally has a 32-bit instruction set, which may disadvantageously cause an excessive increase of the program code length.
The EISC architecture has an instruction set designed to very effectively reduce an execution program size and memory access frequency. The EISC architecture is scalable such that various values such as an immediate value of the instruction and a bit composition can be freely extended using an extendable instruction set. The EISC has both advantages of conventional RISC and CISC architectures.
The EISC processor basically has a simple hardware structure similar to that of the RISC and additionally has advantages of the CISC to obtain excellent performance. Since code density is high, the EISC processor can make the program code more compact by approximately 60% compared to conventional RISC processors or by approximately 80% compared to conventional CISC processors. Therefore, the EISC is advantageously employed in the field of embedded application in which code density is important.
The EISC architecture is an instruction scalable computer architecture. That is, conventional processors have a limited length of the instruction operand, whereas the EISC processor includes an extension register (ER) and an extension flag (e_flag) so that the instruction operand length can be extended as long as the extension register size.
For example, if the instruction operand length is set to 16 bits, and the extension register size is set to 32 bits, the instruction operand can be extended up to 48 bits (=16+32 bits). Therefore, it is possible to simplify hardware, which is an advantage of the embedded processor. For such an instruction extension purpose, there is known a load extension register with immediate (LERI) instruction.
The LERI instruction sets an arbitrary value to the ER and asserts the extension flag e_flag. Then, in another instruction executed after the LERI instruction, it is checked whether or not the extension flag e_flag is asserted. If the extension flag e_flag is asserted, the ER value is added to the operand of that instruction to execute operation. In this way, the instruction operand is extended.
The LERI instruction has a 2-bit opcode and a 14-bit immediate value. In the LERI architecture, the immediate value is stored in the ER, and the value stored in the ER is extracted when extension of the immediate value is necessary afterwards. The extracted value is concatenated with the immediate value of the corresponding instruction. In this architecture, it is possible to effectively address problems that may be generated due to a short length of the immediate value. However, the code length may increase due to addition of the LERI, and this may degrade performance. For this reason, in the EISC processor, it is important to effectively process the LERI.
Since the EISC processor is a 32-bit processor, it can execute 32-bit immediate operation. Since the EISC processor uses a 16-bit instruction, a 4-bit immediate value may be included in the instruction for immediate operation. A separate method is necessary in order to use a longer bit length of the immediate value. Therefore, in a case where a longer bit length of the immediate value is necessary in conventional EISC processors, the ER value is generated based on the LERI instruction before the immediate operation is processed. In addition, the ER value generated in advance is used in the immediate operation.
The ER generates a 14-bit immediate value of the LERI instruction through sign extension. However, in such a conventional method, the ER is unconditionally subjected to the sign extension even when an unsigned immediate value is employed. This may necessitate an additional instruction code and reduce code density accordingly.
This section provides a general summary of the disclosure, and is not a comprehensive disclosure of its full scope or all of its features. In view of the aforementioned problems, the present invention provides a method of operating an immediate value capable of improving operational efficiency by preventing an LERI instruction from being unnecessarily executed when an EISC processor operates an immediate value.
According to an aspect of the invention, there is provided a method of operating an immediate value in an extendable instruction set computer (EISC) processor, including: checking whether or not an unsigned immediate value is used to generate an extension register (ER) value for operating an immediate value; and generating the ER value by performing zero extension for the unsigned immediate value using an unsigned load extension register with immediate (ULERI) instruction if the unsigned immediate value is used.
The method may further include generating the ER value by performing sign extension for the immediate value using a load extension register with immediate (LERI) instruction in a case where a signed immediate value is used to generate the ER value for operating the immediate value.
The EISC processor may be a 32-bit processor operating a 32-bit immediate value, and each length of both the ULERI instruction and the LERI instruction may be set to 16 bits.
According to the present invention, it is possible to improve operational efficiency by preventing the LERI instruction from being unnecessarily executed when the immediate value is operated using a 16-bit instruction in the EISC processor. In particular, this invention is efficiently applied to a field in which unsigned values are mainly operated, such as signal processing. In addition, it is possible to increase code density to improve operational efficiency of the processor.
The foregoing and additional features and characteristics of this disclosure will become more apparent from the following detailed description considered with reference to the accompanying drawings, wherein:
Hereinafter, embodiments of the invention will be described in detail with reference to the accompanying drawings. It is noted that like reference numerals denote like elements throughout overall drawings. In addition, descriptions of well-known apparatus and methods may be omitted so as to not obscure the description of the representative embodiments, and such methods and apparatus are clearly within the scope and spirit of the present disclosure. The terminology used herein is only for the purpose of describing particular embodiments and is not intended to limit the invention. As used herein, the singular forms “a”, “an,” and “the” may be intended to include the plural forms as well, unless the context clearly indicates otherwise. It is further to be noted that, as used herein, the terms “comprises”, “comprising”, “include”, and “including” indicate the presence of stated features, integers, steps, operations, units, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, units, and/or components, and/or combination thereof.
The present invention proposes a method of operating an immediate value in an extendable instruction set computer (EISC) processor.
In the method of operating an immediate value according to the present invention, there is proposed a method of efficiently operating an immediate value by concatenating a conventional load extension register with immediate (LERI) instruction and an additional unsigned load extension register with immediate (ULERI) instruction.
Referring to
In this case, a value obtainable using a single LERI instruction is limited to 14 bits. A plurality of LERI instructions are necessary in order to generate a longer bit length of the immediate value.
For example, if a signed variable 0x21FF (hexadecimal number) is extended to 32 bits, it is necessary to perform sign extension to store 0xFFFFE1FF in the ER. As illustrated in
Referring to
Referring to
Then, using the existing ER value and the immediate value 0x21FF of the LERI instruction, a value 0x000021FF is created ({circle around (2)})
In this manner, in a case where an unsigned immediate value is generated using the LERI instruction in the EISC processor, two LERI instructions are necessary.
Referring to
Referring to
If it is necessary to generate the ER value for operating the immediate value, it is checked whether or not an unsigned immediate value is used (S503).
If an unsigned immediate value is used, the ER value is generated by performing zero extension for the unsigned immediate value using the ULERI instruction (S505).
Then, it is checked whether or not overall necessary ER values are generated (S507). The ER value is continuously generated until the overall necessary ER values are generated. If the overall necessary ER values are generated, this process is terminated.
In a case where a signed immediate value is used to generate the ER value for operating the immediate value in the present invention, the ER value is generated by performing sign extension for the immediate value using an LERI instruction (S509).
Then, it is checked whether or not overall necessary ER values are generated (S511). The ER value is continuously generated until the overall necessary ER values are generated. If the overall necessary ER values are generated, this process is terminated.
In the present invention, the EISC processor is a 32-bit processor operating a 32-bit immediate value, and each length of both the ULERI instruction and the LERI instruction is set to 16 bits.
Although exemplary embodiments of the present invention have been shown and described, it will be apparent to those having ordinary skill in the art that a number of changes, modifications, or alterations to the invention as described herein may be made, none of which depart from the spirit of the present invention.
All such changes, modifications and alterations should therefore be seen as within the scope of the present invention.
Number | Date | Country | Kind |
---|---|---|---|
10-2013-0042986 | Apr 2013 | KR | national |