Methods and apparatus are disclosed for fusing instructions to provide OR-test and AND-test functionality on multiple test sources. Some embodiments include fetching instructions, said instructions including a first instruction specifying a first
operand destination, a second instruction specifying a second
operand source, and a third instruction specifying a
branch condition. A portion of the plurality of instructions are fused into a single micro-operation, the portion including both the first and second instructions if said first
operand destination and said second operand source are the same, and said
branch condition is dependent upon the second instruction. Some embodiments generate a novel test instruction dynamically by fusing one logical instruction with a prior-art test instruction. Other embodiments generate the novel test instruction through a just-in-time
compiler. Some embodiments also fuse the novel test instruction with a subsequent
conditional branch instruction, and perform a
branch according to how the condition flag is set.