Chapter 4 Predication - PowerPoint PPT Presentation

About This Presentation
Title:

Chapter 4 Predication

Description:

set upon exception raise exception upon access to poisoned register. Hoist Load above Store If memory addresses are known, a load can be hoisted above a store. – PowerPoint PPT presentation

Number of Views:61
Avg rating:3.0/5.0
Slides: 10
Provided by: Richard1730
Learn more at: http://www.cse.msu.edu
Category:

less

Transcript and Presenter's Notes

Title: Chapter 4 Predication


1
Chapter 4Predication
  • CSE 820

2
  • Go over midterm exam

3
Review
  • Predicated instructions have a predicate which
    determines if the instruction will complete
    execution or become a NOP

4
Example
  • if (A0) AB else A A4
  • LD R1,0(R3) load A BNEZ R1,L1 test
    A LD R1,0(R2) then clause J L2 skip else
  • L1 DADDI R1,R1,4 else clause
  • L2 SD R1,0(R3) store A

5
Hoist Load
  • if (A0) AB else A A4
  • LD R1,0(R3) load A LD R14,0(R2)
    speculative load B BEQZ R1,L3 other branch of
    if DADDI R14,R1,4 else clause
  • L3 SD R14,0(R3) store A
  • What if speculative load raises an exception?

6
Guard
  • if (A0) AB else A A4
  • LD R1,0(R3) load A sLD R14,0(R2) speculat
    ive load BNEZ R1,L1 test A SPECCK 0(R2) spe
    culative check J L2 skip else
  • L1 DADDI R14,R1,4 else clause
  • L2 SD R14,0(R3) store A
  • sLD does not raise certain exceptions leaves
    them for SPECCK (IA-64).

7
Other exception techniques
  • Poison bit
  • applied to destination register.
  • set upon exception
  • raise exception upon access to poisoned register.

8
Hoist Load above Store
  • If memory addresses are known, a load can be
    hoisted above a store.
  • If not,
  • add a special instruction to check addresses
    before the loaded value is used.(It is similar
    to SPECCK shown earlier IA-64)

9
Speculation soft vs. hard
  • must be able to disambiguate memory(to hoist
    loads past stores), but at compile time
    information is insufficient
  • hardware works best when control flow is
    unpredictable and when hardware branch prediction
    is superior
  • exception handling is easier in hardware
  • trace techniques require compensation code
  • compilers see further for better scheduling
Write a Comment
User Comments (0)
About PowerShow.com