Recap.

Slides:



Advertisements
Similar presentations
Henk Corporaal TUEindhoven 2011
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.
CEG3420 Lec2.1 ©UCB Fall 1997 ISA Review CEG3420 Computer Design Lecture 2.
1 Lecture 3: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation.
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.
10/9: Lecture Topics Starting a Program Exercise 3.2 from H+P Review of Assembly Language RISC vs. CISC.
CS1104 – Computer Organization PART 2: Computer Architecture Lecture 5 MIPS ISA & Assembly Language Programming.
INTRODUCTION TO THE ARM PROCESSOR – Microprocessor Asst. Prof. Dr. Choopan Rattanapoka and Asst. Prof. Dr. Suphot Chunwiphat.
1 CENG 450 Computer Systems and Architecture Lecture 4 Amirali Baniasadi
1 Instructions: Language of the Machine More primitive than higher level languages e.g., no sophisticated control flow Very restrictive e.g., MIPS Arithmetic.
COMP381 by M. Hamdi 1 Instruction Set Architectures.
COMP3221: Microprocessors and Embedded Systems Lecture 2: Instruction Set Architecture (ISA) Lecturer: Hui Wu Session.
1 CSE SUNY New Paltz Chapter 3 Machine Language Instructions.
S. Barua – CPSC 440 CHAPTER 2 INSTRUCTIONS: LANGUAGE OF THE COMPUTER Goals – To get familiar with.
1 Lecture 2: MIPS Instruction Set Today’s topic:  MIPS instructions Reminder: sign up for the mailing list cs3810 Reminder: set up your CADE accounts.
Lecture 5 Sept 14 Goals: Chapter 2 continued MIPS assembly language instruction formats translating c into MIPS - examples.
1  1998 Morgan Kaufmann Publishers Chapter 3 Text in blue is by N. Guydosh Updated 1/27/04 Instructions: Language of the Machine.
ECE 4436ECE 5367 ISA I. ECE 4436ECE 5367 CPU = Seconds= Instructions x Cycles x Seconds Time Program Program Instruction Cycle CPU = Seconds= Instructions.
1  2004 Morgan Kaufmann Publishers Chapter 2. 2  2004 Morgan Kaufmann Publishers Instructions: Language of the Machine We’ll be working with the MIPS.
©UCB CPSC 161 Lecture 5 Prof. L.N. Bhuyan
Linked Lists in MIPS Let’s see how singly linked lists are implemented in MIPS on MP2, we have a special type of doubly linked list Each node consists.
1  2004 Morgan Kaufmann Publishers Instructions: bne $t4,$t5,Label Next instruction is at Label if $t4≠$t5 beq $t4,$t5,Label Next instruction is at Label.
순천향대학교 정보기술공학부 이 상 정 1 2. Instructions: Language of the Computer.
1 EGRE 426 Fall 09 Handout Pipeline examples continued from last class.
1  Modified from  1998 Morgan Kaufmann Publishers Chapter 2: Instructions: Language of the Machine citation and following credit line is included: 'Copyright.
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  1998 Morgan Kaufmann Publishers Machine Instructions: Language of the Machine Lowest level of programming, control directly the hardware Assembly instructions.
1 Instruction Set Architecture (ISA) Alexander Titov 10/20/2012.
Instruction Set Architecture The portion of the machine visible to the programmer Issues: Internal storage model Addressing modes Operations Operands Encoding.
CS2100 Computer Organisation
Computer Organization and Architecture Instructions: Language of the Machine Hennessy Patterson 2/E chapter 3. Notes are available with photocopier 24.
Oct. 25, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 9: Alternative Instruction Sets * Jeremy R. Johnson Wed. Oct. 25, 2000.
Small constants are used quite frequently (50% of operands) e.g., A = A + 5; B = B + 1; C = C - 18; Solutions? Why not? put 'typical constants' in memory.
Crosscutting Issues: The Rôle of Compilers Architects must be aware of current compiler technology Compiler Architecture.
Csci 136 Computer Architecture II – Summary of MIPS ISA Xiuzhen Cheng
Lecture 04: Instruction Set Principles Kai Bu
©UCB Fall CS/EE 362 Hardware Fundamentals Lecture 11 (Chapter 3: Hennessy and Patterson) Winter Quarter 1998 Chris Myers.
 1998 Morgan Kaufmann Publishers MIPS arithmetic All instructions have 3 operands Operand order is fixed (destination first) Example: C code: A = B +
