CS4617 Computer Architecture

Similar documents
Page 1. Structure of von Nuemann machine. Instruction Set - the type of Instructions

Instruction Set Principles and Examples. Appendix B

Chapter 2. Instruction Set Principles and Examples. In-Cheol Park Dept. of EE, KAIST

Lecture 4: Instruction Set Architecture

COSC 6385 Computer Architecture. Instruction Set Architectures

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing

55:132/22C:160, HPCA Spring 2011

Lecture 4: Instruction Set Design/Pipelining

Instruction Set Architecture (ISA)

CSCE 5610: Computer Architecture

Math 230 Assembly Programming (AKA Computer Organization) Spring 2008

EITF20: Computer Architecture Part2.1.1: Instruction Set Architecture

CHAPTER 5 A Closer Look at Instruction Set Architectures

General Purpose Processors

EITF20: Computer Architecture Part2.1.1: Instruction Set Architecture

ECE 486/586. Computer Architecture. Lecture # 7

COSC 6385 Computer Architecture - Instruction Set Principles

EC 413 Computer Organization

Graduate Computer Architecture. Chapter 2. Instruction Set Principles

Instruction Set Architectures

Instruction Sets Ch 9-10

Instruction Sets Ch 9-10

Instruction Set. Instruction Sets Ch Instruction Representation. Machine Instruction. Instruction Set Design (5) Operation types

CHAPTER 2: INSTRUCTION SET PRINCIPLES. Prepared by Mdm Rohaya binti Abu Hassan

Lecture 3 Machine Language. Instructions: Instruction Execution cycle. Speaking computer before voice recognition interfaces

Announcements HW1 is due on this Friday (Sept 12th) Appendix A is very helpful to HW1. Check out system calls

Chapter 2: Instructions How we talk to the computer

ISA and RISCV. CASS 2018 Lavanya Ramapantulu

17. Instruction Sets: Characteristics and Functions

CS/ECE/752 Chapter 2 Instruction Sets Instructor: Prof. Wood

Instruction Set Principles. (Appendix B)

CSIS1120A. 10. Instruction Set & Addressing Mode. CSIS1120A 10. Instruction Set & Addressing Mode 1

Instruction Sets: Characteristics and Functions

CHAPTER 5 A Closer Look at Instruction Set Architectures

CHAPTER 5 A Closer Look at Instruction Set Architectures

EC-801 Advanced Computer Architecture

Instruction Set Architecture

Instruction Set Architecture. "Speaking with the computer"

Instruction Set Design

Topics Power tends to corrupt; absolute power corrupts absolutely. Computer Organization CS Data Representation

Instructions: Language of the Computer

COSC 6385 Computer Architecture. Defining Computer Architecture

ECE 486/586. Computer Architecture. Lecture # 8

Typical Processor Execution Cycle

CPE 631 Lecture 08: Virtual Memory

Chapter 2A Instructions: Language of the Computer

Instruction-set Design Issues: what is the ML instruction format(s) ML instruction Opcode Dest. Operand Source Operand 1...

Computer Organization CS 206 T Lec# 2: Instruction Sets

Lecture Topics. Branch Condition Options. Branch Conditions ECE 486/586. Computer Architecture. Lecture # 8. Instruction Set Principles.

Instruction Set II. COMP 212 Computer Organization & Architecture. COMP 212 Fall Lecture 7. Instruction Set. Quiz. What is an Instruction Set?

ISA: The Hardware Software Interface

Evolution of ISAs. Instruction set architectures have changed over computer generations with changes in the

Lecture 3: The Instruction Set Architecture (cont.)

Lecture 3: The Instruction Set Architecture (cont.)

Instruction Set Architecture

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing

COMPUTER ORGANIZATION & ARCHITECTURE

COS 140: Foundations of Computer Science

Lecture 5: Instruction Set Architectures II. Take QUIZ 2 before 11:59pm today over Chapter 1 Quiz 1: 100% - 29; 80% - 25; 60% - 17; 40% - 3

Math 230 Assembly Programming (AKA Computer Organization) Spring MIPS Intro

