RISC, CISC, And ISA Variations

2y ago
58 Views
2 Downloads
3.04 MB
42 Pages
Last View : Today
Last Download : 3m ago
Upload by : Ronnie Bonney
Transcription

RISC, CISC, and ISAVariationsHakim WeatherspoonCS 3410Computer ScienceCornell University[Weatherspoon, Bala, Bracy, McKee, and Sirer]

Announcements Prelim tonight Tuesday at 7:30pmGo to location based on NetID[a – g]* : HLS110 (Hollister 110)[h – mg]* : HLSB14 (Hollister B14)[mh – z]* : KMBB11 (Kimball B11)2

Announcements Prelim1: Time: We will start at 7:30pm sharp, so come earlyLocation: on previous slideClosed BookCannot use electronic device or outside materialPractice prelims are online in CMS Material covered everything up to end of this week Everything up to and including data hazards Appendix A (logic, gates, FSMs, memory, ALUs) Chapter 4 (pipelined [and non] MIPS processor withhazards) Chapters 2 (Numbers / Arithmetic, simple MIPSinstructions) Chapter 1 (Performance) Projects 1 and 2, Lab0-4, C HW13

iClicker QuestionWhich is not considered part of the ISA?A. There is a control delay slot.B. The number of inputs each instruction canhave.C. Load-use stalls will not be detected by theprocessor.D. The number of cycles it takes to execute amultiply.E. Each instruction is encoded in 32 bits.4

iClicker QuestionWhich is not considered part of the ISA?A. There is a control delay slot.B. The number of inputs each instruction canhave.C. Load-use stalls will not be detected by theprocessor.D. The number of cycles it takes to execute amultiply.E. Each instruction is encoded in 32 bits.5

Big Picture: Where are we gets ackMEM/WB6

Big Picture: Where are we going?compilerint x 10;x 2 * x 15;RISC‐Vassemblyaddi x5, x0, 10muli x5, x5, 2addi x5, x5, 15Cassemblermachinecode10r0r5op 15CPUx0 0x5 x0 10x5 x5 1 #x5 x5 * 2x5 x15 15op r-typer5x5r5shamt 1op addix5func sllCircuitsGatesTransistorsSilicon7

Big Picture: Where are we going?compilerint x 10;x 2 * x 15;RISC‐Vassemblyaddi x5, x0, 10muli x5, x5, 2addi x5, x5, 15CassemblermachinecodeCPUCircuitsHigh 1010010011Instruction SetArchitecture(ISA)GatesTransistorsSilicon8

Goals for TodayInstruction Set Architectures ISA Variations, and CISC vs RISC Peek inside some other ISAs: X86 ARM9

Next GoalIs RISC-V the only possible instruction setarchitecture (ISA)?What are the alternatives?10

Instruction Set Architecture VariationsISA defines the permissible instructions RISC-V: load/store, arithmetic, control flow, ARMv7: similar to RISC-V, but more shift, memory, &conditional ops ARMv8 (64-bit): even closer to RISC-V, no conditional ops VAX: arithmetic on memory or registers, strings,polynomial evaluation, stacks/queues, Cray: vector operations, x86: a little of everything11

Brief Historical Perspective on ISAsAccumulators Early stored-program computers had one register!EDSAC (Electronic Delay StorageAutomatic Calculator) in 1949Intel 8008 in 1972was an accumulator One register is two registers short of a RISC-V instruction! Requires a memory-based operand-addressing mode- Example Instructions: add 200 // ACC ACC Mem[200] Add the accumulator to the word in memory at address 200 Place the sum back in the accumulator12

Brief Historical Perspective on ISAsNext step, more registers Dedicated registers- E.g. indices for array references in data transferinstructions, separate accumulators for multiply or divideinstructions, top-of-stack pointer.Intel 8086“extended accumulator”Processor for IBM PCs Extended Accumulator- One operand may be in memory (like previousaccumulators).- Or, all the operands may be registers (like RISC-V).13

Brief Historical Perspective on ISAsNext step, more registers General-purpose registers- Registers can be used for any purpose- E.g. RISC-V, MIPS, ARM, x86 Register-memory architectures- One operand may be in memory (e.g. accumulators)- E.g. x86 (i.e. 80386 processors) Register-register architectures (aka load-store)- All operands must be in registers- E.g. RISC-V, MIPS, ARM14

