INSTRUCTION SET COMPARISONS

Similar documents
Computer Architecture. The Language of the Machine

101 Assembly. ENGR 3410 Computer Architecture Mark L. Chang Fall 2009

MIPS Instruction Format

The MIPS Instruction Set Architecture

MIPS Reference Guide

Reduced Instruction Set Computer (RISC)

MIPS Instruction Set

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA MIPS ISA. In a CPU. (vonneumann) Processor Organization

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA

Reduced Instruction Set Computer (RISC)

MIPS ISA. 1. Data and Address Size 8-, 16-, 32-, 64-bit 2. Which instructions does the processor support

MIPS Instruction Reference

EEM 486: Computer Architecture. Lecture 2. MIPS Instruction Set Architecture

ece4750-parc-isa.txt

Mark Redekopp, All rights reserved. EE 357 Unit 11 MIPS ISA

Computer Architecture

Computer Architecture. MIPS Instruction Set Architecture

Processor. Han Wang CS3410, Spring 2012 Computer Science Cornell University. See P&H Chapter , 4.1 4

A Processor. Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University. See: P&H Chapter , 4.1-3

F. Appendix 6 MIPS Instruction Reference

ECE 2035 Programming HW/SW Systems Fall problems, 7 pages Exam Two 23 October 2013

MIPS Assembly Language. Today s Lecture

CS3350B Computer Architecture MIPS Instruction Representation

Today s Lecture. MIPS Assembly Language. Review: What Must be Specified? Review: A Program. Review: MIPS Instruction Formats

M2 Instruction Set Architecture

The MIPS R2000 Instruction Set

Computer Organization & Design

Mips Code Examples Peter Rounce

Anne Bracy CS 3410 Computer Science Cornell University. [K. Bala, A. Bracy, E. Sirer, and H. Weatherspoon]

EE 109 Unit 13 MIPS Instruction Set. Instruction Set Architecture (ISA) Components of an ISA INSTRUCTION SET OVERVIEW

Anne Bracy CS 3410 Computer Science Cornell University. See P&H Chapter: , , Appendix B

Q1: /30 Q2: /25 Q3: /45. Total: /100

EE108B Lecture 3. MIPS Assembly Language II

SPIM Instruction Set

software hardware Which is easier to change/design???

Course Administration

Overview. Introduction to the MIPS ISA. MIPS ISA Overview. Overview (2)

Digital System Design II

Week 10: Assembly Programming

Mark Redekopp, All rights reserved. EE 352 Unit 3 MIPS ISA

Review of instruction set architectures

Instruction Set Principles. (Appendix B)

TSK3000A - Generic Instructions

ECE 2035 Programming HW/SW Systems Spring problems, 6 pages Exam One 4 February Your Name (please print clearly)

CSc 256 Midterm 2 Fall 2011

EE 109 Unit 8 MIPS Instruction Set

Chapter 2A Instructions: Language of the Computer

Instruction Set Architecture of. MIPS Processor. MIPS Processor. MIPS Registers (continued) MIPS Registers

Instruction Set Architecture part 1 (Introduction) Mehran Rezaei

CS 4200/5200 Computer Architecture I

ECE 2035 Programming HW/SW Systems Fall problems, 6 pages Exam Two 23 October Your Name (please print clearly) Signed.

Kernel Registers 0 1. Global Data Pointer. Stack Pointer. Frame Pointer. Return Address.

ECE 2035 Programming HW/SW Systems Spring problems, 6 pages Exam Two 11 March Your Name (please print) total

ECE232: Hardware Organization and Design. Computer Organization - Previously covered

CPS311 - COMPUTER ORGANIZATION. A bit of history

Computer Organization MIPS ISA

Programming the processor

CENG3420 Lecture 03 Review

ECE 2035 Programming HW/SW Systems Fall problems, 6 pages Exam One 22 September Your Name (please print clearly) Signed.

ECE260: Fundamentals of Computer Engineering

A Processor! Hakim Weatherspoon CS 3410, Spring 2010 Computer Science Cornell University. See: P&H Chapter , 4.1-3

Concocting an Instruction Set

