Page 1. Instruction Set Architecture. Chapter 2. Instruction Set Principle and Examples. Towards Evaluation of ISA and Organization.

Similar documents
Computer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University

Instruction Set Architecture (ISA) Design. Classification Categories

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2

Instruction Set Architecture (ISA)

Instruction Set Architecture. or How to talk to computers if you aren t in Star Trek

İSTANBUL AYDIN UNIVERSITY

Instruction Set Design

LSN 2 Computer Processors

Computer Architecture Lecture 3: ISA Tradeoffs. Prof. Onur Mutlu Carnegie Mellon University Spring 2013, 1/18/2013

Computer Organization and Architecture

Reduced Instruction Set Computer (RISC)

CPU Organization and Assembly Language

Chapter 2 Logic Gates and Introduction to Computer Architecture

EC 362 Problem Set #2

Property of ISA vs. Uarch?

Overview. CISC Developments. RISC Designs. CISC Designs. VAX: Addressing Modes. Digital VAX

Computer Architectures

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-12: ARM

Central Processing Unit (CPU)

Instruction Set Architecture

In the Beginning The first ISA appears on the IBM System 360 In the good old days

Chapter 5 Instructor's Manual

Introducción. Diseño de sistemas digitales.1

Stack machines The MIPS assembly language A simple source language Stack-machine implementation of the simple language Readings:

Intel 8086 architecture

CSE 141 Introduction to Computer Architecture Summer Session I, Lecture 1 Introduction. Pramod V. Argade June 27, 2005

picojava TM : A Hardware Implementation of the Java Virtual Machine

a storage location directly on the CPU, used for temporary storage of small amounts of data during processing.

Addressing The problem. When & Where do we encounter Data? The concept of addressing data' in computations. The implications for our machine design(s)

Chapter 2 Topics. 2.1 Classification of Computers & Instructions 2.2 Classes of Instruction Sets 2.3 Informal Description of Simple RISC Computer, SRC

Lecture 7: Machine-Level Programming I: Basics Mohamed Zahran (aka Z)

An Overview of Stack Architecture and the PSC 1000 Microprocessor

Design Cycle for Microprocessors

Computer System: User s View. Computer System Components: High Level View. Input. Output. Computer. Computer System: Motherboard Level

CHAPTER 7: The CPU and Memory

Microprocessor and Microcontroller Architecture

Review: MIPS Addressing Modes/Instruction Formats

ARM Microprocessor and ARM-Based Microcontrollers

Execution Cycle. Pipelining. IF and ID Stages. Simple MIPS Instruction Formats

Week 1 out-of-class notes, discussions and sample problems

Lecture Outline. Stack machines The MIPS assembly language. Code Generation (I)

Solution: start more than one instruction in the same clock cycle CPI < 1 (or IPC > 1, Instructions per Cycle) Two approaches:

IA-64 Application Developer s Architecture Guide

MICROPROCESSOR AND MICROCOMPUTER BASICS

More MIPS: Recursion. Computer Science 104 Lecture 9

Computer organization

(Refer Slide Time: 00:01:16 min)

1 Classical Universal Computer 3

A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc

CPU Organisation and Operation

Chapitre 2 : Années cinquante

Chapter 5, The Instruction Set Architecture Level

Introduction to Virtual Machines

Chapter 7D The Java Virtual Machine

Q. Consider a dynamic instruction execution (an execution trace, in other words) that consists of repeats of code in this pattern:

CS352H: Computer Systems Architecture

RISC AND CISC. Computer Architecture. Farhat Masood BE Electrical (NUST) COLLEGE OF ELECTRICAL AND MECHANICAL ENGINEERING

MACHINE ARCHITECTURE & LANGUAGE

l C-Programming l A real computer language l Data Representation l Everything goes down to bits and bytes l Machine representation Language

1 The Java Virtual Machine

VLIW Processors. VLIW Processors

Computer Architecture TDTS10

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System?

Outline. Lecture 3. Basics. Logical vs. physical memory physical memory. x86 byte ordering

INSTRUCTION LEVEL PARALLELISM PART VII: REORDER BUFFER

Interpreters and virtual machines. Interpreters. Interpreters. Why interpreters? Tree-based interpreters. Text-based interpreters