Computer Systems Architecture I. CSE 560M Lecture 3 Prof. Patrick Crowley

Chapter 2. Instruction Set Design. Computer Architectures. software. hardware. Which is easier to change/design??? Tien-Fu Chen

Chapter 2 Instruction Set Principles and Examples

Review of instruction set architectures

Instruction Sets: Characteristics and Functions Addressing Modes

CPU Architecture and Instruction Sets Chapter 1

CA226 Advanced Computer Architecture

Instruction Set (ISA) Design and Addressing Modes

Computer Architecture

Instruction-set Design Issues: what is the ML instruction format(s) ML instruction Opcode Dest. Operand Source Operand 1...

Run time environment of a MIPS program

Reminder: tutorials start next week!

Computer Architecture

Forecast. Instructions (354 Review) Basics. Basics. Instruction set architecture (ISA) is its vocabulary. Instructions are the words of a computer

COMP2121: Microprocessors and Interfacing. Instruction Set Architecture (ISA)

Computer Architecture

CSE 141 Computer Architecture Spring Lecture 3 Instruction Set Architecute. Course Schedule. Announcements

Instructions: Language of the Computer

2. ADDRESSING METHODS

ECE232: Hardware Organization and Design

ECE 486/586. Computer Architecture. Lecture # 6

History of the Intel 80x86

Unsigned Binary Integers

Unsigned Binary Integers

Assembly Language Design

RISC Principles. Introduction

CSCI 402: Computer Architectures. Instructions: Language of the Computer (1) Fengguang Song Department of Computer & Information Science IUPUI

CENG3420 Lecture 03 Review

Slides for Lecture 6

Chapter 1. Computer Abstractions and Technology. Lesson 3: Understanding Performance

Lecture 4: RISC Computers

MIPS Instruction Set Architecture (1)

Real instruction set architectures. Part 2: a representative sample

Review Questions. 1 The DRAM problem [5 points] Suggest a solution. 2 Big versus Little Endian Addressing [5 points]

Computer Organization MIPS ISA

Computer Architecture 1 ح 303

Systems Architecture I

Architecture I. Computer Systems Laboratory Sungkyunkwan University

Chapter 2. Instructions: Language of the Computer. HW#1: 1.3 all, 1.4 all, 1.6.1, , , , , and Due date: one week.

CS2304-SYSTEM SOFTWARE 2 MARK QUESTION & ANSWERS. UNIT I INTRODUCTION

Transcription:

1/27 CS4617 Computer Architecture Lecture 7: Instruction Set Architectures Dr J Vaughan October 1, 2014

2/27 ISA Classification Stack architecture: operands on top of stack Accumulator architecture: 1 operand in ACC, implicitly General-purpose register architectures: Explicit operands in register or memory

3/27 Register computers: 2 main classes Register-memory architecture: Access memory as part of any instruction Load-store architecture: Access memory only with load and store Other: Extended accumulator/special-purpose register: use additional registers in special ways

4/27 Advantages of general-purpose register (GPR) computers Registers are faster than memory Registers are more efficient for a compiler to use Registers allow expression evaluation in any order

5/27 2 design decisions for GPR architectures 1. Does ALU instruction have 2 or 3 operands? 2. How many ALU operands may be memory addresses?

6/27 Expectations for a new ISA design General-purpose registers Load-store version of GPR

7/27 Memory Addressing Endiannness Little endian: Low-order bytes placed in lower addresses Big endian: Low-order bytes placed in higher addresses Alignment Access to object of s bytes is aligned if A mod s = 0

8/27 Addressing Modes Register Immediate Displacement Register indirect Indexed Direct (also known as Absolute) Memory Indirect Autoincrement Autodecrement Scaled

9/27 Expectations for ISA addressing modes 1. Displacement, immediate and register indirect are used in 75% to 95% of instructions 2. Size of displacement field at least 12 to 16 bits 3. Size of immediate field at least 8 to 16 bits