Midterm. Sticker winners: if you got >= 50 / 67

Review: Organization. CS152 Computer Architecture and Engineering Lecture 2. Review of MIPS ISA and Design Concepts

MIPS Assembly Programming

Project Part A: Single Cycle Processor

CSc 256 Midterm 2 Spring 2012

Exam in Computer Engineering

A General-Purpose Computer The von Neumann Model. Concocting an Instruction Set. Meaning of an Instruction. Anatomy of an Instruction

ECE260: Fundamentals of Computer Engineering

5/17/2012. Recap from Last Time. CSE 2021: Computer Organization. The RISC Philosophy. Levels of Programming. Stored Program Computers

Recap from Last Time. CSE 2021: Computer Organization. Levels of Programming. The RISC Philosophy 5/19/2011

Flow of Control -- Conditional branch instructions

Question 0. Do not turn this page until you have received the signal to start. (Please fill out the identification section above) Good Luck!

ECE 2035 Programming HW/SW Systems Fall problems, 6 pages Exam One 19 September 2012

MIPS%Assembly% E155%

Computer Architecture Experiment

Outline. EEL-4713 Computer Architecture Multipliers and shifters. Deriving requirements of ALU. MIPS arithmetic instructions

Concocting an Instruction Set

CSc 256 Midterm (green) Fall 2018

Examples of branch instructions

RTL Model of a Two-Stage MIPS Processor

ECE 2035 Programming HW/SW Systems Fall problems, 6 pages Exam Two 21 October 2016

Assembly Language. Prof. Dr. Antônio Augusto Fröhlich. Sep 2006

CS3350B Computer Architecture MIPS Introduction

Instructions: Language of the Computer

MIPS Assembly Language

MIPS Memory Access Instructions

CS 61c: Great Ideas in Computer Architecture

ECE Exam I February 19 th, :00 pm 4:25pm

ECE468 Computer Organization & Architecture. MIPS Instruction Set Architecture

CSc 256 Final Spring 2011

MIPS Assembly Language Programming

Today s topics. MIPS operations and operands. MIPS arithmetic. CS/COE1541: Introduction to Computer Architecture. A Review of MIPS ISA.

CSc 256 Final Fall 2016

CS31001 COMPUTER ORGANIZATION AND ARCHITECTURE. Debdeep Mukhopadhyay, CSE, IIT Kharagpur. Instructions and Addressing

Computer Architecture Instruction Set Architecture part 2. Mehran Rezaei

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

CS61CL Machine Structures. Lec 5 Instruction Set Architecture

Review: MIPS Organization

Transcription:

INSTRUCTION SET COMPARISONS MIPS SPARC MOTOROLA REGISTERS: INTEGER 32 FIXED WINDOWS 32 FIXED FP SEPARATE SEPARATE SHARED BRANCHES: CONDITION CODES NO YES NO COMPARE & BR. YES NO YES A=B COMP. & BR. YES NO NO INTEGER MULT/DIV: HARDWARE SOFTWARE HARDWARE 8/14/91 instruction set - 40

Register Comparisons CPU FPA MIPS 32 16 X 64 bits SPARC 128 (windows 32 X 32 bits 16/proceedure) AMD 192 (windows 8 X 64 variable/proc.) MOTOROLA 32 (same as integer) INTEL 32 16 X 64, or 32 X 32 8/14/91 instruction set - 39

COPROCESSOR INSTRUCTIONS COPROCESSOR LWCz GENERAL REGISTERS MTCz MAIN MEMORY SWCz MFCz CTCz CPU CONTROL REGISTERS CFCz z = 0-3 BCzT BCzF COPz Not All Instructions Supported by All Coprocessors 8/14/91 instruction set - 38

MULTIPLE STALLS: SERVICE HIERARCHY 1. TLB Miss, Partial Word Store, MP Stalls 2. Data Cache Miss or Write Busy (Mutually Exclusive) 3. Coprocessor Busy 4. Instruction Cache Miss 5. Multiplier/Divider Busy Stalls not Requiring Processor Intervention can Self Resolve and not Cause a Stall While Another Stall is Being Serviced 8/14/91 instruction set - 37

