主权项 |
1. A computer program product for executing a machine instruction, the computer program product comprising:
a non-transitory computer readable storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method comprising:
obtaining, by a processor, a machine instruction for execution, the machine instruction being defined for computer execution according to a computer architecture, the machine instruction comprising:
at least one opcode field for specifying an opcode, the opcode defining a branch operation, wherein the machine instruction is a branch machine instruction;at least one field for determining a target location in which to branch; anda type indication to specify a type of the branch operation, wherein the type indication specifies how the branch operation is to be processed in this execution of the machine instruction, wherein in another execution of the same branch operation it is processed differently, and wherein the type indication is configured to specify the following types of execution: a minor branch in which the machine instruction is executed in a first stream of processing and the branch operation does not cause a second stream of processing to be started, a major branch open in which the machine instruction is executed in the first stream of processing and the branch operation causes the second stream of processing to be started, and a major branch close in which processing of the first stream of processing meets up with processing of the second stream of processing; andexecuting the branch machine instruction, the executing being based on the type indication specifying the major branch open, the branch machine instruction being executed in the first stream of processing, the executing comprising:
starting the second stream of processing, the second stream of processing having a relationship with the first stream of processing and sharing hardware resources of the first stream of processing, wherein architectural state of the first stream of processing is referenced by the second stream of processing;determining, based on starting the second stream of processing, whether a transaction is to be started for the second stream of processing, the transaction being defined as having results of instructions that are executed as part of the transaction being committed as one atomic unit, and wherein the determining comprises checking a field of the branch machine instruction to determine whether a start of the transaction is indicated;based on determining that the transaction is to be started, starting the transaction for the second stream of processing, the transaction to include one or more instructions beginning at the target location defined using the at least one field of the branch machine instruction, the one or more instructions being out of sequential execution order from one or more instructions being processed by the first stream of processing, the first stream of processing continuing to process one or more instructions subsequent to the branch machine instruction, and wherein results of the one or more instructions of the second stream of processing executed as part of the transaction are committed as one atomic unit, and wherein the transaction does not end until the first stream of processing reaches a predefined point in processing and the second stream of processing is to become the first stream of processing;wherein execution of the second stream of processing is speculative in that at least one instruction of the one or more instructions of the second stream of processing is executed even though reaching the at least one instruction of the second stream of processing by processing of the first stream is tentative; andobtaining by the processor another machine instruction, the other machine instruction having the type indication, the type indication of the other machine instruction specifying the major branch close indicating processing of the first stream of processing has caught up with the target of the major branch open, and wherein execution of the major branch close comprises ending the transaction of the second stream of processing, making the second stream of processing the first stream of processing, and updating state to reflect the transaction. |