What are the differences between x86 and arm under Linux?

Source: Internet
Author: User

Problem:

Recently, with a Samsung i5 processor, the Windows tablet, and the ipad, as well as other mobile phones using arm processors, compared to a lot more heat, and even need to use a fan to cool, a lot of power consumption.

Then it is very strange, in the case that the frequency difference is not big, and the actual implementation of the same situation, the x86 architecture of the processor's heat and power consumption why is it so big? Is this difference between the hardware and the processor's instruction set itself, or is it a software-level problem?

Answer 1:

Said x86 and ARM processor "actual implementation effect is almost" in fact, something wrong. Landlord also said the comparison of several devices are mainly Windows tablet, ipad and smartphones. The programs on these platforms are applications in mobile environments, most of which are simple in logic and have nothing to say about computing. The ARM processor itself is positioned on an embedded platform to handle lightweight, purpose-built programs that are now handy for mobile devices. x86 is located on desktops and servers, many of which are computationally intensive, such as multimedia editing, scientific computing, simulation, and so on. So it is not good to compare x86 and arm in the mobile environment to make it "almost".

ARM processors are based on a simplified instruction set (RISC) architecture due to different positioning. A small number of instruction sets simplifies the design of hardware logic and reduces the number of transistors, which means low power consumption. And because the mobile platform application is usually simple, the program control flow is not complex, the execution efficiency is not necessary, so the pipeline, branch prediction and other hardware logic is relatively simple. These all reduce the total number of transistors. And because mobile devices have battery energy limitations, ARM's power management is specifically designed as an important part. For example, the processor of a mobile device usually operates at a very low frequency during standby, and can even temporarily turn off idle cores and coprocessors to reduce power consumption.

x86 is very different. x86 is a complex instruction set (CISC) architecture, and there are many machine instructions for performing a specialized task (such as MMX, SSE directives) efficiently. This makes the logic of hardware complex, the number of transistors is huge. For efficient operation, the x86 architecture has a long pipeline to achieve instruction-level parallelism (ILP). A disadvantage of the long pipeline is that when the branch is encountered, if the pre-loading branch instruction is not the true branch of the future, it is expensive to empty the whole flow. Therefore, x86 must have a complex branch prediction mechanism to ensure the efficiency of the pipeline. Plus multi-level cache, support Hyper-threading, virtualization and so on, x86 complexity is actually quite high.

Answer 2:

Because ARM is designed for low power consumption, the X86 is for high performance. You want arm to do X86 the same performance, is bound to increase the core complexity, increase instruction set, then you guess arm to X86 also how much power advantage? X86 streamlined core size abandoned part of the instruction set, as well as the power consumption of 5 W atom, you have to ask why those X86 mobile phone power consumption is high, because there is no special for the X86 platform development of mobile app, you run on the X86 mobile app all two times the conversion run, the chip has been high load. Your arm phone has been high load power consumption is not high fever?

Arm and x86 a few simple comparisons

The processor usually refers to the computing core and the control core of a single computer. But with the advent of mobile devices, processors are also emerging in mobile terminals such as smartphones and tablets, allowing changes in the processor market to begin.

Intel is the undisputed overlord in the PC and enterprise processor market, and arm is the emerging overlord in the mobile terminal market. Intel focuses on high performance, providing excellent performance support for individual users and business users, while ARM focuses on low power consumption, which brings long standby for mobile phones and tablet users. Why do these two seemingly disjoint enterprises develop into the opposite situation now?

In the mobile terminal market, ARM is the new overlord. Intel focuses on high performance, providing excellent performance support for individual users and business users, while ARM focuses on low power consumption, which brings long standby for mobile phones and tablet users. Why do these two seemingly disjoint enterprises develop into the opposite situation now?

Technology development is the main reason for the direct competition of two companies, and in the Web2.0 era, the rise of companies such as Facebook and Google has changed the three core technologies of the data center: computing, storage and networking.

How ARM meets data center requirements

Low power consumption is one of the advantages of ARM processors, but when it comes to the enterprise domain, its discovery does not have a 64-bit architecture processor, so on October 31, 2012 arm introduced the new ARMV8 architecture Armcortex-a50 processor family of products to meet the needs of enterprise-class market applications.

