为什么是86丑吗?又名比别人时,为什么考虑x86的劣势? [英] Why is x86 ugly? aka Why is x86 considered inferior when compared to others?

查看:227
本文介绍了为什么是86丑吗?又名比别人时,为什么考虑x86的劣势?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我一直在阅读一些SO档案,对遇到的x86架构的语句。

Recently I've been reading some SO archives and encountered statements against x86 architecture.


  • <一个href=\"http://stackoverflow.com/questions/2667256/why-do-we-need-different-cpu-architecture-for-server-mini-mainframe-mixed-cor\">Why我们需要为服务器和放大器不同的CPU体系结构;微型/大型主机和功放;混合内核?说的 PC体系结构是一个烂摊子,任何操作系统开发商会告诉你。

<击> http://stackoverflow.com/questions/82432/is-learning-assembly-language-worth-the-effort说的实现了x86架构是可怕的,充其量内容删除线

http://forums.anandtech.com/showthread.php?t = 976577 说的大多数大学教装配在像MIPS,因为它更简单易懂,x86汇编实在是太丑了

和更多的评论像


  • 比起一般的架构,X86很烂pretty严重。

这绝对是传统的智慧X86不如MIPS,SPARC和PowerPC 86是丑陋

我试图寻找,但没有找到任何原因。我没有可能发现86不好,因为这是我熟悉的唯一建筑。

I tried searching but didn't find any reasons. I don't find x86 bad probably because this is the only architecture I'm familiar with.

有人可以请给我理由认为丑陋的x86 /坏/下比别人。

Can someone kindly give me reasons for considering x86 ugly/bad/inferior compared to others.

推荐答案

有关它的可能的原因情侣:

Couple of possible reasons for it:


  1. 86是一个比较老的 ISA (它的祖先是8086s,毕竟)

  2. 86已显著几经演变,但硬件要求保持与旧二进制文件的向后兼容性。例如,现代x86硬件仍包含本地运行16位code支持。此外,一些内存寻址模式存在使老年人code可互操作在同一处理器上,如实模式,保护模式,虚拟8086模式,和(AMD64)长模式。这会引起混乱一些。

  3. 86是CISC机。很长一段时间这意味着它比RISC机器像MIPS或ARM慢,因为指令有数据相互依赖性和标志的制作最指令级并行困难的形式来实现。现代实现翻译x86指令到一个名为类RISC指令微操作的下包括使这些种类的优化实用的硬件来实现的。

  4. 在某些方面,在x86并不逊色,只是不同而已。例如,输入/输出作为内存映射处理上绝大多数的架构,但不是在x86。 (注:现代的x86机器通常有rel=\"nofollow\"> DMA 支持某种形式的 ISA 仍然有像 I / O指令 OUT

  5. 在x86 ISA 有非常少的建筑寄存器,可以强制程序来往返通过内存比更频繁,否则是必要的。额外的指令需要做的,可能在有用的工作是这样度过起飞执行资源。与现代寄存器重命名的实现到一个大的物理寄存器文件可以保留许多指令在飞行中,但缺乏结构寄存器仍然是一个显著的弱点。从8至16的整数和矢量寄存器的x86-64的增加是在64位code中的最大的因素比32bit的快,不增加每个寄存器的宽度(与更高效的寄存器调用ABI一起)之一。从16到32的整数的寄存器的进一步增加将有助于一些,但不是为多。 (AVX512确实增加32个向量寄存器,虽然。)(<一href=\"http://stackoverflow.com/questions/2679882/why-is-x86-ugly-aka-why-is-x86-considered-inferior-when-compared-to-others/2679922?noredirect=1#comment56088321_2679922\">see评论)

  6. x86汇编code很复杂,因为86是具有许多功能复杂的架构。对于一个典型的MIPS机器上市的指令适合于单个字母大小的一张纸。针对x86等效上市填补了几页,而仅仅说明做多,所以经常需要他们做比上市能提供什么更大的解释。例如, MOVSB​​ 指令需要C code的相对较大的块来形容它做什么:

  1. x86 is a relatively old ISA (its progenitors were 8086s, after all)
  2. x86 has evolved significantly several times, but hardware is required to maintain backwards compatibility with old binaries. For example, modern x86 hardware still contains support for running 16 bit code natively. Additionally, several memory-addressing models exist to allow older code to inter-operate on the same processor, such as real mode, protected mode, virtual 8086 mode, and (amd64) long mode. This can be confusing to some.
  3. x86 is a CISC machine. For a long time this meant it was slower than RISC machines like MIPS or ARM, because instructions have data interdependency and flags making most forms of instruction level parallelism difficult to implement. Modern implementations translate the x86 instructions into RISC-like instructions called "micro-ops" under the covers to make these kinds of optimizations practical to implement in hardware.
  4. In some respects, the x86 isn't inferior, it's just different. For example, input/output is handled as memory mapping on the vast majority of architectures, but not on the x86. (NB: Modern x86 machines typically have some form of DMA support, and communicate with other hardware through memory mapping; but the ISA still has I/O instructions like IN and OUT)
  5. The x86 ISA has a very few architectural registers, which can force programs to round-trip through memory more frequently than would otherwise be necessary. The extra instructions needed to do this take execution resources that could be spent on useful work. Modern implementations with register renaming onto a large physical register file can keep many instructions in flight, but lack of architectural registers is still a significant weakness. x86-64's increase from 8 to 16 integer and vector registers is one of the biggest factors in 64bit code being faster than 32bit (along with the more efficient register-call ABI), not the increased width of each register. A further increase from 16 to 32 integer registers would help some, but not as much. (AVX512 does increase to 32 vector registers, though.) (see comment)
  6. x86 assembly code is complicated because x86 is a complicated architecture with many features. An instruction listing for a typical MIPS machine fits on a single letter sized piece of paper. The equivalent listing for x86 fills several pages, and the instructions just do more, so you often need a bigger explanation of what they do than a listing can provide. For example, the MOVSB instruction needs a relatively large block of C code to describe what it does:

if (DF==0) 
  *(byte*)DI++ = *(byte*)SI++; 
else 
  *(byte*)DI-- = *(byte*)SI--;

这是一个单指令操作的一个分支,一个负载,存储,和两个增加或是减少,其每一个将是一个RISC机器上单独的指令。虽然MIPS(以及类似的架构)的简单并不一定使他们优越,教学介绍汇编类是有意义的开始与简单的 ISA

编辑:这不应该是一个的庆典在x86 的派对!我别无选择,只好做扑给出的问题的措辞方式一定量。但随着(1)外,所有的这些东西都很好的理由(见注释)来完成。英特尔设计人员并不笨 - 他们想达到一些事情与他们的建筑,这些都是一些税种必须要付费,使这些东西成为现实


This is not supposed to be a bash the x86! party. I had little choice but to do some amount of bashing given the way the question's worded. But with the exception of (1), all these things were done for good reasons (see comments). Intel designers aren't stupid -- they wanted to achieve some things with their architecture, and these are some of the taxes they had to pay to make those things a reality.

这篇关于为什么是86丑吗?又名比别人时,为什么考虑x86的劣势?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