COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION

In this section, we look at some of the general characteristics of and the motivation
for a reduced instruction set architecture. Specific examples will be seen later in
this chapter. We begin with a discussion of motivations for contemporary complex
instruction set architectures.

Why CISC
We have noted the trend to richer instruction sets, which include a larger number
of instructions and more complex instructions. Two principal reasons have moti-
vated this trend: a desire to simplify compilers and a desire to improve performance.
Underlying both of these reasons was the shift to HLLs on the part of programmers;
architects attempted to design machines that provided better support for HLLs.

It is not the intent of this chapter to say that the CISC designers took the
wrong direction. Indeed, because technology continues to evolve and because archi-
tectures exist along a spectrum rather than in two neat categories, a black-and-white
assessment is unlikely ever to emerge. Thus, the comments that follow are simply
meant to point out some of the potential pitfalls in the CISC approach and to pro-
vide some understanding of the motivation of the RISC adherents.

The first of the reasons cited, compiler simplification, seems obvious, but it
is not. The task of the compiler writer is to build a compiler that generates good
(fast, small, fast and small) sequences of machine instructions for HLL programs
(i.e., the compiler views individual HLL statements in the context of surrounding
HLL statements). If there are machine instructions that resemble HLL statements,
this task is simplified. This reasoning has been disputed by the RISC researchers
([HENN82], [RADI83], [PATT82b]). They have found that complex machine
instructions are often hard to exploit because the compiler must find those cases
that exactly fit the construct. The task of optimizing the generated code to mini-
mize code size, reduce instruction execution count, and enhance pipelining is much
more difficult with a complex instruction set. As evidence of this, studies cited
earlier in this chapter indicate that most of the instructions in a compiled program
are the relatively simple ones.

The other major reason cited is the expectation that a CISC will yield smaller,
faster programs. Let us examine both aspects of this assertion: that programs will be
smaller and that they will execute faster.
There are two advantages to smaller programs. First, because the program
takes up less memory, there is a savings in that resource. With memory today being
so inexpensive, this potential advantage is no longer compelling. More important,
smaller programs should improve performance, and this will happen in three ways.
First, fewer instructions means fewer instruction bytes to be fetched. Second, in a
paging environment, smaller programs occupy fewer pages, reducing page faults.
Third, more instructions fit in cache(s).

https://www.kancloud.cn/wintry/python3/742475

CPU体系架构

 

RISC与CISC

Reduced Instruction Set Computer
Complex Instruction Set Computer

RISC(精简指令集计算机)和CISC(复杂指令集计算机)是当前CPU的两种架构。
它们的区别在于不同的CPU设计理念和方法。

早期的CPU全部是CISC架构,它的设计目的是要用最少的机器语言指令来完成所需的计算任务。
比如对于乘法运算,在CISC架构的CPU上,您可能需要这样一条指令:
MUL ADDRA, ADDRB
就可以将ADDRA和ADDRB中的数相乘并将结果储存在ADDRA中。
将ADDRA, ADDRB中的数据读入寄存器,
相乘和将结果写回内存的操作全部依赖于CPU中设计的逻辑来实现。
这种架构会增加CPU结构的复杂性和对CPU工艺的要求,但对于编译器的开发十分有利。
比如上面的例子,C程序中的a*=b就可以直接编译为一条乘法指令。
今天只有Intel及其兼容CPU还在使用CISC架构。


RISC架构要求软件来指定各个操作步骤。
上面的例子如果要在RISC架构上实现,将ADDRA, ADDRB中的数据读入寄存器,相乘和将结果写回内存的操作都必须由软件来实现,
比如:

MOV A, ADDRA;
MOV B, ADDRB;
MUL A, B;
STR ADDRA, A

这种架构可以降低CPU的复杂性以及允许在同样的工艺水平下生产出功能更强大的CPU,但对于编译器的设计有更高的要求。

