Apple mobile device processor instruction set ARMV6, ARMV7, armv7s, and arm64

Source: Internet
Author: User

ARM processors are known for their low power consumption and small size, and almost all handset processors are based on ARM, which is widely used in embedded systems Its performance is also excellent in the same power consumption products.

Armv6, ARMv7, armv7s, and arm64 are all instruction sets for ARM processors, and all instruction sets are in principle backwards compatible, such as the IPHONE4S CPU The default instruction set is the ARMV7 instruction set, but it is also compatible with the ARMV6 instruction set, but does not fully perform its performance when using the ARMV6 instruction set, which means that with the new features in the ARMV7 instruction set, the IPhone5 processor comes standard with the armv7s instruction set and also supports the ARMV7 instruction set, but performance optimization, which results in less efficient execution of the program.

It is important to note that the iOS emulator does not run the arm instruction set and compiles the x86 instruction set, so the device is only executed on the iOS device the corresponding arm instruction set.

Apple mobile device default instruction set so far (2014.8.22)

-------------------------------------------------------------------------------------

ARMV6 devices: IPhone, IPhone2, iphone3g, first generation, second generation IPod Touch

ARMV7 equipment: iphone3gs, IPhone4, iphone4s

ipad, IPad2, IPad3 (the New ipad), ipad Mini

ipod Touch 3G, ipod Touch4

armv7s equipment: IPhone5, IPHONE5C, IPad4 (IPad with Retina Display)

Arm64 devices: iphone5s, ipad Air, ipad mini2 (ipad mini with Retina Display)

-------------------------------------------------------------------------------------

The options associated with the instruction set in Xcode (Build Settings panel architectures):

Architectures:

indicates the set of instructions supported by the binary package that the selected target requires compilation to generate The support instruction set is implemented by compiling the corresponding binary packets, if there are multiple supported instruction sets , A packet containing multiple instruction set code is compiled, resulting in a large package that is generated by the final compilation.

Valid architectures:

indicates the set of instructions that may be supported Not all instruction sets indicated in the architectures list are supported, Valid architectures limits may be The intersection of the valid architectures and architectures lists , which is the the set of instructions supported for a lifetime as a binary package.

for example, set the architectures support arm instruction set to: armv7,armv7s, the supported instruction set for the corresponding valid architectures is set to: armv7s,arm64, At this point, the set of instructions supported by the Xcode generation binary package is only armv7s.  

Build Active Architecture only:

Indicates whether to compile only the set of instructions supported by the current connected device

This option works with two conditions that must be met before it works:

1. Set the value to Yes

2. Xcode successfully connected to the debug device

Suppose we set the build Active Architecture only value to Yes while Xcode connects to the phone iphone5s (matching instruction set arm64)

1. The first case

Architectures:armv7, armv7s, arm64

Validarchitectures:armv6, armv7s, arm64

Generating the instruction set supported by the binary package: arm64

2. The second case

Architectures:armv6, ARMv7, armv7s

Valid architectures:armv6, armv7s, arm64

Generating the instruction set supported by the binary package: armv7s

3. The third case

ARCHITECTURES:ARMV6, ARMv7

Valid architectures:armv6, armv7s, arm64

Generating the instruction set supported by the binary package: ARMV7

4. Fourth case

Architectures:armv6

Valid architectures:armv6, armv7s, arm64

generates the instruction set supported by the binary package: Although the compilation was successful, there was no target generation, because the armv6 instruction set is no longer supported from XCode4.5, the list is written in white.

5. Fifth case

Architectures:armv7, armv7s, arm64

Valid architectures:armv7,armv7s

Generating the instruction set supported by the binary package: compilation error,

No architectures to compile for (Only_active_arch=yes, ACTIVE arch=arm64, valid_archs=armv7 armv7s)

As you can see, when build Active Architecture only works:

Connected phone instruction set matching is from high to low (Arm64 > Armv7s > ARMv7) in turn

if the phone is connected to iphone5s, its default instruction set is arm64, if the architectures list is ARMV7, armv7s, you will choose Armv7s refers to The set is the target instruction set, and if the instruction set is included in the valid architectures list at this time, the successfully generated binary package only supports armv7s instruction set, if the Alid architectures list does not contain this instruction set, the compilation will be faulted:

No architectures to compile for (Only_active_arch=yes, ACTIVE arch=armv7s, valid_archs=armv7 arm64)

Similarly, if the architectures list is ARMV7, ARMV7 will be selected as the target instruction set, if the valid architectures list package with the armv7 instruction set, the binary package can be successfully generated, its supported instruction set only ARMV7, if valid architectures list does not package with ARMV7, the compilation fails.

Recommendation: Usually the debug mode setting value is set to Yes,release mode to No

Apple mobile device processor instruction set ARMV6, ARMV7, armv7s, and arm64

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.