TakeawayThe number of available registers greatly influenced theinstruction set architecture (ISA)MachineNum General Purpose RegistersArchitectural StyleYearEDSAC1Accumulator1949IBM 7011Accumulator1953CDC 66008Load-Store1963IBM 36018Register-Memory1964DEC PDP-81Accumulator1965DEC PDP-118Register-Memory1970Intel 80081Accumulator1972Motorola 68002Accumulator1974DEC VAX16Register-Memory, Memory-Memory1977Intel 80861Extended Accumulator1978Motorola 680016Register-Memory1980Intel Load-Store1985HP C32Load-Store1992DEC Alpha32Load-Store1992HP/Intel IA-64128Load-Store2001AMD64 (EMT64)16Register-Memory200315

TakeawayThe number of available registers greatlyinfluenced the instruction set architecture (ISA)16

Next GoalHow to compute with limited resources?i.e. how do you design your ISA if you havelimited resources?17

In the Beginning People programmed in assembly and machine code! Needed as many addressing modes as possibleMemory was (and still is) slowCPUs had relatively few registers Register’s were more “expensive” than external memLarge number of registers requires many bits to indexMemories were small Encouraged highly encoded microcodes as instructionsVariable length instructions, load/store, conditions, etc18

In the Beginning People programmed in assembly and machine code!E.g. x86 1000 instructions!- 1 to 15 bytes each- E.g. dozens of add instructions operands in dedicated registers, general purpose registers,memory, on stack, - can be 1, 2, 4, 8 bytes, signed or unsigned 10s of addressing modes- e.g. Mem[segment reg reg*scale offset]E.g. VAX Like x86, arithmetic on memory or registers, but also onstrings, polynomial evaluation, stacks/queues, 19

Complex Instruction SetComputers (CISC)20

TakeawayThe number of available registers greatlyinfluenced the instruction set architecture (ISA)Complex Instruction Set Computers werevery complex Necessary to reduce the number of instructionsrequired to fit a program into memory. However, also greatly increased the complexity ofthe ISA as well.21

Next GoalHow do we reduce the complexity of the ISAwhile maintaining or increasing performance?22

Reduced Instruction Set Computer (RISC)John Cock IBM 801, 1980 (started in 1975)Name 801 came from the bldg that housed the projectIdea: Possible to make a very small and very fast coreInfluences: Known as “the father of RISC Architecture”.Turing Award Recipient and National Medal of Science.23

Reduced Instruction Set Computer (RISC)Dave Patterson RISC Project, 1982UC BerkeleyRISC-I: ½ transistors &3x fasterInfluences: Sun SPARC,namesake of industryJohn L. Hennessy MIPS, 1981StanfordSimple, full pipelineInfluences: MIPS computersystem, PlayStation,Nintendo24

Reduced Instruction Set Computer (RISC)RISC-V Design PrinciplesSimplicity favors regularity 32 bit instructions Same instruction format works at 16- or 64-bit formatsSmaller is faster Small register fileMake the common case fast Include support for constantsGood design demands good compromises Support for different type of interpretations/classes25

Reduced Instruction Set ComputerRISC-V Reduced Instruction Set Computer (RlSC) 200 instructions, 32 bits each, 4 formats all operands in registers- almost all are 32 bits each 1 addressing mode: Mem[reg imm]x86 Complex Instruction Set Computer (ClSC) 1000 instructions, 1 to 15 bytes each operands in dedicated registers, general purposeregisters, memory, on stack, - can be 1, 2, 4, 8 bytes, signed or unsigned 10s of addressing modes- e.g. Mem[segment reg reg*scale offset]26

The RISC TenetsRISCCISC Single-cycle executionHardwired control Load/store architectureFew memory addressingmodesFixed-length insn format many multicycle operations microcoded multi-cycleoperations register-mem and mem-mem many modes many formats and lengthsReliance on compiler hand assemble to get goodoptimizationsperformanceMany registers (compilers few registersare better at using them)27