Efficient Low-Level Software Development for the i.mx Platform

Computer Organization and Components

Stack Allocation. Run-Time Data Structures. Static Structures

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?

The AVR Microcontroller and C Compiler Co-Design Dr. Gaute Myklebust ATMEL Corporation ATMEL Development Center, Trondheim, Norway

Computer Architecture Basics

M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

612 CHAPTER 11 PROCESSOR FAMILIES (Corrisponde al cap Famiglie di processori) PROBLEMS

DNA Data and Program Representation. Alexandre David


A SystemC Transaction Level Model for the MIPS R3000 Processor

CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions

EECS 427 RISC PROCESSOR

Administrative Issues

The Java Virtual Machine and Mobile Devices. John Buford, Ph.D. Oct 2003 Presented to Gordon College CS 311

How To Write Portable Programs In C

COS 318: Operating Systems

WAR: Write After Read

How It All Works. Other M68000 Updates. Basic Control Signals. Basic Control Signals

Desirable Properties Of An Internet Addressing Scheme

Traditional IBM Mainframe Operating Principles

X86-64 Architecture Guide

Guide to RISC Processors

A s we saw in Chapter 4, a CPU contains three main sections: the register section,

Instruction Set Architecture. Datapath & Control. Instruction. LC-3 Overview: Memory and Registers. CIT 595 Spring 2010

An Introduction to the ARM 7 Architecture

CS 152 Computer Architecture and Engineering. Lecture 22: Virtual Machines

Processor Architectures

Assembly Language Programming

Compiling PCRE to FPGA for Accelerating SNORT IDS

Syscall 5. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

CHAPTER 4 MARIE: An Introduction to a Simple Computer

Pipeline Hazards. Structure hazard Data hazard. ComputerArchitecture_PipelineHazard1

Microprocessor & Assembly Language

Transcription:

Instruction Set Architecture Chapter 2 Instruction Set Principle and Examples Instruction set architecture is the interface of a computer that a machine language programmer, an operating system designer, or a compiler writer must understand to write a correct machine program, an operating system, a compiler, respectively for that machine. The instruction set architecture is also the interface that a hardware designer must understand to design a correct implementation of the computer. Towards Evaluation of ISA and Organization software Interface Design A good interface: Lasts through many implementations (portability, compatibility) Is used in many different ways (generality) Provides convenient functionality to higher levels Permits an efficient implementation at lower levels hardware instruction set use use use Interface imp 1 imp 2 imp 3 time Page 1 1

Machine Instruction Carries out a step of processing Must specify: Function - OPCODE Input Operand(s) What to do with results What to do next? OPCODE Operand 1 Operand 2 Result Next? Four Address Instruction Assume availability of linear address space Evolution of Instruction Sets Single Accumulator (EDSAC 1950) Accumulator + Index Registers (Manchester Mark I, IBM 700 series 1953) Separation of Programming Model from Implementation High-level Language Based Concept of a Family (B5000 1963) (IBM 360 1964) General Purpose Register Machines Complex Instruction Sets Load/Store Architecture (Vax, Intel 432 1977-80) (CDC 6600, Cray 1 1963-76) RISC (Mips,Sparc,88000,IBM RS6000,...1987) Evolution of Instruction Sets Classifying Instruction Set Architecture Major advances in computer architecture are typically associated with landmark instruction set designs Ex: Stack vs. GPR (System 360) Design decisions must take into account: technology machine organization programming languages compiler technology operating systems And they in turn influence these Operands Number : (0,1,2,3) Type, Size : byte, int, float Location : memory or register (effective address) Internal Storage Stack Accumulator Register Operations Type : add, sub, mul, How is it specified? Page 2 2

Internal Storage: Stack, Accumulator, and Register Machine Types Machine Type Advantage Disadvantage Stack Simple Model, Good code Can not address randomly density Stack Bottleneck Accumulator Minimizes internal states Highest memory traffic Short Instructions Register Most general model for All operands must be named code generation longer instructions C = A + B Emergence of GPR machines Registers Fastest memory Easier for compilers to manipulate Hold variable Reduce memory traffic Speedup programs Improves code density Register Load-Store most popular Operands Classifying Instruction Set Architecture Number : (0,1,2,3) Type, Size : byte, int, float Location : memory or register (effective address) Internal Storage Stack Accumulator Register Operations Type : add, sub, mul, How is it specified? How many registers? Page 3 3