smaller programs should improve performance RISC(精简指令集计算机)和CISC(复杂指令集计算机)是当前CPU的两种架构 区别示例的更多相关文章

  1. smaller programs should improve performance

    COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION In this section, we l ...

  2. RISC精简指令集系统计算机

    特点: 选用使用频率高的简单指令,复杂指令由简单指令组合完成 固定指令长度 只有Load/Store指令访存,其他指令都在寄存器中进行 CPU中寄存器数量多 一定采用指令流水,大部分指令在一个时钟周期 ...

  3. (转) Ensemble Methods for Deep Learning Neural Networks to Reduce Variance and Improve Performance

    Ensemble Methods for Deep Learning Neural Networks to Reduce Variance and Improve Performance 2018-1 ...

  4. ARM 精简指令集与复杂指令集

    什么是ARM,CISC RISC 又是什么   最近苹果公司召开了最新发布会,苹果PC将采用自研的ARM芯片,这将使苹果PC.移动端.平板成为同一个硬件下的系统.而ARM使用的就是CISC精简指令集, ...

  5. improve performance whilemaintaining the functionality of a simpler and more abstract model design of processor hardware

    Computer Systems A Programmer's Perspective Second Edition In this chapter, we take a brief look at ...

  6. 微信小程序——Now you can provide attr "wx:key" for a "wx:for" to improve performance.

    在官方的swiper(滑块视图容器)中demo代码,运行时会出现Now you can provide attr "wx:key" for a "wx:for" ...

  7. Now you can provide attr "wx:key" for a "wx:for" to improve performance. 微信小程序警告

    Now you can provide attr "wx:key" for a "wx:for" to improve performance为警告,不处理不影 ...

  8. 小程序开发-Now you can provide attr "wx:key" for a "wx:for" to improve performance

    Now you can provide attr "wx:key" for a "wx:for" to improve performance 是一个关于性能优 ...

  9. 微信小程序开发warning: Now you can provide attr "wx:key" for a "wx:for" to improve performance

    用微信官方的模板发现突然报了这个warning,检查原因: 官方解释: wx:key 如果列表中项目的位置会动态改变或者有新的项目添加到列表中,并且希望列表中的项目保持自己的特征和状态(如 <i ...

随机推荐

  1. mORMot学习笔记 (一)

    官方网站:https://synopse.info/fossil/wiki/Synopse+OpenSource 下载地址:https://synopse.info/fossil/wiki?name= ...

  2. host文件简介及修改后不能保存解决方法

    一.文件概述 Hosts是一个没有扩展名的系统文件,可以用记事本等工具打开,其作用就是将一些常用的网址域名与其对应的IP地址建立一个关联“数据库”,当用户在浏览器中输入一个需要登录的网址时,系统会首先 ...

  3. c++实现单向链表的一些操作

    #include<iostream> #include <algorithm> #include <vector> #include <set> #in ...

  4. 并发编程: 生产消费模型、死锁与Rlock、线程、守护线程、信号量、锁

    一.守护进程 二.互斥锁 三.抢票 四.进程间通讯 五.进程间通讯2 一.守护进程 """ 进程间通讯的另一种方式 使用queue queue 队列 队列的特点: 先进的 ...

  5. onload;readystatechange;DOMContentLoaded事件

    当文档的 readyState 属性发生改变时,会触发 readystatechange 事件. onload 事件会在页面或图像加载完成后立即发生 当纯HTML被完全加载以及解析时,DOMConte ...

  6. CSS性能优化的8个技巧

    本文作者:高峰,360奇舞团前端工程师,W3C性能工作组成员,同时参与WOT工作组的学习. 我们都知道对于网站来说,性能至关重要,CSS作为页面渲染和内容展现的重要环节,影响着用户对整个网站的第一体验 ...

  7. 2018-2019 ACM-ICPC Brazil Subregional Programming Contest B. Marbles(博弈)

    题目链接:https://codeforc.es/gym/101908/problem/B 题意:两个人玩游戏,有 n 块石头,初始坐标为(x,y),一次操作可以将一块石头移动到(x - u,y),( ...

  8. 【SQL-历史执行语句查询】 查询对数据库执行了哪些SQL

    Sql语句 QS.creation_time as '创建时间', ), (( THEN DATALENGTH(st.text) ) ) AS '查询语句' , ST.text as '执行文本', ...

  9. Docker 阿里云镜像加速

    1.进入阿里云镜像加速页面: https://cr.console.aliyun.com/#/accelerator 2.修改/etc/docker/daemon.json文件配置,没有则新建: ? ...

  10. kubernetes1.11.1 部署prometheus

    部署前提:已经安装好了kubernetes的集群,版本是1.11.1,是用kubeadm部署的. 2台虚拟机:master:172.17.1.36      node1:172.17.1.40 pro ...