LR3000 CYCLE TYPES RUN Cache: Processor Executes from ICache Refill (Streaming): Processor Executes as ICache is Being Refilled STALL Wait: No Cache Activity; Waiting for Stall Resolution Refill: Data Transferred from Main Memory to Caches MP: Memory System can Access Data Cache Fixup: Restart Processor and Coprocessor Pipelines Internal: TLB Miss, Coprocessor Busy, Multiplier/Divider Busy Streaming is for ICache Refill Only 8/14/91 instruction set - 36

LR3000 CYCLE TYPES RUN STALL CACHE REFILL WAIT REFILL MP INTERNAL FIXUP (STREAMING) RUN: Cycle in Which an Instruction Completes STALL: Cycle in Which no Instruction Completes 8/14/91 instruction set - 35

TLB MISS ST AL STALL IF IF RD TLB CHECK TLB MISS HIT I-CACHE I-CACHE This Stall Requires no Fixup Cycle 8/14/91 instruction set - 34

DETAIL OF BRANCH OPERATION RD ALU BRANCH INSTR I-CACHE OPERAND FETCH ADD & COND BRANCH TARGET INSTR TLB I-CACHE Normal TLB Access Takes 1/2 Cycle Only 1/4 Cycle Available for Translation Use TLB for Instructions (Allows 1/4 Cycle Access on Hits) 8/14/91 instruction set - 33

THE JUMP/BRANCH INSTRUCTION DELAY SLOT IF RD ALU MEM WB BRANCH INSTR I-CACHE ID I ADDRESS TLB OP D-CACHE WB DELAY SLOT INSTR I-CACHE ID OP WB Address Available BRANCH TARGET INSTR I-CACHE ID OP Branch Now Takes ONE Cycle ONE CYCLE 8/14/91 instruction set - 32

WHAT IS A DELAYED BRANCH? WITHOUT DELAY WITH DELAY JUMP DELAY SLOT INSTRUCTION JUMP Delay Slot Instruction is Always Executed 8/14/91 instruction set - 31

BRANCH WITHOUT A DELAY-SLOT INSTRUCTION ADD IF RD ALU MEM WB JUMP IF RD ALU MEM WB ADDRESS SUB IF RD ALU MEM WB ADD IF RD ALU MEM WB Branch Would Take 2 Cycles 8/14/91 instruction set - 30

SUBROUTINE CALLS MAIN ROUTINE SUBROUTINE label: JAL label JR $31 JAL Stores Return Address in R31 R31 Must be Saved Before Nested Call Return Uses Jump Indirect on R31 8/14/91 instruction set - 29

COMPARE AND BRANCH BGE $8, $9, LABEL SLT $1, $8, $9 or 16-Imm BEQ $1, $0, LABEL Boolean TRUE or FALSE SLT + (BEQ or BNE) Permits all Relations to be Tested $1 is Temp Register Reserved for Assembler $0 Contains Zero 8/14/91 instruction set - 28

BEQ BNE } BRANCH INSTRUCTIONS SRC1, SRC2, LABEL Compare 2 Registers BLTZ } BLEZ SRC, LABEL BGEZ Compare Register to Zero Tests Sign Bit of SRC BGTZ BCzF BCzT } Test CpCond(z) Input LABEL z = 0 thru 3 8/14/91 instruction set - 27

BRANCH ADDRESSING MODE 31 0 31 16 15 0 OFFSET INSTR 16 32 X4 18 SIGN EXTEND 32 + 31 0 Range: 128KB EFFECTIVE ADDRESS 8/14/91 instruction set - 26

JUMP ADDRESSING MODE 31 28 27 0 31 26 25 0 PC TARGET 4 26 X4 28 31 28 27 0 EFFECTIVE ADDRESS Jump within 256MB Page 8/14/91 instruction set - 25 INSTR

CONTROL TRANSFER INSTRUCTIONS UNCOND Reg Imm COND JUMP JR J Bcc CALL JALR JAL BccAL Jumps are Unconditional Branches are Conditional AL = and Link 8/14/91 instruction set - 24

