View
235
Download
0
Category
Preview:
Citation preview
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Chapter 11Chapter 11Reduced Instruction Set Reduced Instruction Set
ComputingComputing
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Chapter OutlineChapter Outline
• RISC RationaleRISC Rationale
• Instruction SetsInstruction Sets
• Instruction PipelinesInstruction Pipelines
• Register WindowsRegister Windows
• Instruction Pipeline ConflictsInstruction Pipeline Conflicts
• RISC vs. CISCRISC vs. CISC
• Itanium MicroprocessorItanium Microprocessor
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Speeding Up Typical CodeSpeeding Up Typical Code
• 100% of instructions @ 20 ns100% of instructions @ 20 ns
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Speeding Up Typical CodeSpeeding Up Typical Code
• 100% of instructions @ 20 ns100% of instructions @ 20 ns
• 98% of instructions @ 18 ns and 2% of 98% of instructions @ 18 ns and 2% of instructions at 3 * 18 nsinstructions at 3 * 18 ns
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Speeding Up Typical CodeSpeeding Up Typical Code
• 100% of instructions @ 20 ns100% of instructions @ 20 ns
• 98% of instructions @ 18 ns and 2% of 98% of instructions @ 18 ns and 2% of instructions at 3 * 18 nsinstructions at 3 * 18 ns
• 100%(20c) P. 98%(18c) + 2% (54c)100%(20c) P. 98%(18c) + 2% (54c)
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Speeding Up Typical CodeSpeeding Up Typical Code
• 100% of instructions @ 20 ns100% of instructions @ 20 ns
• 98% of instructions @ 18 ns and 2% of 98% of instructions @ 18 ns and 2% of instructions at 3 * 18 nsinstructions at 3 * 18 ns
• 100%(20c) P. 98%(18c) + 2% (54c)100%(20c) P. 98%(18c) + 2% (54c)
• 20c vs. 17.64c + 1.08c20c vs. 17.64c + 1.08c
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Speeding Up Typical CodeSpeeding Up Typical Code
• 100% of instructions @ 20 ns100% of instructions @ 20 ns
• 98% of instructions @ 18 ns and 2% of 98% of instructions @ 18 ns and 2% of instructions at 3 * 18 nsinstructions at 3 * 18 ns
• 100%(20c) P. 98%(18c) + 2% (54c)100%(20c) P. 98%(18c) + 2% (54c)
• 20c vs. 17.64c + 1.08c20c vs. 17.64c + 1.08c
• 20 20 18.72 18.72
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
RISC CharacteristicsRISC Characteristics
• Fixed-length instructionsFixed-length instructions
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
RISC CharacteristicsRISC Characteristics
• Fixed-length instructionsFixed-length instructions
• Limited loading and storing instructionsLimited loading and storing instructions
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
RISC CharacteristicsRISC Characteristics
• Fixed-length instructionsFixed-length instructions
• Limited loading and storing instructionsLimited loading and storing instructions
• Fewer addressing modesFewer addressing modes
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
RISC CharacteristicsRISC Characteristics
• Fixed-length instructionsFixed-length instructions
• Limited loading and storing instructionsLimited loading and storing instructions
• Fewer addressing modesFewer addressing modes
• Instruction pipelineInstruction pipeline
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
RISC CharacteristicsRISC Characteristics
• Fixed-length instructionsFixed-length instructions
• Limited loading and storing instructionsLimited loading and storing instructions
• Fewer addressing modesFewer addressing modes
• Instruction pipelineInstruction pipeline
• Large number of registersLarge number of registers
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
RISC CharacteristicsRISC Characteristics
• Hardwired control unitHardwired control unit
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
RISC CharacteristicsRISC Characteristics
• Hardwired control unitHardwired control unit
• Delayed loads and branchesDelayed loads and branches
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
RISC CharacteristicsRISC Characteristics
• Hardwired control unitHardwired control unit
• Delayed loads and branchesDelayed loads and branches
• Speculative execution of instructionsSpeculative execution of instructions
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
RISC CharacteristicsRISC Characteristics
• Hardwired control unitHardwired control unit
• Delayed loads and branchesDelayed loads and branches
• Speculative execution of instructionsSpeculative execution of instructions
• Optimizing compilersOptimizing compilers
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
RISC CharacteristicsRISC Characteristics
• Hardwired control unitHardwired control unit
• Delayed loads and branchesDelayed loads and branches
• Speculative execution of instructionsSpeculative execution of instructions
• Optimizing compilersOptimizing compilers
• Separate instruction and data streamsSeparate instruction and data streams
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
RISC Instruction SetsRISC Instruction Sets
• Fewer instructionsFewer instructions
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
RISC Instruction SetsRISC Instruction Sets
• Fewer instructionsFewer instructions
• Executed in one clock cycleExecuted in one clock cycle
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
RISC Instruction SetsRISC Instruction Sets
• Fewer instructionsFewer instructions
• Executed in one clock cycleExecuted in one clock cycle
• Orthogonal, but not too orthogonalOrthogonal, but not too orthogonal– A OR B = NOT((NOT A) AND (NOT B))A OR B = NOT((NOT A) AND (NOT B))– A XOR B = (A AND (NOT B)) OR ((NOT A) A XOR B = (A AND (NOT B)) OR ((NOT A)
AND B)AND B)
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
MIPS 4000 Instruction TypesMIPS 4000 Instruction Types
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
SPARC Instruction FormatsSPARC Instruction Formats
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Instruction PipelinesInstruction Pipelines
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Instruction PipelinesInstruction Pipelines
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Instruction PipelinesInstruction Pipelines
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Instruction PipelinesInstruction Pipelines
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Instruction PipelinesInstruction Pipelines
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Instruction PipelinesInstruction Pipelines
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Instruction Pipeline Instruction Pipeline AdvantagesAdvantages
• Reduced hardwareReduced hardware
• Reduced clock periodReduced clock period
• Reduced complexity of memory Reduced complexity of memory interfaceinterface
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Pipeline Clock RatePipeline Clock Rate
• Limited by slowest stageLimited by slowest stage
• Speedup:Speedup:
• Example: Example:
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Register WindowingRegister Windowing
• Global RegistersGlobal Registers
• Windowed RegistersWindowed Registers
• Window Data RegisterWindow Data Register
• Window Pointer RegisterWindow Pointer Register
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Register WindowingRegister Windowing
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Register WindowingRegister Windowing
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Register WindowingRegister Windowing
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Register WindowingRegister Windowing
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Register RenamingRegister Renaming
• Arbitrary registers instead of fixed Arbitrary registers instead of fixed windowswindows
• More flexible, but harder to controlMore flexible, but harder to control
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Instruction Pipeline ConflictsInstruction Pipeline Conflicts
• Data conflictsData conflicts
• Branch conflictsBranch conflicts
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Data ConflictsData Conflicts
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Data ConflictsData Conflicts
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
No-op InsertionNo-op Insertion
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
No-op InsertionNo-op Insertion
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Instruction ReorderingInstruction Reordering
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Instruction ReorderingInstruction Reordering
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Instruction ReorderingInstruction Reordering
• Not always possibleNot always possible
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Stall InsertionStall Insertion
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Stall InsertionStall Insertion
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Data ForwardingData Forwarding
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Data ForwardingData Forwarding
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Data ForwardingData Forwarding
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Branch ConflictsBranch Conflicts
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Branch ConflictsBranch Conflicts
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
No-op InsertionNo-op Insertion
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
No-op InsertionNo-op Insertion
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Instruction ReorderingInstruction Reordering
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Instruction ReorderingInstruction Reordering
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Conditional BranchesConditional Branches
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
No-op InsertionNo-op Insertion
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Instruction ReorderingInstruction Reordering
• Ignoring the data conflict:Ignoring the data conflict:
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Instruction ReorderingInstruction Reordering
• Ignoring the data conflict:Ignoring the data conflict:
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Instruction ReorderingInstruction Reordering
• Ignoring the data conflict:Ignoring the data conflict:
• Not always possible to reorder Not always possible to reorder instructions - sometimes must resort to instructions - sometimes must resort to no-op insertionno-op insertion
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
AnnullingAnnulling
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
AnnullingAnnulling
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Branch PredictionBranch Prediction
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
RISC AdvantagesRISC Advantages
• Simpler control unitsSimpler control units
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
RISC AdvantagesRISC Advantages
• Simpler control unitsSimpler control units
• Can run at higher clock frequenciesCan run at higher clock frequencies
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
RISC AdvantagesRISC Advantages
• Simpler control unitsSimpler control units
• Can run at higher clock frequenciesCan run at higher clock frequencies
• More chip space for registersMore chip space for registers
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
RISC AdvantagesRISC Advantages
• Simpler control unitsSimpler control units
• Can run at higher clock frequenciesCan run at higher clock frequencies
• More chip space for registersMore chip space for registers
• Easier to incorporate parallelismEasier to incorporate parallelism
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
RISC AdvantagesRISC Advantages
• Simpler control unitsSimpler control units
• Can run at higher clock frequenciesCan run at higher clock frequencies
• More chip space for registersMore chip space for registers
• Easier to incorporate parallelismEasier to incorporate parallelism
• Simpler compilersSimpler compilers
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
CISC AdvantagesCISC Advantages
• Complexity doesnComplexity doesn’’t always increase t always increase costcost
• Can incorporate previous designsCan incorporate previous designs
• Backward compatibilityBackward compatibility
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Itanium MicroprocessorItanium Microprocessor
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Itanium MicroprocessorItanium Microprocessor
• IA-64 ISAIA-64 ISA
• Explicitly Parallel Instruction ComputingExplicitly Parallel Instruction Computing
• PredicationPredication
• Speculative ExecutionSpeculative Execution
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
PredicationPredication
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
PredicationPredication
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Speculative ExecutionSpeculative Execution
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Speculative ExecutionSpeculative Execution
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001 Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
SummarySummary
• RISC RationaleRISC Rationale
• Instruction SetsInstruction Sets
• Instruction PipelinesInstruction Pipelines
• Register WindowsRegister Windows
• Instruction Pipeline ConflictsInstruction Pipeline Conflicts
• RISC vs. CISCRISC vs. CISC
• Itanium MicroprocessorItanium Microprocessor
Recommended