ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalCOMP3147Deferred Exceptions Pr…
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    COMP3147

    Computer Architecture

    Progress0 / 24 done
    Topics24
    1Transistors and Digital logic2Hardware description languages (Verilog)
    3Instruction types and mixes4Addressing modes5RISC vs. CISC architectures6Exceptions in instruction sets
    7Data dependencies8Static scheduling9Pipeline performance analysis
    10Local scheduling11Loop unrolling and Software pipelining12Trace scheduling13Deferred exceptions and Predicated execution14IA64 architecture
    15Dynamical scheduling16Register renaming17Speculative execution18Trace cache
    19Cache coherency20Sequential consistency21Multithreading22Symmetric multiprocessing23Transactional memory
    24GPU programming
    3 min read
    Topic 13 of 24
    Topic Study Note Illustration
    13

    Deferred exceptions and Predicated execution

    A deferred exception (also called precise or delayed exception ) is an exception detected during instruction execution but reported later , allowing the processor to maintain precise...

    ⭐ 1. Deferred Exceptions

    Definition

    A deferred exception (also called precise or delayed exception) is an exception detected during instruction execution but reported later, allowing the processor to maintain precise program state.

    The processor continues executing instructions after detecting a potential exception but delays handling it until a safe point where the program state reflects a sequential execution.


    Purpose

    • To ensure precise exceptions, meaning:

      1. All instructions before the faulting instruction appear to have executed.
      2. The faulting instruction is the next instruction to execute.
      3. Instructions after the faulting instruction have not executed (from the program’s perspective).
    • Important for pipelines and out-of-order execution, where multiple instructions are in flight.


    Example

    Consider a pipeline executing instructions:

    I1: R1 = A + B
    I2: R2 = C / D      <- division by zero occurs
    I3: R3 = R1 + R2
    
    • Without deferred exceptions: Exception may occur immediately, leaving I1 complete but I3 partially executed → imprecise state.

    • With deferred exceptions:

      • Pipeline allows I3 and other independent instructions to execute.
      • Exception for I2 is reported only when it is safe, ensuring precise state.

    Key idea: The program behaves as if instructions executed sequentially, even in a pipelined or out-of-order processor.


    Advantages

    1. Maintains precise exceptions in pipelines.
    2. Enables out-of-order execution without corrupting program state.
    3. Simplifies debugging and OS exception handling.

    Implementation Notes

    • Requires hardware support to record instruction addresses and state.
    • Exception handling may use a reorder buffer (ROB) in modern CPUs.
    • Common in RISC, superscalar, and VLIW architectures.

    ⭐ 2. Predicated Execution

    Definition

    Predicated execution (or conditional execution) is a technique where instructions are executed conditionally based on a Boolean predicate, rather than using explicit branches.

    Each instruction has an associated predicate (true/false); the instruction only updates state if the predicate is true.


    Purpose

    1. Reduce control hazards in pipelines by minimizing branches.
    2. Increase instruction-level parallelism (ILP) in VLIW or superscalar processors.
    3. Simplify pipeline scheduling in deeply pipelined architectures.

    Example

    Consider a conditional block:

    if (x > 0) {
        A = B + C;
    } else {
        D = E + F;
    }
    

    Without Predication:

    • Branch instruction required → pipeline may stall.

    With Predication:

    • Convert to predicated instructions:
    p1 = (x > 0)       ; predicate
    A = B + C if p1
    D = E + F if !p1
    
    • No branch; all instructions issued in parallel.
    • Instructions not meeting the predicate do not update registers/memory.

    Advantages of Predicated Execution

    1. Reduces branch misprediction penalties.
    2. Enables more instructions to execute in parallel, especially in VLIW.
    3. Simplifies loop unrolling and software pipelining.

    Limitations

    1. Predicated instructions still occupy pipeline resources, even if predicate is false.
    2. Limited predicate registers in hardware.
    3. Not suitable for large conditional blocks (code expansion may occur).

    ⭐ Comparison

    Feature Deferred Exceptions Predicated Execution
    Purpose Ensure precise exception reporting Reduce branches and control hazards
    When applied During exceptions in pipelines During normal instruction execution
    Control flow effect Postpones exception handling Conditionally executes instructions
    Hardware support Reorder buffer, pipeline tracking Predicate registers
    Benefit Maintains sequential program correctness Increases ILP, reduces stalls

    ⭐ Exam Summary

    • Deferred Exceptions: Delay exception handling until safe program state is reached; critical for pipelines and out-of-order execution.
    • Predicated Execution: Execute instructions conditionally based on a predicate instead of branching; reduces pipeline stalls and control hazards.
    ← Previous topic 12
    Trace scheduling
    Next topic 14 →
    IA64 architecture

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    3mremaining
    552words
    Beginnerlevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Computer Architecture