LOAD INSTRUCTION DELAY SLOT IF RD ALU MEM WB LOAD INSTR I-CACHE ID OP TLB D-CACHE WB DELAY SLOT INSTR I-CACHE ID OP WB Data Available I-CACHE ID OP Instruction Following LOAD Cannot Use Result of LOAD No Hardware Interlock ONE CYCLE 8/14/91 instruction set - 23

LOAD/STORE ADDRESSING MODE 8/14/91 instruction set - 22

LOAD/STORE BYTE 8/14/91 instruction set - 21

LOAD/STORE HALF-WORD 8/14/91 instruction set - 20

STORE WORD UNALIGNED MEMORY REGISTER SWL reg, 2 0 1 2 3 0 A B 4 C D A B C D SWR reg, 5 SWL/SWR - Store from Byte Address to Word Boundary Assumes Big-Endian 8/14/91 instruction set - 19

BIG & LITTLE ENDIAN DATA CODE BIG ENDIAN MEMORY 0 1 2 3 int i = 0x12345678; 0 12 34 56 78 struct { short j; short k; } sht = {0x1234, 0x5678}; 4 12 34 56 78 char str[] = "ABC"; 8 41 42 43 00 LITTLE ENDIAN MEMORY 0 1 2 3 0 78 56 34 12 Interpretation of Data in Memory Depends on Data type. 4 8 34 12 78 56 41 42 43 00 8/14/91 instruction set - 18

STORE WORD - LOAD BYTE CODE LUI $8, 0x1234 ORI $8, 0x5678 REGISTER (r8) 31 0 12 34 56 78 SW $8, address MEMORY MEMORY 12 34 56 78 78 56 34 12 0 1 2 3 REGISTER (r8) 31 0 0 1 2 3 LB $8, address REGISTER (r8) 31 0 00 00 00 12 00 00 00 78 BIG ENDIAN 8/14/91 instruction set - 17

LOAD/STORE BYTE CODE REGISTER (r8) 31 0 ADDI $8, $0, 0x41 00 00 00 41 SB $8, address LB $8, address MEMORY MEMORY 41 - - - 41 - - - 0 1 2 3 0 1 2 3 BIG ENDIAN LITTLE ENDIAN 8/14/91 instruction set - 16

LOAD/STORE WORD CODE LUI $8, 0x1234 ORI $8, 0x5678 REGISTER (r8) 31 0 12 34 56 78 SW $8, address LW $8, address MEMORY MEMORY 12 34 56 78 78 56 34 12 0 1 2 3 0 1 2 3 BIG ENDIAN LITTLE ENDIAN 8/14/91 instruction set - 15

ADDRESS OF BYTES WITHIN WORDS (FROM LR3000 DATA SHEET) BIG ENDIAN 31 24 23 16 15 8 7 0 Word Address Higher Address 8 9 10 11 8 4 5 6 7 4 Lower Address 0 1 2 3 0 LITTLE ENDIAN 31 24 23 16 15 8 7 0 Word Address Higher Address 11 10 9 8 8 Lower Address 7 6 5 4 3 2 1 0 4 0 Same Information, Different Form 8/14/91 instruction set - 14

BYTE ORDER MODE SELECTION 8/14/91 instruction set - 13

BYTE ORDER MODE SELECTION Big Endian Ordering: the address of a word or half-word corresponds to its most significant byte (MSB). Used by M68000 and IBM mainframes. 31 24 23 16 15 8 7 0 label: 0 1 2 3 Little Endian Ordering: the address of a word or half-word corresponds to its least significant byte (LSB). Used by i8086 and VAX. 7 0 15 8 23 16 31 24 label: 0 1 2 3 The names Big Endian and Little Endian are used because of the apt analogy to the two feuding islands in Gulliver's Travels by Jonathan Swift, and were coined by Danny Cohen in his article, "On Holy Wars and a Plea for Peace, " published in Computer, Vol. 14, No. 10, Oct 1981, pp. 49-54. 8/14/91 instruction set - 12

LOAD WORD UNALIGNED MEMORY REGISTER LWL reg, 2 0 1 2 3 0 A B 4 C D A B C D LWR reg, 5 LWL/LWR - Load from Byte Address to Word Boundary Assumes Big-Endian 8/14/91 instruction set - 11

