资源预览内容
第1页 / 共66页
第2页 / 共66页
第3页 / 共66页
第4页 / 共66页
第5页 / 共66页
第6页 / 共66页
第7页 / 共66页
第8页 / 共66页
第9页 / 共66页
第10页 / 共66页
亲,该文档总共66页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
Computer Architecture -A Quantitative Approach 计算机系统结构计算机系统结构 CHAPTER 2 Instruction Set Principles and Examples 指令集设计的一些原则和例子 王奕 Estelle.ywanggmail.com2.2Chapter2 指令集系统和一些例子n2.1 Introductionn n2.2 Classifying Instruction Set Architectures2.2 Classifying Instruction Set Architectures( (指令指令 集结构的分类集结构的分类) )n n2.3 Memory Addressing2.3 Memory Addressing( (内存寻址方式内存寻址方式) ) n2.4 Addressing Modes for Signal Processingn n2.5 Type and Size of Operands2.5 Type and Size of Operands( (操作数类型和大小操作数类型和大小) ) n2.6 Operands for Media and Signal Processingn n2.7 Operations in the Instruction Set2.7 Operations in the Instruction Set( (指令中的操作指令中的操作) ) n2.8 Operations for Media and Signal Processingn n2.9 Instructions for Control Flow2.9 Instructions for Control Flow( (控制流中的指令控制流中的指令) )n n2.10 Encoding an Instruction Set2.10 Encoding an Instruction Set( (指令编码指令编码) ) n2.11 The Role of Compilers n2.12 The MIPS Architecture2.32.1 介绍n3类应用领域FDesktop Computing(桌面计算)emphasizes performance of programs with integer and floating- point data types, with little regard for program size or processor power consumptionFServers(服务器)are used primarily for databases, file server, and Web Applications, plus some time-sharing(分时) applications for many usersFEmbedded Applications (嵌入式应用)value(重视) cost and power, so code size is important because less memory is both cheaper and lower power2.4n指令集设计的任务FClassifying Instruction Set Architectures (指令集系统的分类) FMemory Addressing(存储器寻址)FOperations in the Instruction Set(指令集的操作)FType and Size of Operands(操作数的大小和类型)FEncoding an Instruction Set(指令集的编码)FOptimizing an Instruction Set(指令集优化)2.5n设计指令集系统结构F清楚应用的需求, 和统一/特殊系统的发展趋势F对真正的计算机指令集进行统计F考虑到对编译器和OS的支持2.62.2 指令系统结构的分类nCPU的特殊内部存储结构Fstack architecture (堆栈结构)4The operands are implicitly on the top of the stack alp3000/70 Faccumulator architecture (累加器结构)4One operand is implicitly the accumulator PDP-8FGPR(General-Purpose Register) architecture (通用寄存器结构) 4Have only explicit operands-either registers or memory locations 2.7指令系统结构的分类(2)2.8指令系统结构的分类(3)nALU的指令F 2,3n存储器地址的操作数在ALU的操作的指令F0, 1, 2, 3FRegister-Register (0) - Load/StoreFRegister-Memory (1)FMemory-Memory (23)2.92.10Example : C=A+B executes in three machine types Assuming:op1byte,M2 bytes,r0.5 byteaccumulator architectureLoad A Add B Store CInstruction: I 1+2+1+2+1+1+210 byteData:D4+4+412 byteTotal: M10+1222 byteInstruction :1+2+1+2+1+29 byte Data :D 12 byte Total :M9+1221 bytestack architecturePush A Push B Add Pop C假设:操作码为1字节;存储器操作数说明为2字节;寄存器说明为0.5字节;数据长度为4字节2.11GPR architectureR-R型(L/S结构)Load R1, A Load R2, B Add R3, R1, R2 Store R3, CR-M型Load R1, A Add R1, B Store R1, CM-M型Add C, A, BInstruction :=3(1+0.5+2)+(1+0.53) 34+3=15 byte Data :D12 byte Total :M15+1227 byteInstruction : I 3(1+0.5+2)3412 byte Data :D12 byte Total :M12+1224 byteInstruction : I 1+237 byte Data :D12 byte Total :M7+129 byte2.12三种通用计算机的优点和缺点TypeAdvantagesDisadvantages R-R (0,3)Simple, fixed-length instruction encoding. Simple code generation model. Instructions take similar numbers of clocks to execute(See App. A)Higher instruction count than architectures with memory references in instructions. More instructions and lower instruction density leads to larger programs R-M (1,2)Data can be accessed without a separate load instruction first. Instruction format tends to be easy to encode and yields good density.Operands are not equivalent since a source operand in a binary operation is destroyed. Encoding a register number and a memory address in each instruction may restrict the number of registers. Clocks per instruction vary by operand location. M-M (2,2) or (3,3)Most compact. Doesnt waste registers for temporaries. Large variation in instruction size, especially for three-operand instructions. In addition, large variation in work per instruction. Memory accesses create memory bottleneck.(Not used today)2.13nOperation categories(指令集类型)FCISC (Complex Instruction Set Computer)(复杂指令集计算机)4Enhance the function of instructions, many kinds of operations, each instructions function is strongFRISC(Reduced Instruction Set Computer) (精减指令集计算机)4Reduce the function of instructions, Provide basic instructions, each instructions function is weaknTwo completely different directions for Instruction Set Architectures指令系统结构的分类(3)2.141. CISC(复杂指令集计算机)nComplex Instruction Set ComputerF背景: 缺少存储资源, 着重编译器的优化F技术: 加强了指令的功能, 设计并替代了软件实现 的比较复杂的指令2.152. RISCn降低了CPI: CPUtime=Instr_Count * CPI * Clock_cyclen减少了指令集:只保留了最基础的操作nLoad/Store 系统结构n简单指令, 简单寻址方式, 定长指令格式 2.16RISC的发展历史nLoad/Store architecture: CDC6600(1963)- CRAY1(1976)nIBM801(1979年), first RISC computern1980, Patterson(Berkeley) may include or be followed by assemblerLanguage dependent; Machine independentSomewhat language dependent;largely machine independentSmall language dependencies;machine dependencies slightHighly machine dependent;lan
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号