A method of handling instructions in a data processing apparatus, the data processing apparatus including processing circuitry configured to execute a sequence of instructions, the processing circuitry having a plurality of processor states, each processor state having a different instruction set associated therewith, the method comprising the steps of:
- retrieving instructions from memory and performing a pre-decoding operation on those instructions to generate corresponding pre-decoded instructions, a speculative processor state being assumed when performing the pre-decoding operation;
- storing each pre-decoded instruction in a cache, along with an indication of the speculative processor state assumed by the pre-decoding operation when generating that pre-decoded instruction, the processing circuitry only executing an instruction in the sequence using the corresponding pre-decoded instruction from the cache if a current processor state of the processing circuitry matches the indication of the speculative processor state stored in the cache in association with that corresponding pre-decoded instruction;
- fetching a plurality of instructions from said cache in response to an access request issued by said processing circuitry;
- and
- triggering, in response to one of the plurality of instructions being a state changing instruction which does not cause a branch to occur, a state error for any subsequent instruction in said plurality of instructions, and initiating a fetch operation from the memory starting at a memory address immediately after a memory address of said state changing instruction.