LOAD WORD MEMORY 0 1 2 3 ALIGNED 0 A B C D LOAD WORD (LW) 0 1 2 3 0 A B C 4 D REGISTER 0 1 2 3 A B C D 0 A B 4 C D 0 4 0 1 2 3 B C D A LOAD WORD LEFT (LWL) LOAD WORD RIGHT (LWR) Assumes Big-Endian 8/14/91 instruction set - 10

LOAD/STORE ARCHITECTURE 8/14/91 instruction set - 9

LOAD CONSTANT Load 0x12345678 into R8 (LI $8, 0x12345678) Zero Fill LUI $8, 0x1234 $8 1 2 3 4 0 0 0 0 ORI $8, 0x5678 $8 1 2 3 4 5 6 7 8 Load 0x1234 into R8 (LI $8, 0x1234) Sign Extended ADDIU $8, $0, 0x1234 $8 0 0 0 0 1 2 3 4 Load -1 into R8 (LI $8, -1) Sign Extended ADDIU $8, $0, -1 $8 F F F F F F F F 8/14/91 instruction set - 8

THREE OPERAND INSTRUCTIONS 8/14/91 instruction set - 7

LOGICAL INSTRUCTIONS Reg Imm AND AND ANDI OR OR ORI NOR NOR X EXCL-OR XOR XORI SHIFT LEFT SLLV SLL SHIFT RIGHT SRLV SRL Immediate Value is 16-Bits, Zero Extended 8/14/91 instruction set - 6

ARITHMETIC INSTRUCTIONS SIGNED UNSIGNED Reg Imm Reg Imm ADD ADD ADDI ADDU ADDIU SUBTRACT SUB X SUBU X MULTIPLY MULT X MULTU X DIVIDE DIV X DIVU X SHIFT RIGHT X X SRAV SRA Immediate Value is 16-Bits, Sign Extended Signed Instructions Generate Exception on Overflow 8/14/91 instruction set - 5

INSTRUCTION SET LOAD/STORE ALU Byte addressed, Bi-endian Word, Halfword, Byte Signed, Unsigned Unaligned References Base + 16 bit Offset BRANCHES No Condition Codes; Compare and Branch One Instruction Branch on: A<0, A 0, A>0, A 0, A=B, A B When needed, two instructions for: A<B, A B, A>B, A B Branches execute next instruction before branching Also Jumps: J, JAL, JR, JALR Add, Sub, Logicals Rd:=Rs op Rt, 3 register operations Rt:=Rs op I, 2 register + 16 bit immediate Impact of compare & branch on arithmatic ops: Add/Sub with no trap, unsigned arith Add/Sub with trap, ADA, Pascal, LISP MULTIPLY/DIVIDE Compile most constants with shft/add/sub Hardware accelerates remaining 12 cycle mult, 35 cycle divide 64 bit product, or quotient/remainder 8/14/91 instruction set - 4

LR3000 INSTRUCTION FORMATS 31 0 J-TYPE OP TARGET JUMP 6 26 I-TYPE OP RS RT IMMEDIATE IMMEDIATE 6 5 5 16 R-TYPE OP RS RT RD SHFT FUNC REGISTER 6 5 5 5 5 6 SRC DST SRC/DST BR COND All Instructions are 32 Bits 8/14/91 instruction set - 3

Instruction Formats I-type: ALU immediate, Memory Op and Branch op rs rt 6 5 5 16 immediate R-type: Register to Register op rs rt rd samt func 6 5 5 5 5 6 J-type: Long jump, word addressed op target 6 26 SIMPLE, REGULAR FORMATS ALLOW FAST DECODE & PIPELINE 8/14/91 instruction set - 2

User State Registers r0 r0=0 f0 f1 r1 f2 f3 r31 32 32-bit Registers link f30 f31 16 64-bit Floating Point Registers hi lo Mul & Div Result Registers fcsr Control & Status Register pc Program Counter... NO CONDITION CODES AND A SIMPLE PROGRAMMING MODEL. 8/14/91 instruction set - 1