Assembly instructions l32 movl edxecx movl ebxedx

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ions from memory, and decoding them to determine what operations to perform on what operands. This instruction pipelining works well as long as the instructions follow in a simple sequence. When a branch is encountered, however, the processor must guess which way the branch will go. For the case of a conditional jump, this means predicting whether or not the branch will be taken. For an instruction such as an indirect jump (as we saw in the code to jump to an address specified by a jump table entry) or a procedure return, this means predicting the target address. In this discussion, we focus on conditional branches. In a processor that employs speculative execution, the processor begins executing the instructions at the predicted branch target. It does this in a way that avoids modifying any actual register or memory locations 250 CHAPTER 5. OPTIMIZING PROGRAM PERFORMANCE 1 2 3 4 5 6 7 8 9 10 11 code/opt/absval.c 1 2 3 4 int absval(int val) { return (val<0) ? -val : val; } code/opt/absval.c absval: pushl %ebp movl %esp,%ebp movl 8(%ebp),%eax testl %eax,%eax jg...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online