To compensate for its experience in the enterprise market, ARM has also courted a considerable number of successful experiences in the server sector with AMD.AMD, an industry-leading 64-bit microprocessor technology and extensive IP portfolio with OEM, ODM, and ISV experience, ARM's expansion in the data center area will be facilitated to meet the specific needs of the data center domain.

First, performance:

X86-structured computers are much faster and much stronger in terms of performance than arm-structured systems. X86 CPU random is more than 1G, dual-core, quad-core large lines, usually using 45nm (or even more advanced) process of production, and arm: The CPU is usually hundreds of trillion, only recently 1G of the CPU, the process is usually used in less than 65nm processes, It can be said that arm is not an opponent of the X86 structural system at all in terms of performance and production processes.

But ARM's advantage does not lie in the performance is powerful but lies in the efficiency, the ARM uses the RISC pipelining instruction set, in completes the comprehensive work aspect is at the disadvantage, but in some tasks relatively fixed application situation its superiority can play incisively and vividly.

Second, expand capacity

X86 structure of the computer using "bridge" way with the expansion of equipment (such as: Hard disk, memory, etc.) to connect, and x86 structure of the computer appeared nearly 30 years, its supporting expansion of the type of equipment and more inexpensive, so the x86 structure of the computer can be easily extended performance, such as increased memory, hard disk and so on.

ARM structure of the computer through a dedicated data interface to make the CPU and data storage device connection, so arm storage, memory and other performance expansion difficult to carry out (generally in the product design has been set up its memory and data storage capacity), so the use of ARM structure of the system, generally do not consider the expansion. Basically adhere to the "good enough" principle.

Third, the compatibility of the operating system

The X86 system, built by Microsoft and Intel's Wintel Alliance Eminence, has monopolized the PC operating system for nearly 30 years, forming a huge user base and solidifying the habits of many users, while the x86 system has formed a unified standard in hardware and software development. Almost all x86 hardware platforms have direct access to Microsoft's Windows system and almost all of the tool software that is now popular, so the x86 system has an unparalleled advantage in terms of compatibility.

ARM system almost all use Linux operating system, and almost all of the hardware system to build their own system, and other systems can not be compatible, which also led to its application software is not easy to transplant, which has severely restricted the development and application of ARM system. Google developed an open Android system, unified arm structure of the operating system, so that the new arm-based computer system has a unified, open, free operating system for the development of ARM to provide a strong support and power.

Comparison of advantages and disadvantages of x86 and ARM

First, background knowledge

The strength of instruction is an important indicator of CPU, and instruction set is one of the most effective tools to improve the efficiency of microprocessor. From the current mainstream architecture, instruction set can be divided into complex instruction set (CISC) and thin instruction set (RISC) two parts. Accordingly, micro-processing with the complexity of micro-instructions can also be divided into CISC and RISC two categories.

CISC is a chip design system designed to facilitate programming and improve the efficiency of memory access. Before the mid 1990s, most microprocessors used the CISC system, including Intel's 80x86 and Motorola's 68K series. That is to say, the X86 architecture belongs to the CISC system.

RISC is a chip design system designed to improve the speed of processor operation. Its key technology is pipelining (pipelining): Multiple instructions are completed in one clock cycle. And the ultra-pipeline and superscalar technology has been widely used in chip design. RISC systems are used in non-x86 faction high performance microprocessor CPUs, such as the Holtek MCU family.

ARM (Advanced RISC machines) can be thought of as a company name, or as a generic term for a class of microprocessors, or as a technology name. The ARM architecture is now recognized as the industry's leading 32-bit embedded RISC microprocessor architecture, all ARM processors share this architecture.

Therefore, we can compare the X86 instruction set with the arm instruction set from the comparison of the system that belongs to it.

Ii. comparison of CISC and RISC

A CISC

1. Directive characteristics of the CISC system

1) Use the Micro code. The instruction set can be executed directly in the micro-code memory (much faster than the main memory), the newly designed processor can execute the same instruction set by simply adding fewer transistors, or it can quickly write a new instruction set program.

