Claims
- 1. A processor executing a plurality of instructions, comprising:
an arithmetic logic unit; and a plurality of registers coupled to the ALU, each register programmable to store a register value; wherein said processor executes a test and skip instruction that includes an immediate value and a reference to a register, performs a comparison using the immediate value and the register value stored in the referenced register, and causes the processor to execute or not execute a subsequent instruction that follows the test and skip instruction based on the comparison.
- 2. The processor of claim 1 wherein the comparison is performed by comparing the immediate value to the register value in the referenced register.
- 3. The processor of claim 2 wherein the processor does not execute the subsequent instruction if the immediate value does not match the register value and executes the subsequent if the immediate value does match the register value.
- 4. The processor of claim 1 wherein the comparison is performed by masking the register value in the referenced register with the immediate value and examining one or more bits in the masked version of the referenced register.
- 5. The processor of claim 4 wherein the masking is performed by ANDing the immediate value with the register value.
- 6. The processor of claim 1 wherein the instruction includes at least one bit that specifies how the comparison is to be performed.
- 7. The processor of claim 6 wherein the at least one bit specifies whether the register reference is to a register from a first group of registers or to a register from a second group of registers, and if a register from the first group of registers is specified by said bit, the comparison is performed by comparing the immediate value to the register value, and, if a register from the second group of registers is specified by said bit, the comparison is performed by masking the register value with the immediate value and examining one or more bits in the masked version of the referenced register.
- 8. The processor of claim 6 wherein the registers include a status register and if the register reference specified by said at least one bit is not the status register, the comparison is performed by comparing the immediate value to the register value in the referenced register, and, if the register reference specified by said at least one bit is the status register, the comparison is performed by masking the register value in the status register with the immediate value and examining one or more bits in the masked version of the status register.
- 9. A method of executing an instruction having a reference to a register, an immediate value, and a control bit that dictates one of at least two tests, the method comprising:
examining said control bit to determine its state; if said control bit is in a first state, comparing the immediate value to the contents of the register referenced in the instruction and skipping a subsequent instruction based on the outcome of the comparison; or if said control is in a second state, masking the contents of the register with the immediate value, testing one or more bits in the masked version of the contents of the register, and skipping a subsequent instruction based on the outcome of the testing.
- 10. The method of claim 9 wherein skipping the subsequent instruction comprises replacing the subsequent instruction with a no operation instruction.
- 11. A system, comprising:
a main processor unit; and a co-processor coupled to said main processor unit, wherein said co-processor executes an instruction that includes an immediate value and a reference to a register accessible to said co-processor, performs a comparison using the immediate value and the register value, and executes or skips a subsequent instruction based on the comparison.
- 12. The system of claim 11 wherein the co-processor performs the comparison by comparing the immediate value to the register value in the referenced register.
- 13. The system of claim 12 wherein the co-processor does not execute the subsequent instruction if the immediate value does not match the register value and executes the subsequent if the immediate value does match the register value.
- 14. The system of claim 11 wherein the co-processor performs the comparison by masking the register value in the referenced register with the immediate value and examining one or more bits in the masked version of the referenced register.
- 15. The system of claim 14 wherein the masking is performed by ANDing the immediate value with the register value.
- 16. The system of claim 11 wherein the instruction includes at least one bit that specifies how the comparison is to be performed.
- 17. The system of claim 16 wherein the bit specifies whether the register reference is to a register from a first group of registers or to a register from a second group of registers, and if a register from the first group of registers is specified by said bit, the comparison is performed by comparing the immediate value to the register value, and, if a register from the second group of registers is specified by said bit, the comparison is performed by masking the register value with the immediate value and examining one or more bits in the masked version of the referenced register.
- 18. The system of claim 11 further comprising wireless communication circuitry and said system comprises a cell phone.
- 19. A programmable logic device comprising;
control logic; and a means for decoding an instruction that includes an immediate value and a reference to a register for performing a comparison using the immediate value and a register value stored in the referenced register, and for causing the processor to execute or not execute a subsequent instruction that follows the instruction based on the comparison.
- 20. The system of claim 19 including means for comparing the immediate value to the register value in the referenced register.
Priority Claims (1)
Number |
Date |
Country |
Kind |
03291910.2 |
Jul 2003 |
EP |
|
CROSS-REFERENCE TO RELATED APPLICATIONS
[0001] This application claims priority to U.S. Provisional Application Serial No. 60/400,391 titled “JSM Protection,” filed Jul. 31, 2002, incorporated herein by reference. This application also claims priority to EPO Application No. 03291910.2, filed Jul. 30, 2003 and entitled “Test With Immediate And Skip Processor Instruction,” incorporated herein by reference. This application also may contain subject matter that may relate to the following commonly assigned co-pending applications incorporated herein by reference: “System And Method To Automatically Stack And Unstack Java Local Variables,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35422 (1962-05401); “Memory Management Of Local Variables,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35423 (1962-05402); “Memory Management Of Local Variables Upon A Change Of Context,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35424 (1962-05403); “A Processor With A Split Stack,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35425(1962-05404); “Using IMPDEP2 For System Commands Related To Java Accelerator Hardware,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35426 (1962-05405); “Test And Skip Processor Instruction Having At Least One Register Operand,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35248 (1962-05407); “Synchronizing Stack Storage,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35429 (1962-05408); “Methods And Apparatuses For Managing Memory,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35430 (1962-05409); “Write Back Policy For Memory,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35431 (1962-05410); “Methods And Apparatuses For Managing Memory,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35432 (1962-05411); “Mixed Stack-Based RISC Processor,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35433 (1962-05412); “Processor That Accommodates Multiple Instruction Sets And Multiple Decode Modes,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35434 (1962-05413); “System To Dispatch Several Instructions On Available Hardware Resources,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35444 (1962-05414); “Micro-Sequence Execution In A Processor,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35445 (1962-05415); “Program Counter Adjustment Based On The Detection Of An Instruction Prefix,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35452 (1962-05416); “Reformat Logic To Translate Between A Virtual Address And A Compressed Physical Address,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35460 (1962-05417); “Synchronization Of Processor States,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35461 (1962-05418); “Conditional Garbage Based On Monitoring To Improve Real Time Performance,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35485 (1962-05419); “Inter-Processor Control,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35486 (1962-05420); “Cache Coherency In A Multi-Processor System,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35637 (1962-05421); “Concurrent Task Execution In A Multi-Processor, Single Operating System Environment,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35638 (1962-05422); and “A Multi-Processor Computing System Having A Java Stack Machine And A RISC-Based Processor,” Ser. No. ______, filed Jul. 31, 2003, Attorney Docket No. TI-35710 (1962-05423).
Provisional Applications (1)
|
Number |
Date |
Country |
|
60400391 |
Jul 2002 |
US |