RISC vs CISCRISC PhilosophyRegularity & simplicityLeaner means fasterOptimize thecommon caseEnergy efficiencyEmbedded SystemsPhones/TabletsCISC RebuttalCompilers can be smartTransistors are plentifulLegacy is importantCode size countsMicro-code!Desktops/Servers28

ARMDroid vs WinTelAndroid OS on ARMprocessorWindows OS on Intel(x86) processor29

iClicker QuestionWhat is one advantage of a CISC ISA?A. It naturally supports a faster clock.B. Instructions are easier to decode.C. The static footprint of the code will besmaller.D. The code is easier for a compiler tooptimize.E. You have a lot of registers to use.30

iClicker QuestionWhat is one advantage of a CISC ISA?A. It naturally supports a faster clock.B. Instructions are easier to decode.C. The static footprint of the code will besmaller.D. The code is easier for a compiler tooptimize.E. You have a lot of registers to use.31

TakeawayThe number of available registers greatly influenced theinstruction set architecture (ISA)Complex Instruction Set Computers were very complex- Necessary to reduce the number of instructionsrequired to fit a program into memory.- However, also greatly increased the complexity of theISA as well.Back in the day CISC was necessary becauseeverybody programmed in assembly and machinecode! Today, CISC ISA’s are still dominant due to theprevalence of x86 ISA processors. However, RISCISA’s today such as ARM have an ever increasingmarket share (of our everyday life!).ARM borrows a bit from both RISC and CISC.32

Next GoalHow does RISC-V and ARM compare to eachother?33

RISC-V instruction formatsAll RISC-V instructions are 32 bits long, have 4formats R-type funct7 rs2 rs1 funct3 rd op7 bits I-type5 bits 5 bitsimm U-type5 bits 7 bitsrs1 funct3 rd12 bits S-type3 bits5 bitsimmrs27 bits5 bits 5 bits3 bits5 bits 7 bitsrs1 funct3 immimm20 bits3 bitsopop5 bits 7 bitsrdop5 bits 7 bits34

ARMv7 instruction formatsAll ARMv7 instructions are 32 bits long, has 3formatsR-typeopxop4 bits8 bitsI-typeopxop4 bits8 bitsJ-typersrd4 bits 4 bitsrsrdopxrt8 bits4 bitsimmediate4 bits 4 bits12 bitsopxopimmediate (target address)4 bits4 bits24 bits35

ARMv7 Conditional Instructionswhile(i ! j) {if (i j)i - j;In RISC-V, performance will beelseslow if code has a lot of branchesj - i;}Loop: BEQ Ri, Rj, End// if "NE" (not equal), then stay in loopSLT Rd, Rj, Ri// "GT" if (i j),BNE Rd, R0, Else// SUB Ri, Ri, Rj// if "GT" (greater than), i i-j;J LoopElse: SUB Rj, Rj, Ri// or "LT" if (i j)J Loop// if "LT" (less than), j j-i;End:36

ARMv7 Conditional Instructions while(i ! j) { if (i j) i - j; else j - i; }In ARM, can avoid delay due toBranches with conditionalinstructions0 10 0LOOP: CMP Ri, Rj // set condition "NE" if (i ! j)// "GT" if (i j),// or "LT" if (i j)0 00 1// if "GT" (greater than), i i-j; SUBGT Ri, Ri, Rj1 01 0 SUBLE Rj, Rj, Ri0 10 0 BNE loop// if "LE" (less than or equal), j j-i;// if "NE" (not equal), then loop37

ARMv7: Other Cool operationsShift one register (e.g. Rc) any amountAdd to another register (e.g. Rb)Store result in a different register (e.g. Ra)ADD Ra, Rb, Rc LSL #4Ra Rb Rc 4Ra Rb Rc x 1638

ARMv7 Instruction Set ArchitectureAll ARMv7 instructions are 32 bits long, has 3 formatsReduced Instruction Set Computer (RISC) properties Only Load/Store instructions access memory Instructions operate on operands in processor registers 16 registersComplex Instruction Set Computer (CISC) properties Autoincrement, autodecrement, PC-relative addressing Conditional execution Multiple words can be accessed from memory with a singleinstruction (SIMD: single instr multiple data)39

