Control transfer termination instructions of an instruction set architecture (ISA)
In an embodiment, the present invention includes a processor having an execution logic to execute instructions and a control transfer termination (CTT) logic coupled to the execution logic. This logic is to cause a CTT fault to be raised if a target instruction of a control transfer instruction is not a CTT instruction. Other embodiments are described and claimed.
1. A processor comprising:
a fetch unit to fetch instructions;
a decode unit to decode the instructions, the decode unit including a control transfer termination (CTT) logic, the decode unit responsive to a control transfer instruction, to decode the control transfer instruction into a decoded control transfer instruction, and provide the decoded control transfer instruction to an execution unit;
the execution unit to execute decoded instructions, including the decoded control transfer instruction, wherein second state information associated with the decoded control transfer instruction is to indicate that the CTT logic has transitioned from an idle state to a wait state responsive to the decoded control transfer instruction; and
a retirement unit to retire the decoded control transfer instruction,
wherein the processor is to raise an exception if a target instruction of the decoded control transfer instruction is not a CTT instruction, and if the target instruction is not an appropriate type of CTT instruction for the second state information.
2. The processor of claim 1 , wherein the second state information is a two-bit field value.
3. The processor of claim 1 , wherein the second state information is to have a first value for the decoded control transfer instruction and a second different value for a different decoded control transfer instruction.
4. The processor of claim 1 , wherein if the target instruction is an appropriate type of CTT instruction for the second state information the exception is not to be raised.
5. The processor of claim 1 , further comprising a storage to store the second state information.
6. The processor of claim 1 , wherein the control transfer instruction is a call instruction.
7. The processor of claim 1 , wherein the control transfer instruction is a branch instruction.