1. A processor core, having an execution unit for processing instructions, comprising: a programmable mask register; a buffer that stores values representing a sequence of instructions; and control logic to determine whether there is a match between a sequence in the mask register and the sequence in the buffer and, upon detecting a match, to generate control signals to perform a desired action.