10/27 Operand Types Type gives size Character 8 bits Half word 16 bits Word 32 bits Single-precision floating point word 32 bits Double-precision floating point word 64 bits

11/27 Operand Representation Integer: Two s complement binary Character: 8-bit ASCII, 16-bit Unicode Floating-point: IEEE 754 Decimal numbers: Packed/unpacked BCD

12/27 Operations at ISA level Arithmetic and logical Data transfer Control System: SVC, memory management Floating point Decimal String: Move, compare, search Graphics: Pixel and vortex operations, compress/decompress

13/27 Top ten 80x86 instructions Instruction Usage frequency Load 22% Conditional branch 20% Compare 16% Store 12% Add 8% And 6% Sub 5% Move reg-reg 4% Call 1% Return 1% Total 96% Table: Branch condition testing

14/27 Control Flow Instructions Instruction type Usage frequency Conditional branches 75% Jumps 6% Procedure calls 19% Procedure returns Table: Control flow instruction frequency in integer benchmarks

15/27 Control flow addressing modes Most frequent branches in integer programs are to targets that can be encoded in 4 to 8 bits. Displacement to be added to PC PC-relative branches/jumps Advantage Code runs independently of load address Less work for linker

16/27 Returns and indirect jumps PC-relative cannot be used for returns/indirect jumps Must be able to specify destination address dynamically so that it can change at run time Possibility: name register containing target address Possibility: allow any addressing mode for jump target specification

17/27 Uses of register indirect jumps Case/switch statements Virtual functions/methods in OO languages Function pointers that allow functions to be passed as parameters Dynamically shared libraries, loaded and linked at runtime In these four cases, the target address is not known at compile time

18/27 Branch condition testing Method Examples How tested Condition Code 80x86, ARM, Power PC Condition register Alpha, MIPS Test special flag bits Compare and branch PA-RISC, VAX Compare is part of the branch Table: Branch condition testing

19/27 Comparisons Many comparisons are simple tests A large number of comparisons are with zero Comparison Usage frequency Not equal 2% Equal 18% Greater than or equal 11% Greater than 0% Less than or equal 33% Less than 35% Table: Comparison frequency in integer benchmarks

20/27 Procedure invocation Return address saving conventions Caller saves registers Callee saves registers Caller save must be used if procedures can access global variables Most compilers enforce this

21/27 Control flow instruction summary Expect PC-relative branch displacement of at least 8 bits Expect register indirect and PC-relative addressing for jump instructions to support returns and other features

22/27 Checkpoint in architectural requirements at ISA level Load-store architecture Addressing modes: displacement, immediate, register indirect Data: 8-, 16-, 32-, 64-bit integers, 32-, 64-bit floating point Simple operations PC-relative conditional branches Jump Link instruction for procedure call Register indirect jumps for procedure return

23/27 Instruction set encoding Opcode field Address specifier field More bits used to encode addressing modes/register fields than to specify opcode

24/27 Competing forces in ISA encoding Wish to have as many registers/addressing modes as possible Field size influences instruction length and average programme size Instructions should be encoded into lengths that are easily handled in pipelines Instruction length a multiple of bytes rather than arbitrary bit length

25/27 Instruction encoding variations Variable length Example: Intel 80x86, Vax Fixed length Example: Alpha, ARM, MIPS, PowerPC, SPARC, SuperH Hybrid Example: IBM 360/370, MIPS16, Thumb

26/27 Embedded RISC Smaller code size important in embedded systems 32-bit fixed format not suitable Reduced-length RISC instructions: Thumb (ARM), MIPS16 IBM compresses standard instructions and decompresses on field/cache miss Hitachi uses fixed 16-bit format RISC, SuperH

27/27 Instruction set properties to aid compiler writing Regularity The three primary parts of an instruction set (operations, data types, addressing modes) should be orthogonal Aspects of an architecture are said to be orthogonal if they are independent Operations and addressing modes are orthogonal if, for every operation to which one addressing mode can be applied, all addressing modes are applicable Provide primitives, not solutions Special features that match a language construct or kernel function are often unusable Provide instructions that fix the quantities known at compile time as constants