This application claims the benefit of European Patent Application No. 04291918.3, filed Jul. 27, 2004, incorporated by reference herein as if reproduced in full below.
1. Technical Field
The present subject matter relates generally to processors and more particularly to an executable instruction that copies at least a portion of the contents of a register to a destination register at a programmable location within the destination register.
2. Background Information
Many types of electronic devices are battery operated and thus preferably consume as little power as possible. An example is a cellular telephone. Further, it may be desirable to implement various types of multimedia functionality in an electronic device such as a cell phone. Examples of multimedia functionality may include, without limitation, games, audio decoders, digital cameras, etc. It is thus desirable to implement such functionality in an electronic device in a way that, all else being equal, is fast, consumes as little power as possible and requires as little memory as possible. Improvements in this area are desirable.
In at least one embodiment, a processor executes an instruction that causes a source data field from a first source register to be copied to a destination register at a programmable position within the destination register. In some embodiments, a system (e.g., a communication device such as cellular telephone) includes a processor capable of executing the instruction as described above.
In another embodiment, a method of executing an instruction is disclosed that comprises examining the instruction to determine a first source register, examining the instruction to determine a destination register, and determining a position associated with the destination register. The method further comprises copying a source data field from the first source register to a portion of the destination register defined by the position, without affecting other portions of the destination register.
In general, the instruction is useful to create a bitstream from multiple input values. For example, 9 variables of 3 bits each and one 5-bit variable could be packed into a single 32-bit register in a specific configuration of the various variables. The instruction can be used in some embodiments for generating, for example, media-based bitstreams (e.g., audio, video).
Certain terms are used throughout the following description and claims to refer to particular system components. As one skilled in the art will appreciate, various companies may refer to a component by different names. This document does not intend to distinguish between components that differ in name but not function. In the following discussion and in the claims, the terms “including” and “comprising” are used in an open-ended fashion, and thus should be interpreted to mean “including, but not limited to.” Also, the term “couple” or “couples” is intended to mean either an indirect or direct connection. Thus, if a first device couples to a second device, that connection may be through a direct connection, or through an indirect connection via other devices and connections.
For a more detailed description of the preferred embodiments of the present invention, reference will now be made to the accompanying drawings, wherein:
The following discussion is directed to various embodiments of the invention. Although one or more of these embodiments may be preferred, the embodiments disclosed should not be interpreted, or otherwise used, as limiting the scope of the disclosure, including the claims, unless otherwise specified. In addition, one skilled in the art will understand that the following description has broad application, and the discussion of any embodiment is meant only to be exemplary of that embodiment, and not intended to intimate that the scope of the disclosure, including the claims, is limited to that embodiment.
The subject matter disclosed herein is directed to a programmable electronic device such as a processor that executes various instructions including, without limitation, a “PACK” instruction. As will be explained in detail below, the PACK instruction permits the creation of a bit stream by copying some or all of the contents of a source register to a designated location within a destination register. The PACK instruction is particularly useful for generating, for example, media-based bitstreams (e.g., audio, video). The following describes the operation of a preferred embodiment of a processor on which the PACK instruction may run. Other processor architectures and embodiments may be available or developed on which to run the instruction and thus this disclosure and the claims which follow are not limited to any particular type of processor. Details regarding the operation and format of the PACK instruction follow the description of the processor.
The processor described herein is particularly suited for executing Java TM Bytecodes or comparable code. As is well known, Java is particularly suited for embedded applications. Java is a relatively “dense” language meaning that on average each instruction may perform a large number of functions compared to various other programming languages. The dense nature of Java is of particular benefit for portable, battery-operated devices that preferably include as little memory as possible to save space and power. The reason, however, for executing Java code is not material to this disclosure or the claims which follow. The processor described herein may be used in a wide variety of electronic systems. By way of example and without limitation, the Java-executing processor described herein may be used in a portable, battery-operated communication device such as a cellular telephone, personal data assistants (“PDAs”), etc. Further, the processor advantageously includes one or more features that permit the execution of the Java code to be accelerated.
Referring now to
As shown in
As is generally well known, Java code comprises a plurality of “bytecodes” 112. Bytecodes 112 may be provided to the JVM 108, compiled by compiler 110 and provided to the JSM 102 and/or MPU 104 for execution therein. In accordance with a preferred embodiment of the invention, the JSM 102 may execute at least some, and generally most, of the Java bytecodes. When appropriate, however, the JSM 102 may request the MPU 104 to execute one or more Java bytecodes not executed or executable by the JSM 102. In addition to executing Java bytecodes, the MPU 104 also may execute non-Java instructions. The MPU 104 also hosts an operating system (“O/S”) (not specifically shown), which performs various functions including system memory management, system task management for scheduling the JVM 108 and most, or all, other native tasks running on the system, management of the display 114, receiving input from input devices, etc. Without limitation, Java code may be used to perform any one of a variety of applications including multimedia data processing, games or web-based applications, while non-Java code, which may comprise the O/S and other native applications, may still run on the system on the MPU 104.
The JVM 108 generally comprises a combination of software and hardware. The software may include the compiler 110 and the hardware may include the JSM 102. The JVM may include a class loader, bytecode verifier, garbage collector, and a bytecode interpreter loop to interpret the bytecodes that are not executed on the JSM processor 102.
In accordance with preferred embodiments of the invention, the JSM 102 may execute at least two instruction sets. One instruction set may comprise standard Java bytecodes. As is well-known, Java is a stack-based programming language in which instructions generally target a stack. For example, an integer add (“IADD”) Java instruction pops two integers off the top of the stack, adds them together, and pushes the sum back on the stack. The JSM 102 comprises a stack-based architecture with various features that accelerate the execution of stack-based Java code, such as those described in U.S. patent Pub. Nos. 2004/0078550, 2004/0078557, and 2004/0024999, all of which are incorporated herein by reference.
Another instruction set executed by the JSM 102 may include instructions other than standard Java instructions. In accordance with at least some embodiments of the invention, such other instruction set may include register-based and memory-based operations. This other instruction set generally complements the Java instruction set and, accordingly, may be referred to as a complementary instruction set architecture (“CISA”). By complementary, it is meant that the execution of one or more Java bytecodes may be substituted by “microsequences” using CISA instructions that enable faster, more efficient operation. The two sets of instructions may be used in a complementary fashion to obtain satisfactory code density and efficiency. As such, the JSM 102 generally comprises a stack-based architecture for efficient and accelerated execution of Java bytecodes combined with a register-based architecture for executing register and memory based CISA instructions. Both architectures preferably are tightly combined and integrated through the CISA.
Referring now to
Referring again to
The second, register-based, memory-based instruction set may comprise the CISA instruction set introduced above. The CISA instruction set preferably is complementary to the Java bytecode instruction set in that the CISA instructions may be used to accelerate or otherwise enhance the execution of Java bytecodes. For example, the compiler 110 may scan a series of Java bytes codes 112 and replace one or more of such bytecodes with an optimized code segment mixing CISA and bytecodes and which is capable of more efficiently performing the function(s) performed by the initial group of Java bytecodes. In at least this way, Java execution may be accelerated by the JSM 102. The CISA instruction set includes a plurality of instructions including a “PACK” instruction as mentioned above and explained below in detail.
Referring still to
The data storage 122 generally comprises data cache (“D-cache”) 124 and data random access memory (“D-RAMset”) 126. Reference may be made to U.S. patent Publications Ser. No. 09/591,537 filed Jun. 9, 2000 (atty docket TI-29884), Ser. No. 09/591,656 filed Jun. 9, 2000 (atty docket TI-29960), Ser. No. 09/932,794 filed Aug. 17, 2001 (atty docket TI-31351), and U.S. patent Pub. No. 20040260904, all of which are incorporated herein by reference, for information related to the D-RAMset. The stack (excluding the micro-stack 146), arrays and non-critical data may be stored in the D-cache 124, while Java local variables, critical data and non-Java variables (e.g., C, C++) may be stored in D-RAMset 126. The instruction storage 130 may comprise instruction RAM (“I-RAM”) 132 and instruction cache (“I-cache”) 134.
One of the CISA instructions, as noted above, is the “PACK” instruction. The function performed by the PACK instruction is illustrated in
As shown in
Multiple embodiments of a PACK instruction are possible. Two such embodiments are depicted in
As shown in
Bits 24 through 27 (field 252) comprises a 4-bit field that identifies the particular register to be used as the destination register Rd. As shown in
Bits 16 through 19 (field 256) specify the other source register Rs2 which contains the position value P to which the source data field 200 is to be copied in register Rd. The position value P designates the lowest order bit to which the source data field 200 is to be copied in register Rd. In other embodiments, the position value P may specify the highest order bit in register Rd to which the source data field 200 is to be copied. As for the source register Rs1, source register Rs2 containing the P value is preferably one of the general purpose registers depicted in
Bit 14 (field 260) is unused in a PACK instruction and set to a value of 0 in
In
In the embodiments described above, the value of m is contained in the instruction itself. In other embodiments, the instruction may contain an identifier of a register that contains the value of m. For example, rather than bits 4 through 8 containing the value of m, those bits could identify the register from among the register set (
In still another embodiment of the PACK instruction, the value of P is contained in the instruction itself (similar to the embodiment of
As noted above, the PACK instruction permits one or more of the least significant bits from a designated source register to be copied to a desired position within a designated destination register. The PACK instruction provides flexibility to specify the source register that contains the data field to be copied, the size of the data field to be copied, the destination register into which the data field is to be copied and the position within the destination register at which the data field is to be copied.
The PACK instruction described herein permits a bit stream to be formed in an efficient, quick manner. The PACK instruction can be executed multiple times to copy multiple source data fields to various locations within a destination register.
While the preferred embodiments of the present invention have been shown and described, modifications thereof can be made by one skilled in the art without departing from the spirit and teachings of the invention. The embodiments described herein are exemplary only, and are not intended to be limiting. Many variations and modifications of the invention disclosed herein are possible and are within the scope of the invention. Accordingly, the scope of protection is not limited by the description set out above. Each and every claim is incorporated into the specification as an embodiment of the present invention.
Number | Date | Country | Kind |
---|---|---|---|
04291918.3 | Jul 2004 | EP | regional |