ARMv8 (64-bit) Instruction Set ArchitectureAll ARMv8 instructions are 64 bits long, has 3 formatsReduced Instruction Set Computer (RISC) properties Only Load/Store instructions access memory Instructions operate on operands in processor registers 32 registers and r0 is always 0NO MORE Complex Instruction Set Computer (CISC)properties NO Conditional execution NO Multiple words can be accessed from memory with asingle instruction (SIMD: single instr multiple data)40

Instruction Set Architecture VariationsISA defines the permissible instructions RISC-V: load/store, arithmetic, control flow, ARMv7: similar to RISC-V, but more shift, memory, &conditional ops ARMv8 (64-bit): even closer to RISC-V, no conditional ops VAX: arithmetic on memory or registers, strings,polynomial evaluation, stacks/queues, Cray: vector operations, x86: a little of everything41

ISA TakeawaysThe number of available registers greatly influenced theinstruction set architecture (ISA)Complex Instruction Set Computers were very complex Small # of insns necessary to fit program into memory.- greatly increased the complexity of the ISA as well.Back in the day CISC was necessary because everybodyprogrammed in assembly and machine code! Today, CISCISA’s are still dominant due to the prevalence of x86 ISAprocessors. However, RISC ISA’s today such as ARM havean ever increasing market share (of our everyday life!).ARM borrows a bit from both RISC and CISC.42

ARM 16 Load-Store 1985 MIPS 32 Load-Store 1985 HP PA-RISC 32 Load-Store 1986 SPARC 32 Load-Store 1987 PowerPC 32 Load-Store 1992 DEC Alpha 32 Load-Store 1992 HP/IntelIA-64 128 Load-Store 2001 AMD64 (EMT64) 16 Register-Memory 2003. 16 Takeaway The number of available registers greatly

Related Documents:

the ARM ISA (a RISC ISA) has dominated mobile and low-power embedded computing domains and the x86 ISA (a CISC ISA) has dominated desktops and servers. Recent trends raise the question of the role of the ISA and make a case for revisiting the RISC vs. CISC question. First, the computing landscape has quite radically changed from when the

Microcontrollers with small instruction set are called reduced instruction set computer (RISC) machines and those with complex instruction set are called complex instruction set computer (CISC). Intel 8051 is an example of CISC machine whereas microchip PIC 18F87X is an example of RISC machine. RISC CISC

x Introduction to RISC and CISC: LECTURE 15 RISC (Reduced Instruction Set Computer) RISC stands for Reduced Instruction Set Computer. To execute each instruction, if there is separate electronic circuitry in the control unit, which produces all the necessary signals, this approach of the

Computer Architecture 7 Chapter-1 Anatomy of a Computer Q.1. What is CISC Microprocessor? Ans.: CISC stands for complex instruction set computer. It was developed by Intel. CISC is a type of design for the computers. CISC based computer will have shorter programs w

- 162 standards, recommended practices, and technical report s - ISA Standards are consensus based and non-commercial in nature - Broad applicability to SCADA, automation and instrum entation ISA Standards are available at www.isa.org - For purchase as printed & PDF copies - ISA members can view most ISA Standards for free o nline 27

1) ISA-5.1 -Instrumentation Symbols and Identification. 2) ISA-5.2 -Binary Logic Diagrams for Process Operations. 3) ISA-5.3 -Graphic Symbols for Distributed Control/Shared Display Instrumentation, Logic, and Computer Systems. 4) ISA-5.4 -Instrument Loop Diagrams. 5) ISA-5.5 -Graphic Symbols for Process Displays. 6) ANSI/ISA-7.00.01 -Quality .

requirements for safety instrumented systems (SIS), a new edition of the IEC 61511 international standard was published. Recently published, ANSI/ISA 61511-1 brings the ISA standard into complete alignment with IEC 61511-1. This paper will review ten major themes of change between ANSI/ISA 84.00.01 and ANSI/ISA 61511-1. 1 Introduction

academic writing, the purpose of which is to explore complex concepts and issues. Terms like Zin essence or to summarise, are more appropriate. The use of the word Ztalking [ is unsuitable because the law is a concept and concepts are not capable of talking! Words that could be used instead include state, articulate or describe. Sentences Try to express a single idea or point in each sentence .