1 Multiple Instruction Issue Multiple instructions issued each cycle149a processor that can execute more than one instruction per cycleissue width the number of issue slots149not all types of i ID: 269108
Download Pdf The PPT/PDF document "Autumn 2006CSE P548 -Multiple Instructio..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
1 Autumn 2006CSE P548 -Multiple Instruction Width Multiple Instruction Issue Multiple instructions issued each cyclea processor that can execute more than one instruction per cycleissue width= the number of issue slotsnot all types of instructions can be issued togetheran example: 2 ALUs, 1 load/store unit, 1 FPU1 ALU does shifts & integer multiplies; the other executes branchesincrease instruction throughputdecrease in CPI (below 1)greater hardware complexity, potentially longer wire lengthsharder code scheduling job for the compiler Autumn 2006CSE P548 -Multiple Instruction Width Superscalars Require:instruction fetchfetching of multiple instructions at oncedynamic branch prediction & fetching speculatively beyond conditional branchesinstruction issuemethods for determining which instructions can be issued nextthe ability to issue multiple instructions in parallelinstruction commitmethods for committing several instructions in fetch orderduplicate & more complex hardware 2 Autumn 2006CSE P548 -Multiple Instruction Width 2-way Superscalar Autumn 2006CSE P548 -Multiple Instruction Width Multiple Instruction Issue Superscalar processorsinstructions are scheduled for execution by the hardwaredifferent numbers of instructions may be issued simultaneously(very long instruction word) processorsinstructions are scheduled for execution by the compilera fixed number of operations are formatted as one big instructionusually LIW(3 operations) today 3 Autumn 2006CSE P548 -Multiple Instruction Width In-order vs. Out-of-order Execution In-order instruction executioninstructions are fetched, executed & committed in compiler-generated orderif one instruction stalls, all instructions behind it stallinstructions are statically scheduledby the hardwarescheduled in compiler-generated orderhow many of the next instructions can be issued, where the superscalar issue widthsuperscalars can have hazards within the advantage of in-order instruction scheduling: simpler implementation faster clock cycle fewer transistors faster design/development/debug time Autumn 2006CSE P548 -Multiple Instruction Width In-order vs. Out-of-order Execution Out-of-order instruction executioninstructions are fetched in compiler-generated orderinstruction completion may be in-order (today) or out-of-order (older in between they may be executed in some other orderinstructions are dynamically scheduledby the hardwarehardware decides in what order instructions can be executedinstructions behind a stalled instruction can pass itadvantages: higher performancebetter at hiding latencies, less processor stallinghigher utilization of functional units 4 Autumn 2006CSE P548 -Multiple Instruction Width In-order instruction issue: Alpha 21164 2 styles of static instruction schedulingdispatch buffer & instruction slotting (Alpha 21164)shift register model (UltraSPARC-1) Autumn 2006CSE P548 -Multiple Instruction Width In-order instruction issue: Alpha 21164 Instruction slottingcan issue up to 4 instructionscompletely empty the instruction buffer before fill it againcompiler can pad with sso a conflicting instructions are issued with the following instructions, not alonecan be no data dependences in same issue cycle (some exceptions)hardware to:detect data hazardscontrol bypass logic 5 Autumn 2006CSE P548 -Multiple Instruction Width 21164 Instruction Unit Pipeline Fetch & issue:instruction fetchbranch prediction bits read:opcode decodetarget address calculationif predict taken, redirect the fetchinstruction slotting: decide which of the next 4 instructions can be issuedintra-cycle structural hazard checkintra-cycle data hazard checkinstruction dispatchinter-cycle load-use hazard checkregister read Autumn 2006CSE P548 -Multiple Instruction Width 21164 Integer Pipeline Execute(2 integer pipelines):integer executioneffective address calculation:conditional move & branch executiondata cache access:register writealso a 9-stage FP pipeline 6 Autumn 2006CSE P548 -Multiple Instruction Width Autumn 2006CSE P548 -Multiple Instruction Width In-order instruction issue: UltraSparc 1 Shift register modelcan issue up to 4 instructions per cycleshift in new instructions after every group of instructions is issuedsome data dependent instructions can issue in same cycle 7 Autumn 2006CSE P548 -Multiple Instruction Width UltraSPARC 1 Autumn 2006CSE P548 -Multiple Instruction Width 8 Autumn 2006CSE P548 -Multiple Instruction Width Superscalars Performance impact:increase performance because execute multiple instructions in parallel, not just overlappedCPI potentially 1 (.5 on our R3000 example)IPC (instructions/cycle) potentially-400; 1 (2 on our R3000 example)better functional unit utilizationneed to fetch more instructions how many?need independent instructions why?need a good local mix of instructionswhy?need more instructions to hide load delays why?need to make better branch predictions why? Autumn 2006CSE P548 -Multiple Instruction Width Code Scheduling on Superscalars Original code, 0(R5)addu , R6, 0(R5)addi R5, R5, -4bne R5, R0, Loop 9 Autumn 2006CSE P548 -Multiple Instruction Width Code Scheduling on Superscalars ALU/branch instructions memory instructions clock cycle Loop: 1 2 3 4 With latency-hiding code scheduling, 0(s1)addi R5, R5, -4addu , R6(R5)bne R5, $0, LoopOriginal code, 0(R5)addu , R6, 0(R5)addi R5, R5, -4bne R5, R0, Loop Autumn 2006CSE P548 -Multiple Instruction Width Code Scheduling on Supe What is the cycles per iteration?What is the IPC?Loop unrolling ALU/branch instructions Memory instructions clock cycle Loop: addi R5, R5, -16 lw R1, 0(R5) 1 lw R2, (R5) 2 addu R1, R1, R6 lw R3, (R5) 3 addu , R6 lw R4, (R5) 4 addu , R6 sw R1, (R5) 5 addu , R6 sw R2, (R5) 6 sw R3, (R5) 7 bne R5, R0, Loop sw R4, (R5) 8 10 Autumn 2006CSE P548 -Multiple Instruction Width Superscalars Hardware impact:more & pipelined functional unitsmulti-ported registers for multiple register accessmore buses from the register file to the additional functional unitsmultiple decodersmore hazard detection logicmore bypass logicwider instruction fetchmulti-banked L1 data cacheor else the processor has structural hazards (due to an unbalanced design) and stallingThe restrictions on instruction types that can be issued together help to reduce the amount of hardware.Static (compiler) scheduling helps. Autumn 2006CSE P548 -Multiple Instruction Width Modern Superscalars Alpha 21364: 4 instructionsPentium IV: 5 RISClike operations dispatched to functional unitsR12000: 4 instructionsUltraSPARC-3: 6 instructions dispatched