[0011] The present technique recognises that for a large number of blocks of program instructions that can advantageously be the subject of calls from different points within a program, the return instruction represents a significant overhead. Combined with this is the realisation that such small blocks of program instructions rarely need to include therein branch instructions such that when they are started they will with a high degree of probability always be run to their conclusion, i.e. result in a fixed number of program instructions being fetched and executed. Accordingly, the execute block instruction provided by the present technique specifies within the execute block instruction both the location of the block of program instructions to be executed as well as the length of that block of program instructions. Accordingly, there is no need for the block of program instructions to include a return instruction, since the length of the block is already known as specified within the execute block instruction and the return to the main program can be triggered when the final instruction within the block of program instructions has been executed. This execute block instruction extends the advantages of program instruction calls to small blocks of program instructions. The technique is also particularly well suited to use by program compilers which can identify frequently occurring small blocks of instructions within a program image and replace these by execute block instructions. The occurrence of a block in the normal code can be used as the target of branch instructions without the need to separately store the block of instructions elsewhere.
[0013] Accordingly, execute block instruction logic is provided which stores an indication of a memory location of an instruction following the execute block instruction. The execute block instruction logic determines when the last instruction in the block of two or more program instructions is being processed. When it is determined that the last instruction in the block of two or more program instructions is being processed then an indication of the memory location of an instruction following the execute block instruction is provided to the instruction fetching circuit. Providing the indication of the memory location of the instruction following the execute block instruction to the instruction fetching circuit causes the fetch unit to fetch that instruction. It will be appreciated that in some fetch units which take multiple cycles to fetch instructions or where the fetch unit fetches blocks of instructions, one or more instructions linearly following the last instruction may still be fetched by the fetch unit but these instructions will not be executed. In this way, the correct sequence of instructions is fetched by the fetch unit which avoids the need to flush instructions, with all the attendant performance implications which result from such flushing. Hence, it will be appreciated that the provision of the execute block logic enables the execute block instruction to be implemented in an efficient manner whilst minimising the degree of any architectural changes which may be required.
[0015] Accordingly, execute block instruction logic is provided which stores an indication of a memory location of an instruction pointed to by the location field within the execute block instruction. The execute block instruction logic determines when the execute block instruction is being processed. When it is determined that the execute block instruction is being processed then an indication of the memory location of the instruction referred to by the execute block instruction is provided to the instruction fetching circuit. Providing the indication of the memory location of the instruction referenced to the execute block instruction to the instruction fetching circuit causes the fetch unit to fetch that instruction. As mentioned previously, in fetch units which take multiple cycles to fetch instructions or where the fetch unit fetches blocks of instructions, one or more instructions sequentially following the execute block instruction may still be fetched by the fetch unit but these instructions will not be executed. In this way, the correct sequence of instructions is fetched by the fetch unit which avoids the need to flush instructions, with all the attendant performance implications which result from such flushing.
[0028] In embodiments, the interrupt handling logic prevents the pushing of the indication of the memory location of the instruction following the execute block instruction onto the return stack in response to the execute block instruction being processed following the interrupt.
[0029] Preventing the pushing the indication of the memory location of the instruction following the execute block instruction onto the return stack following completion of the handling of the interrupt prevents duplication (of the entry corresponding to the EMB instruction) on the return stack which would otherwise occur and result in non-optimal operation.
[0033] Accordingly, when reusing existing hardware which prevents non-branch instructions from causing the prediction logic determining whether a target memory address is associated therewith, prediction prevention override logic is provided which overrides this restriction on when the last instruction in the block is being processed which enables this instruction to be treated in a manner analogous to a branch instruction despite there being no decoded control signals would be associated with that instruction to indicate this.