Classifying Instruction Set Architectures

Slides:



Advertisements
Similar presentations
Review of the MIPS Instruction Set Architecture. RISC Instruction Set Basics All operations on data apply to data in registers and typically change the.
Advertisements

Chapter 3 Instruction Set Architecture Advanced Computer Architecture COE 501.
CEG3420 Lec2.1 ©UCB Fall 1997 ISA Review CEG3420 Computer Design Lecture 2.
ISA Issues; Performance Considerations. Testing / System Verilog: ECE385.
1 Lecture 3: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation.
Lecture 3: Instruction Set Principles Kai Bu
EECC551 - Shaaban #1 Lec # 2 Fall Instruction Set Architecture (ISA) “... the attributes of a [computing] system as seen by the programmer,
1 ECE462/562 ISA and Datapath Review Ali Akoglu. 2 Instruction Set Architecture A very important abstraction –interface between hardware and low-level.
Some Other Instruction Set Architectures. Overview Alpha SPARC i386.
CS1104 – Computer Organization PART 2: Computer Architecture Lecture 5 MIPS ISA & Assembly Language Programming.
ELEN 468 Advanced Logic Design
Fall EE 333 Lillevik 333f06-l4 University of Portland School of Engineering Computer Organization Lecture 4 Assembly language programming ALU and.
C Programming and Assembly Language Janakiraman V – NITK Surathkal 2 nd August 2014.
Recap Measuring and reporting performance Quantitative principles Performance vs Cost/Performance.
Informationsteknologi Saturday, September 29, 2007 Computer Architecture I - Class 41 Today’s class More assembly language programming.
COMP381 by M. Hamdi 1 Instruction Set Architectures.
Computer Architecture Lecture 5 Design Decisions for a 64-bit RISC Architecture Source of almost all Slide: Text Book.
CIS429/529 ISA - 1 Instruction Set Architectures Classification Addressing Modes Types of Instructions Encoding Instructions MIPS64 Instruction Set.
Memory - Registers Instruction Sets
Recap.
CIS429.S00: Lec7- 1 Instruction Set Architectures (cont) History Addressing Modes --> Types of Instructions --> Encoding Instructions --> DLX Instruction.
Computer Organization Instruction Sets Reading: Portions of these slides are derived from: Textbook figures © 1998 Morgan Kaufmann Publishers all.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 3 - Instruction.
Classifying Instruction Set Architectures
ECE 232 L5 Assembl.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 5 MIPS Assembly.
CPE442 Lec 3 ISA.1 Intro to Computer Architectures Instruction Set Design instruction set software hardware.
Instruction Set Design by Kip R. Irvine (c) Kip Irvine, All rights reserved. You may modify and copy this slide show for your personal use,
CPE442 Lec 3 ISA.1 Intro to Computer Architectures Instruction Set Design instruction set software hardware.
Caltech CS184b Winter DeHon 1 CS184b: Computer Architecture [Single Threaded Architecture: abstractions, quantification, and optimizations] Day3:
Mohamed Younis CMCS 411, Computer Architecture 1 CMCS Computer Architecture Lecture 5 Addressing Mode & Architectural Design Guidelines February.
1 Copyright © 2011, Elsevier Inc. All rights Reserved. Appendix A Authors: John Hennessy & David Patterson.
1 Appendix B Classifying Instruction Set Architecture Memory addressing mode Operations in the instruction set Control flow instructions Instruction format.
Classifying GPR Machines TypeNumber of Operands Memory Operands Examples Register- Register 30 SPARC, MIPS, etc. Register- Memory 21 Intel 80x86, Motorola.
Lecture 4: MIPS Subroutines and x86 Architecture Professor Mike Schulte Computer Architecture ECE 201.
1 (Based on text: David A. Patterson & John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 3 rd Ed., Morgan Kaufmann,
1 Appendix A: Instruction Set Principles and Examples Classifying Instruction Set Architecture Memory addressing mode Operations in the instruction set.
1. 2 Instructions: Words of the language understood by CPU Instruction set: CPU’s vocabulary Instruction Set Architecture (ISA): CPU’s vocabulary together.
Instruction Set Architecture The portion of the machine visible to the programmer Issues: Internal storage model Addressing modes Operations Operands Encoding.
Microprocessors The ia32 User Instruction Set Jan 31st, 2002.
26-Nov-15 (1) CSC Computer Organization Lecture 6: Pentium IA-32.
Lecture 11: 10/1/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Oct. 25, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 9: Alternative Instruction Sets * Jeremy R. Johnson Wed. Oct. 25, 2000.
Csci 136 Computer Architecture II – Summary of MIPS ISA Xiuzhen Cheng
Lecture 04: Instruction Set Principles Kai Bu
CS 211: Computer Architecture Lecture 2 Instructor: Morris Lancaster.
Next Generation ISA Itanium / IA-64. Operating Environments IA-32 Protected Mode/Real Mode/Virtual Mode - if supported by the OS IA-64 Instruction Set.
Instruction Sets: Addressing modes and Formats Group #4  Eloy Reyes  Rafael Arevalo  Julio Hernandez  Humood Aljassar Computer Design EEL 4709c Prof:
What is a program? A sequence of steps
Computer Organization Instructions Language of The Computer (MIPS) 2.
Lecture 6: Instruction Set Architecture Computer Engineering 585 Fall 2001.
1/11/02CSE ISA's part 2 Instruction Set Architectures Part 2 I/O systemInstr. Set Proc. Compiler Operating System Application Digital Design Circuit.
Instruction Set Principles
MIPS Instruction Set Advantages
Chapter 11 Instruction Sets
ELEN 468 Advanced Logic Design
RISC Concepts, MIPS ISA Logic Design Tutorial 8.
Lecture 04: Instruction Set Principles
Appendix A Classifying Instruction Set Architecture
CS170 Computer Organization and Architecture I
MIPS Procedure Calls CSE 378 – Section 3.
Instruction encoding The ISA defines Format = Encoding
Classification of instructions
Computer Instructions
Chapter 2. Instruction Set Principles and Examples
Instruction Set Principles
Dr Hao Zheng Computer Sci. & Eng. U of South Florida
Execution time Execution Time (processor-related) = IC x CPI x T
Lecture 4: Instruction Set Design/Pipelining
Presentation transcript:

Classifying Instruction Set Architectures Stack Register- Register Register – Memory Accumulator Memory – Memory

Stack The code C=A+B Push A Push B Add Pop C

Accumulator The Code C=A+B Load A Add B Store C

Register-Memory The Code C=A+B Load R1,A Add R3,R1,B Store R3,C

Load-Store/ Register-register Code C=A+B Load R1,A Load R2,B Add R3,R1,R2 Store R3,C Virtually every new architecture design after 1980 uses load-store register architecture!

ANOTHER EXAMPLE A = B + C B = A + C D = A – B Assumptions: Op Code is 8 bit represented by O, Address is 16-bit represented by A. All registers and data is 32-bit.

EXAMPLE: Accumulator Instruc Comments Size of Operand Code MemoryUsage Bytes MemoryUsage Load B accumulator  B O+A 3 4 Add C accumulator  B + C Store A store B + C in [A] Add C accumulator  A + C Store B store A + C in B Negate negate accumulator O 1 Add A accumulator  B + A Store D store A – B in D Total = 22 28

Example: Mem to Mem Instruction Comments Size of Operand Code Bytes Memory Usage add A, B, C ; MEM[A] = MEM[B] + MEM[C] O+A+A+A 7 12 add B, A, C ; MEM[B] = MEM[A] + MEM[C] sub D, A, B ; MEM[D] = MEM[A] – MEM[B] Total = 21 36

Load-Store Instruc Comments Size of Operand Code Memory Usage 4 3 R= Reg Field (4-bit) Code ≈ Bytes Memory Usage Bytes LW R1, B R1  MEM[B] O+A+R = 28bits 4 LW R2, C R2  MEM[C] ADD R3, R1, R2 R3  B + C O+R+R+R = 20bits 3 SW A, R3 MEM[A] = B + C ADD R1, R3, R2 R1  A + C SW B, R1 MEM[B] = A + C SUB R4, R3, R1 R4  A – B SW D, R4 MEM[D] = A – B Total = 29 20

STACK Instruc Comments Size of Operand Code Memory Usage Push B O+A 3 Bytes Memory Usage Push B ; push B onto stack O+A 3 4 Push C ; push C onto stack Add ; top <- B + C O 1 Pop A ; A = B + C Push A ; push A onto stack ; top <- A + C Pop B ; B = A + C ; push A onto stack ; push B onto stack Sub ; top <- A – B Pop D ; D = A – B Total = 30 36

Example: Reg – Mem Instruction Comments Size of Operand Total = 40 20 R = Reg Spec (1 Byte) Code Bytes Memory Usage Mov ECX, DWORD PTR [C] Mov C to ECX O+A+R 6 4 ADD EBX, DWORD PTR [B] B= B+C Mov EDX, EBX Temp Save O+R 2 Mov EAX,EBX A = B+C Mov DWORD PTR [A], EAX Save A O+A ADD EAX, ECX A+C Mov EBX,EAX B = A+C Mov DWROD PTR [B], EBX Save B SUB EDX, EBX D = A - B Mov DWORD PTR [D], EDX Save D Total = 40 20

Conclusion Architecture Instruction Memory Accesses (in bytes) Data Memory Accesses (In bytes) Total Accumulator 22 28 50 Memory/Memory 21 36 57 Stack 30 66 Load/Store 29 20 49 Reg-Mem(Intel) 40 60

Pros & Cons… Advantages Disadvantages Type Instruction Encoding Code Generation # of Clock Cycles/ Inst. Code Size Register-register Fixed-length Simple Similar Large Register-memory Variable Length Moderate Different Medium Memory-memory Variable-length Complex Large variation Compact Advantages Disadvantages Source: Louisiana state University, ece

Addressing Modes

Addressing Modes

Summery of use of memory addressing mode Displacement 10% 20% 30% 40% 50% Frequency of the addressing mode 0% Tex Spice gcc 1% 6% 16% 24% 3% 11% 17% 43% 39% 32% 55% Memory indirect Scaled Register Indirect Immediate Summary of memory addressing mode

Size of Displacement Percentage of Displacement 45% 40% Percentage of Displacement 35% 30% 25% 20% 15% 10% 5% 0% 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Number of Bits needed for Displacement

Use of Immediate Operand

Immediate Addressing Mode- Displacement distribution 45% 40% Percentage of Immediate 35% 30% 25% 20% 15% 10% 5% 0% 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Number of Bits needed for Immediate Operand

Instruction Type

Distribution by benchmark size Double Word (64 bits) Word (32 bits) 10% 20% 30% 40% 50% 0% Half word (16bits) Byte (8bits) 16% 6% 29% 26% 5% 1% Distribution of data accesses by size of benchmark 60% 70% 80% Floating point average Integer average

Instructions for Control Flow The Measurements of branch and jump behavior are fairly independent of other measurements and applications. Four types of control flow change: Conditional branches Jumps Procedure calls Procedure returns

Three classes of control flow instructions Conditional Branch 100% Call/return Jump 25% 50% 8% 19% 10% 6% 82% 75% Control Flow instructions into three classes Floating point average Integer average

Addressing modes for flow control instructions Destination address of a control flow must be specified Destination is specified by supplying a displacement that is added to the Program Counter (PC) This type of flow control instructions are called PC-relative. This way code can run independent of where it is loaded; this is called position independence

Addressing modes for flow control instructions Implement returns and indirect jumps when target I not known at compile time. These register indirect jumps are important for other features: Case or switch statements Virtual functions or methods High order functions Dynamically shared libraries

Branch distances in terms of number of instructions

Conditional branch options Conditional Code (CC) register E.g. 80x86,ARM etc. Tests special bit set by ALU operations Advantage Sometimes condition is set free Disadvantage CC is extra state. Condition codes constrain the ordering of instructions since they pass information from one instruction to a branch

Conditional branch options Conditional Register E.g. Alpha, MIPS Tests arbitrary register with the result of a comparison Advantage Simple Disadvantage Uses up register

Conditional branch options Compare and branch E.g. PA-RISC, VAX Compare is part of the branch. Often compare is limited to subset Advantage One instruction rather than two for a branch Disadvantage May be too much work per instruction for pipelined execution

Types of compares in conditional branching Less than Greater than or equal 10% 50% 0% 44% 33% 34% 35% Frequency of comparison types in braches Floating point average Integer average 20% 30% 40% Less than or equal Equal Not Equal 5% 2% 16% 18% 11% Greater than

Encoding an instruction set