Characterizing GPR architectures (ALU instructions) No. of Mem Addresses Max NO of Ops Examples per ALU Instruction allowed 0 2 IBM RT 3 SPARC, MIPS, PowerPC, Alpha 1 2 PDP-10, M 68000, IBM 360 3 IBM 360 (RS Inst) 2 2 PDP 11, National 32x32, 3 3 VAX IBM 360 (SS Inst) General Purpose Register Arch. Register-Register (0,3) Advantages Simple, Fixed Length Instruction Encoding Simple Code Generation Model Similar CPI values Disadvantages Higher Instruction Count Bit Encoding may be wasteful General Purpose Register Arch. Register-Memory (1,2) Advantages No loading first required Easy to encode with good density Disadvantages Source operand is destroyed CPI Varies Encoding a register No. in each inst - limit Reg No. General Purpose Register Arch. Memory-Memory (3,3) Advantages Most compact does not waste registers for temp info Disadvantages Large variation in instruction size Large variation in work per instruction Memory access may create memory bottleneck Page 4 4

Memory Addressing Ordering of bytes within a word Alignment Addressing modes Byte Ordering: Big/Little Endian byte whose address is x x00 at Big endian: most-significant position IBM mainframes, MIPS, 680x0, SPARC 0 1 2 3 31 0 Big Endian Little endian: least-significant position Vax, Intel 80x86 3 2 1 0 31 Little Endian 0 0 1 2 3 ff 08 47 35 Alignment Access to an object of size s bytes at byte address A is aligned if A mod s = 0 Mis-aligned word reference Addressing modes Addressing mode : how architectures specify the (address of an) object that they will access Effective address: actual memory address specified 32 32 32 To Processor Page 5 5

Addressing modes Addressing Modes Significantly reduce Instruction Count Add to the complexity of Building a Machine May Increase the Average CPI IMPORTANT FACTOR FOR AN ARCHITECT Summary of Use of Memory Addressing Modes Displacement Addressing Mode How large should the displacement field be? Directly influence instruction length May have to depend on measurements taken from typical programs Page 6 6

Displacement Values Immediate or Literal Addressing Modes Used in arithmetic operations in comparisons (primarily for branches) in moves where a constant is needed in a register» Constant written in code (Small)» address constants (Large) Range of Value for Immediates Again, directly influence instruction length Again, may have to depend on measurements taken from typical programs Displacement of Immediate Values Summary: Memory Addressing Expect an architecture to support displacement immediate register deferred These modes represent 75% to 99% of modes used for some typical programs Displacement mode to be 12 to 16 bits Immediate field to be 8 to 16 bits Page 7 7

Classifying Instruction Set Architecture Internal Storage Stack Accumulator Register Operations in the Instruction Set Instruction Categories Top 10 Instructions Operands Number : (0,1,2,3) Type, Size : byte, int, float Location : memory or register (effective address) Operations Type : add, sub, mul, How is it specified? Instruction Categories Top 10 Instructions Page 8 8

1. Conditional Branches 2. Jumps 3. Procedure Calls 4. Procedure Returns Control-Flow Destination Address PC Relative Target often near the current instruction Requires fewer bits Also, makes the code Position Independent What branch offset should be supported? Again, influence instruction length and encoding Specifying Branch Condition Properties of branch instructions Large number of the comparisons are simple equalities or inequalities comparisons with zero treat as special cases How to specify branch condition? Page 9 9

Destination Address Unknown Procedure returns or indirect jumps Need to specify target dynamically May use any addressing mode for destination address Use a register as address Useful for» Case or Switch statements» Dynamically Shared Libraries Loaded at run time as needed» Virtual Functions Allow different routines to be called depending on data type Procedure Call and Returns Include control transfer and some state saving At a minimum return address has to be saved May also save registers» Through hardware action» Through software instructions Two conventions for saving registers» Caller Saving Calling procedure must save the registers» Callee Saving Called program must save the registers it wants to used Use depends on the program - Compilers use a combination Page 10 10