1 Lecture 3: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation.

Slides:



Advertisements
Similar presentations
Instruction Set Design
Advertisements

Review of the MIPS Instruction Set Architecture. RISC Instruction Set Basics All operations on data apply to data in registers and typically change the.
Chapter 3 Instruction Set Architecture Advanced Computer Architecture COE 501.
CEG3420 Lec2.1 ©UCB Fall 1997 ISA Review CEG3420 Computer Design Lecture 2.
CPE 631: Instruction Set Principles and Examples Electrical and Computer Engineering University of Alabama in Huntsville Aleksandar Milenkovic,
1 Instruction Set Principles and Examples 游象甫. 2 Outline Introduction Classifying instruction set architectures Memory addressing Type and size of operands.
ISA Issues; Performance Considerations. Testing / System Verilog: ECE385.
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,
RISC / CISC Architecture By: Ramtin Raji Kermani Ramtin Raji Kermani Rayan Arasteh Rayan Arasteh An Introduction to Professor: Mr. Khayami Mr. Khayami.
INSTRUCTION SET ARCHITECTURES
10/9: Lecture Topics Starting a Program Exercise 3.2 from H+P Review of Assembly Language RISC vs. CISC.
Instruction Set Architecture Classification According to the type of internal storage in a processor the basic types are Stack Accumulator General Purpose.
CSE378 ISA evolution1 Evolution of ISA’s ISA’s have changed over computer “generations”. A traditional way to look at ISA complexity encompasses: –Number.
COMP381 by M. Hamdi 1 Instruction Set Architectures.
COMP3221: Microprocessors and Embedded Systems Lecture 2: Instruction Set Architecture (ISA) Lecturer: Hui Wu Session.
Recap.
What is an instruction set?
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.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CS-334: Computer.
Classifying GPR Machines TypeNumber of Operands Memory Operands Examples Register- Register 30 SPARC, MIPS, etc. Register- Memory 21 Intel 80x86, Motorola.
Instruction Set Architecture The portion of the machine visible to the programmer Issues: Internal storage model Addressing modes Operations Operands Encoding.
Computer Architecture and Organization
Computer Architecture EKT 422
Oct. 25, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 9: Alternative Instruction Sets * Jeremy R. Johnson Wed. Oct. 25, 2000.
Lecture 04: Instruction Set Principles Kai Bu
CS 211: Computer Architecture Lecture 2 Instructor: Morris Lancaster.
Chapter 10 Instruction Sets: Characteristics and Functions Felipe Navarro Luis Gomez Collin Brown.
Lecture 5 A Closer Look at Instruction Set Architectures Lecture Duration: 2 Hours.
The Instruction Set Architecture. Hardware – Software boundary Java Program C Program Ada Program Compiler Instruction Set Architecture Microcode Hardware.
MIPS Instructions Instructions: Language of the Machine
DR. SIMING LIU SPRING 2016 COMPUTER SCIENCE AND ENGINEERING UNIVERSITY OF NEVADA, RENO Session 7, 8 Instruction Set Architecture.
INSTRUCTION SET PRINCIPLES. Computer Architecture’s Changing Definition  1950s to 1960s: Computer Architecture Course = Computer Arithmetic  1970s to.
Computer Architecture & Operations I
Computer Architecture & Operations I
Instruction Set Principles
A Closer Look at Instruction Set Architectures
A Closer Look at Instruction Set Architectures
Basics Of X86 Architecture
Lecture 04: Instruction Set Principles
Appendix A Classifying Instruction Set Architecture
Lecture 4: MIPS Instruction Set
CS170 Computer Organization and Architecture I
Computer Organization and ASSEMBLY LANGUAGE
ECEG-3202 Computer Architecture and Organization
Chapter 9 Instruction Sets: Characteristics and Functions
A Closer Look at Instruction Set Architectures Chapter 5
Chapter 2. Instruction Set Principles and Examples
Computer Architecture
ECEG-3202 Computer Architecture and Organization
Evolution of ISA’s ISA’s have changed over computer “generations”.
What is Computer Architecture?
Introduction to Microprocessor Programming
Dr Hao Zheng Computer Sci. & Eng. U of South Florida
COMS 361 Computer Organization
What is Computer Architecture?
What is Computer Architecture?
Evolution of ISA’s ISA’s have changed over computer “generations”.
Evolution of ISA’s ISA’s have changed over computer “generations”.
CPU Structure CPU must:
Lecture 4: Instruction Set Design/Pipelining
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
Evolution of ISA’s ISA’s have changed over computer “generations”.
Chapter 10 Instruction Sets: Characteristics and Functions
Presentation transcript:

1 Lecture 3: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation

2 What Is ISA? Instruction set architecture is the structure of a computer that a machine language programmer (or a compiler) must understand to write a correct (timing independent) program for that machine. For IBM System/360, 1964  Class ISA types: Stack, Accumulator, and General-purpose register  ISA is mature and stable –Why do we study it?

3 Stack Implicit operands on stack Ex. C = A + B Push A Push B Add Pop C Good code density; used in 60’s-70’s; now in Java VM

4 Accumulator  The accumulator provides an implicit input, and is the implicit place to store the result.  Ex. C = A + B Load R1, A Add R3, R1, B Store R3, c  Used before 1980