2) a large instruction set. You can reduce the number of lines of code required for programming and reduce the burden on programmers. Instruction set for high-level languages: Includes dual-operation meta-format, register-to-register, register-to-memory, and memory-to-register instructions.

2. Advantages and disadvantages of CISC system

1) Advantages: Can effectively shorten the new instruction of the micro-code design time, allowing designers to achieve CISC system machine upward compatibility. The new system can use a set of instructions that contains an earlier system, and can use the same software that was used on an earlier computer. In addition, the format of the micro-program instruction matches the high-level language, so the compiler does not have to rewrite it.

2) Disadvantages: Instruction set and chip design more complex than the previous generation of products, different instructions, need different clock cycle to complete, the implementation of slower instructions, will affect the efficiency of the entire machine execution.

Two Risc

1. Instruction characteristics of RISC system

1) Streamlined instruction set: contains simple, basic instructions that can be combined into complex instructions through these simple, basic instructions.

2) instructions of the same length: the length of each instruction is the same and can be done in a single operation.

3) Single Machine cycle instruction: Most instructions can be done in a machine cycle and allow the processor to execute a series of instructions at the same time.

2. Advantages and disadvantages of RISC system

1) Advantages: In the use of the same chip technology and the same operating clock, the RISC system will run at a speed of CISC times. Since the instruction set of RISC processor is streamlined, its memory management unit, floating point unit and so on can be designed on the same chip. RISC processors are simpler to design than corresponding CISC processors, require less time, and can use more advanced technologies than CISC processors to develop faster next-generation processors.

2) Cons: The operation of multiple instructions makes it necessary for program developers to carefully select the appropriate compiler, and the amount of code written will become very large. The other is that RISC processors require faster storage, which is usually integrated inside the processor, or L1 cache (first-level cache).

As described above, to further compare the differences between CISC and RISC, the following points can be analyzed:

1. The formation of instructions: CISC because of the complex instructions, the use of micro-code control unit design, and RISC instruction 90% is done directly by the hardware, only 10% of the instructions are composed by the software to complete, so the instruction execution time RISC is shorter, but RISC required ROM space is relatively large, The size of RAM usage should be relative to the application of the program.

2. Addressing mode: CISC need more addressing mode, and RISC only a few addressing modes, so the CPU in the calculation of memory valid address, CISC occupy more bus time.

3. Instruction execution: The format of the CISC instruction is different, the number of cycles in execution is not uniform, and the RISC structure is just the opposite, so it is suitable to use the design of pipeline processing architecture, and then can achieve an average one-week direction to complete an instruction. Obviously, in the design RISC is simpler than CISC, at the same time because of the cisc of the execution of too many steps, idle unit circuit waiting time growth, not conducive to parallel processing design, so in terms of performance RISC more than CISC or the upper hand, but RISC because of the instruction after the simplification of the application code becomes larger, Requires a large memory space, and there are many kinds of instructions, such as the shortcomings.

Three X86 instruction set and arm instruction set

1. X86 instruction Set

The X86 instruction set was specifically developed by Intel for its first 16-bit CPU (i8086), and later in the computer to increase the floating-point data processing capabilities of the X87-chip series of mathematical coprocessors and the use of X87 instructions, the X86 instruction set and X87 instruction set will be collectively known as the X86 instruction set. Although with the development of CPU technology, Intel has developed a new i80386, i80486, but in order to ensure that the computer can continue to run the various applications developed in the past to protect and inherit rich software resources, so all the CPUs produced by Intel company still continue to use the X86 instruction set , so its CPU still belongs to the X86 series. Because the Intel X86 series and its compatible CPUs all use the X86 instruction set, they form today's vast X86 series and compatible CPU lineup.

In addition to the many features of the above CISC, the X86 instruction set has several prominent drawbacks:

Universal Register Group-The effect on the CPU core structure. The X86 instruction set has only 8 universal registers, so CISC CPU execution is the most time to access the data in the memory, not the registers. This slows down the entire system. RISC systems tend to have a lot of universal registers, and the use of overlapping register windows and register heap technology to make the register resources are fully utilized.

