Since these are unequal the load proceeds to read the

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: e .L3 negl %eax .L3: movl %ebp,%esp popl %ebp ret Get val Test it If >0, goto end Else, negate it end: (a) C code. (b) Assembly code. Figure 5.29: Absolute Value Code We use this to measure the cost of branch misprediction. until the actual outcome has been determined. If the prediction is correct, the processor simply “commits” the results of the speculatively executed instructions by storing them in registers or memory. If the prediction is incorrect, the processor must discard all of the speculatively executed results, and restart the instruction fetch process at the correct location. A significant branch penalty is incurred in doing this, because the instruction pipeline must be refilled before useful results are generated. Once upon a time, the technology required to support speculative execution was considered too costly and exotic for all but the most advanced supercomputers. Since around 1998, integrated circuit technology has made it possible to put so much circuitry on o...
View Full Document

Ask a homework question - tutors are online