5 General-purpose Registers  General-purpose registers are preferred by compilers –Reduce memory traffic –Improve program speed –Improve code density  Usage of general-purpose registers –Holding temporal variables in expression evaluation –Passing parameters –Holding variables  GPR and RISC and CISC –RISC ISA is extensively used for desktop, server, and embedded: MIPS, PowerPC, UltraSPARC, ARM, MIPS16, Thumb –CISC: IBM 360/370, VAX, and Intel 80x86

6 Variants of GRP Architecture  Number of operands in ALU instructions: two or three Add R1, R2, R3Add R1, R2  Maximal number of memory operands in ALU instructions: zero, one, two, or three Load R1, ALoad R1, A Load R2, BAdd R3, R1, B Add R3, R1, R2  Three popular combinations –register-register (load-store): 0 memory, 3 operands –register-memory: 1 memory, 2 operands –memory-memory: 2 memories, 2 operands; or 3 memories, 3 operands

7 Register-memory  There is no implicit operand  One input operand is register, and one in memory Ex. C = A + B Load R1, A Add R3, R1, B Store R3, C  Processors include VAX, 80x86

8 Register-register (Load-store)  Both operands are registers  Values in memory must be loaded into a register and stored back  Ex. C = A + B Load R1, A Load R2, B Add R3, R1, R2 Store R3, C  Processors: MIPS, SPARC

9 How Many Registers? If the number of registers increase:  Allocate more variables in registers (fast accesses)  Reducing code spill  Reducing memory traffic  Longer register specifiers (difficult encoding)  Increasing register access time (physical registers)  More registers to save in context switch MIPS64: 32 general-purpose registers

10 ISA and Performance CPU time = #inst × CPI × cycle time  RISC with Register-Register instructions  Simple, fix-length instruction encoding  Simple code generation  Regularity in CPI  Higher instruction counts  Lower instruction density  CISC with Register-memory instructions  No extra load in accessing data in memory  Easy encoding  Operands being not equivalent  Restricted #registers due to encoding memory address  Irregularity in CPI

11 Memory Addressing Instructions see registers, constant values, and memory  Addressing mode decides how to specify an object to access –Object can be memory location, register, or a constant –Memory addressing is complicated  Memory addressing involves many factors –Memory addressing mode –Object size –byte ordering –alignment For a memory location, its effective address is calculated in a certain form of register content, immediate address, and PC, as specified by the addressing mode

12 Little or Big: Where to Start?  Byte ordering: Where is the first byte?  Big-endian : IBM, SPARC, Mororola  Little-endian: Intel, DEC  Supporting both: MIPS, PowerPC Big-endianLittle-endian Number 0x

13 Alignment Align n-byte objects on n-byte boundaries (n = 1, 2, 4, 8)  One align position, n-1 misaligned positions  Misaligned access is undiserable –Expensive logic, slow references  Aligning in registers may be necessary for bytes and half words

14 MIPS Data Addressing Modes  Register ADD $16, $7, $8  Immediate ADDI $17, $7, 100  Displacement LW $18, 100($9) Only the three are supported for data addressing

15 Storage Used by Compilers Register storage –Holding temporal variables in expression evaluation –Passing parameters –Holding variables Memory storages consists of –Stack: to hold local variables –Global data area: to hold statically declared objects –Heap: to hold dynamic objects

16 Memory Addressing Seen in CISC  Direct (absolute)  Register indirect  Indexed  Scaled  Autoincrement  Autodecrement  Memory indirect And more … ADD R1, (1001) SUB R2, (R1) ADD R1, (R2 + R3) SUB R2, 100(R2)[R3] ADD R1, (R2)+ SUB R2, -(R1) ADD (see textbook p98)

17 Choosing of Memory Addressing Modes Choosing complex addressing modes  Close to addressing in high-level language  May reduce instruction counts (thus fast)  Increase implementation complexity (may increase cycle time)  Increase CPI RISC ISA comes with simple memory addressing, and CISC ISA with complex ones

18 How Often Are Those Address Modes? Usage of address modes, VAX machine, SPEC89

19 Usage of Immediate Operands In RISC Alpha, SPEC CINT2000 & CFP2000

20 Immediate Size in RISC Alpha, SPEC CINT2000 & CFP2000

21 Displacement Size in RISC Displacement bit size: Alpha ISA, SPEC CPU2000 Integer and FP

22 Operands size, type and format  In MIPS Opcode encodes operand size –Ex. ADD for signed integer, ADDU for unsigned integer, ADD.D for double-precision FP  Most common types include –Integer: complement binary numbers –Character: ASCII –Floating point: IEEE standard 754, single-precision or double-precision  Decimal format –4-bits for one decimal digit (0-9), one byte for two decimal digits –Necessary for business applications  Fixed Point format in DSP processors: –Representing fractions in (-1, +1) – fixed point =

23 Dynamic Instruction Mix (MIPS) SPEC2K IntSPEC2K FP Load26%15% Store10%2% Add19%23% Compare5%2% Cond br12%4% Cond mv2%0% Jump1%0% LOGIC 18%4% FP load15% FP store7% FP others19%

24 Compiler Effects Architectures change for the needs of compilers How do compilers use registers? How many? How do compilers use addressing modes? Anything that compilers do not like?