Decoding-the effect on the external core of the CPU. Decoder (Decode Unit), which is what the x86 CPU has. The function is to convert the variable-length x86 instruction to a fixed-length, RISC-like instruction, and pass it on to the RISC kernel. Decoding is divided into hardware decoding and micro-decoding, for simple x86 instruction as long as the hardware decoding can, faster, and encountered the complex x86 instructions need to be micro-decoding, and it is divided into several simple instructions, the speed is slow and very complex. Athlon or PIII, the old-fashioned CISC's X86 instruction set severely hampered their performance.

Small addressing range-constrains the user's needs. Even if AMD developed the X86-64 architecture, while addressing some of the drawbacks inherent in traditional X86, such as the expansion of addressing ranges, this improvement does not directly result in a performance improvement.

(2) ARM instruction set

In comparison, the instruction format of the arm instruction set based on RISC is uniform, the kind is less, and the addressing method is less than the complex instruction set. Of course, processing speed is much higher. The ARM processor is known as a streamlined instruction set processor (RISC). All of its instructions are made up of simple instructions, which means that the corresponding hardware line can be optimized as much as possible, and the execution rate is increased, relative to the shortest time required for an instruction. Because of the simplification of the instruction set, a lot of work must be done by combining simple instructions, while the work for the more complex combination needs to be performed by the compiler (compiler), and the X86 instruction set of the CISC system is more than the instruction set provided by the hardware, so many tasks can be replaced by one or several instructions. The compiler's work is thus much reduced.

In addition to the many features of RISC described above, some other features of the arm instruction set architecture can be summarized as follows:

ARM Features: 1) small size, low power consumption, low cost, high performance, 2) support thumb (16-bit)/arm (32-bit) dual instruction set, good compatibility with 8-bit/16-bit devices, 3) Large use of registers, instruction execution faster; 4) Most data operations are done in registers; 5) addressing The method is flexible and simple, the execution efficiency is high; 6) The instruction length is fixed; 7) pipeline processing mode; 8) Load-store structure.

Some of ARM's non-RISC instruction architectures: 1) allow the execution period of some specific instructions to be variable to reduce power consumption, reduce area and code size, 2) add a bucket shifter to extend the function of certain instructions, 3) use a 16-bit thumb instruction set to increase code density; 4) Use conditional execution directives to improve code density and performance, 5) use enhanced directives to achieve digital signal processing.

(iv) Summary

Therefore, a large number of complex instructions, variable instruction length, a variety of addressing methods of these CISC characteristics, but also the shortcomings of CISC, because these have greatly increased the difficulty of decoding, and in the current high-speed hardware development, the complexity of instructions brought about by the speed of the increase in the decoding of the time has not been wasted. In addition to the personal PC market with the X86 instruction set, servers and larger systems have long been CISC. The reason x86 still exists is to be compatible with a large number of software on the x86 platform, and the implementation of its architecture composition is not too difficult. The most characteristic of the arm instruction of RISC system is that the instruction length is fixed, the type of instruction is few, the type of addressing is few, most of them are simple instruction and can be completed in one clock cycle, so it is easy to design superscalar and pipelining, many registers and a large number of operations between registers. The advantage is self-evident, therefore, the ARM processor becomes the current most popular processor family, is one of several mainstream embedded processing architecture. RISC is now at its zenith, and Intel seems to eventually abandon x86 to RISC architecture. In fact, with the RISC processor in the embedded field, the traditional X86 series CISC processor in the positive improvement of Intel Company also overcome the problem of high power consumption, become some high-performance embedded devices, the best choice, developed to today, The boundaries between CISC and RISC are no longer so distinct, and RISC's own design is becoming more complex (not entirely based on CISC's ideas), because all the CPUs that are actually used need to constantly improve performance, so adding new features to the architecture is unavoidable. On the other hand, processors that were originally considered CISC architectures also absorbed many of the advantages of RISC, such as the RISC architecture used in the internal implementation of the Pentium processor, where complex instructions were internally broken down into multiple thin instructions, but for the outside of the processor, To maintain compatibility or to display it in a CISC-style instruction set.

What are the differences between x86 and arm under Linux?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.