CS 211: Computer Architecture Lecture 2 Instructor: Morris Lancaster.
MS108 Computer System I Lecture 3 ISA Prof. Xiaoyao Liang 2015/3/13 1.
EEL5708/Bölöni Lec 8.1 9/19/03 September, 2003 Lotzi Bölöni Fall 2003 EEL 5708 High Performance Computer Architecture Lecture 5 Intel 80x86.
Computer Organization Rabie A. Ramadan Lecture 3.
Chapter 2 — Instructions: Language of the Computer — 1 Memory Operands Main memory used for composite data – Arrays, structures, dynamic data To apply.
ISA's, Compilers, and Assembly
DR. SIMING LIU SPRING 2016 COMPUTER SCIENCE AND ENGINEERING UNIVERSITY OF NEVADA, RENO Session 7, 8 Instruction Set Architecture.
Instruction Set Architecture Chapter 3 – P & H. Introduction Instruction set architecture interface between programmer and CPU Good ISA makes program.
1  1998 Morgan Kaufmann Publishers Instructions: Language of the Machine More primitive than higher level languages e.g., no sophisticated control flow.
Lecture 12: 10/3/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Computer Architecture & Operations I
Computer Architecture & Operations I
ECE3055 Computer Architecture and Operating Systems Chapter 2: Procedure Calls & System Software These lecture notes are adapted from those of Professor.
Morgan Kaufmann Publishers
Choices in Designing an ISA
ELEN 468 Advanced Logic Design
The University of Adelaide, School of Computer Science
Chapter 1 Fundamentals of Computer Design
Computer Architecture (CS 207 D) Instruction Set Architecture ISA
Lecture 4: MIPS Instruction Set
CS170 Computer Organization and Architecture I
Henk Corporaal TUEindhoven 2010
The University of Adelaide, School of Computer Science
Computer Architecture
COMP541 Datapaths I Montek Singh Mar 18, 2010.
Machine Instructions.
Lecture 4: Instruction Set Design/Pipelining
Presentation transcript:

Recap

Instruction Set Architecture (ISA) The ISA is the interface between hardware and software. The ISA serves as an abstraction layer between the HW and SW Software doesn’t need to know how the processor is implemented Any processor that implements the ISA appears equivalent An ISA enables processor innovation without changing software This is how Intel has made billions of dollars. Before ISAs, software was re-written/re-compiled for each new machine. Software Proc #1 ISA Proc #2

What is instruction set architecture (ISA)? Instruction set of a computer: the portion of the computer visible to the assembly level programmer or to the compiler writer ISA Defines registers Defines data transfer modes (instructions) between registers, memory and I/O There should be sufficient instructions to efficiently translate any program Next, define instruction set format – binary representation used by the hardware Variable-length vs. fixed-length instructions

Growth/Variations of Processors

Instruction Set Architectures There are 4 classes of ISA Stack Embedded processors Accumulator Register-memory Pentium Register-Register (Load-store) Sparc

Instruction Set Architecture For a general purpose high-performance computer Register-Register (Load-store) is the preferred choice CPI uniform for most instructions Better pipelining Fixed length instructions Simpler encoding The complier is more complicated

Important issues to consider for designing an ISA What are the different addressing modes that should be used What is the length of instructions What are the different instructions used What is the type and size of operands

Addressing Modes Addressing mode Example Meaning Register Add R4,R3 R4  R4+R3 Immediate Add R4,#3 R4  R4+3 Displacement Add R4,100(R1) R4  R4+Mem[100+R1] Register indirect Add R4,(R1) R4  R4+Mem[R1] Indexed / Base Add R3,(R1+R2) R3  R3+Mem[R1+R2] Direct or absolute Add R1,(1001) R1  R1+Mem[1001] Memory indirect Add R1,@(R3) R1  R1+Mem[Mem[R3]] Auto-increment Add R1,(R2)+ R1  R1+Mem[R2]; R2  R2+d Auto-decrement Add R1,–(R2) R2  R2-d; R1  R1+Mem[R2] Scaled Add R1,100(R2)[R3] R1  R1+Mem[100+R2+R3*d]

85% 75%

Addressing Modes Register (direct) mode Example: ADD $r1, $r2, $r3 op: opcode rs: first source register rt: second source register rd: destination register op rs rt rd register Example: ADD $r1, $r2, $r3 op 1 2 3 100 $r1 = 100

Addressing Modes Immediate mode Example: ADDI $r3, $r1, 12 op: opcode rs: source register rt: destination register immed: constant op rs rt immed Example: ADDI $r3, $r1, 12 op 3 1 12

Addressing Modes Displacement mode + Example: LOAD $r1, 100($r2) + op rs rt immed register Memory + Example: LOAD $r1, 100($r2) op 2 1 100 150 Memory 88 + Address = 250 $r2 = 150; 100($r2) = 88

Displacement and Immediate Values Important addressing modes: Register, immediate, displacement, register indirect. Account for 88% of workload. Through measurements, 12-16 bits are enough to cover the majority of cases for the value of immediate This will allow to have instruction sets of fixed size of 32 bits – most microprocessors opcode rs rt 6 5 rd shamt func R-Type Format opcode rs rt immediate 6 5 16 I-Type Format opcode immediate 6 26 J-Type Format

Instruction Usage Example: Top 10 Intel X86 Instructions Rank instruction load conditional branch compare store add and sub move register-register call return Total Integer Average Percent total executed 1 22% 20% 16% 12% 8% 6% 5% 4% 1% 96% 2 3 4 5 6 7 8 9 10 Observation: Simple instructions dominate instruction usage frequency.

Instruction Set Encoding Considerations affecting instruction set encoding: To have as many registers and address modes as possible. The Impact of the size of the register and addressing mode fields on the average instruction size and on the average program. To encode instructions into lengths that will be easy to handle in the implementation. On a minimum to be a multiple of bytes.

Instruction Format Fixed Variable Hybrid Summary: Operation, address specifier 1, address specifier 2, address specifier 3. MIPS, SPARC, Power PC. Variable Operation & # of operands, address specifier1, …, specifier n. VAX Hybrid Intel x86 operation, address specifier, address field. Operation, address specifier 1, address specifier 2, address field. Operation, address field, address specifier 1, address specifier 2. Summary: If code size is most important, use variable format. If performance is most important, use fixed format.

Three Examples of Instruction Set Encoding Operations & no of operands Address specifier 1 Address field 1 Address specifier n Address field n Variable: VAX (1-53 bytes) Operation Address field 1 Address field 2 Address field3 Fixed: DLX, MIPS, PowerPC, SPARC Operation Address field Address Specifier Address Specifier 1 Address Specifier 2 Operation Address field Address Specifier Address field 2 Operation Address field 1 Hybrid : IBM 360/370, Intel 80x86

Summary: ISA Use general purpose registers with a load-store architecture. Support these addressing modes: displacement, immediate, register indirect. Support these simple instructions: load, store, add, subtract, move register, shift, compare equal, compare not equal, branch, jump, call, return. Support these data size: 8-,16-,32-bit integer, IEEE FP standard. Provide at least 16 general purpose registers plus separate FP registers and aim for a minimal instruction set.

Alternative Architectures Design alternative: provide more powerful operations goal is to reduce number of instructions executed danger is a slower cycle time and/or a higher CPI Let’s look (briefly) at IA-32 “The path toward operation complexity is thus fraught with peril. To avoid these problems, designers have moved toward simpler instructions”

IA - 32 1978: The Intel 8086 is announced (16 bit architecture) 1980: The 8087 floating point coprocessor is added 1982: The 80286 increases address space to 24 bits, +instructions 1985: The 80386 extends to 32 bits, new addressing modes 1989-1995: The 80486, Pentium, Pentium Pro add a few instructions (mostly designed for higher performance) 1997: 57 new “MMX” instructions are added, Pentium II 1999: The Pentium III added another 70 instructions (SSE) 2001: Another 144 instructions (SSE2) 2003: AMD extends the architecture to increase address space to 64 bits, widens all registers to 64 bits and other changes (AMD64) 2004: Intel capitulates and embraces AMD64 (calls it EM64T) and adds more media extensions “This history illustrates the impact of the “golden handcuffs” of compatibility: “adding new features as someone might add clothing to a packed bag” “an architecture that is difficult to explain and impossible to love”

IA-32 Overview Complexity: Instructions from 1 to 17 bytes long one operand must act as both a source and destination one operand can come from memory complex addressing modes e.g., “base or scaled index with 8 or 32 bit displacement” Saving grace: the most frequently used instructions are not too difficult to build compilers avoid the portions of the architecture that are slow “what the 80x86 lacks in style is made up in quantity, making it beautiful from the right perspective”