博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ARMv8的两种执行状态: AArch64/AArch32
阅读量:2171 次
发布时间:2019-05-01

本文共 2085 字,大约阅读时间需要 6 分钟。

Copied from ARM® Compiler User Guide

When compiling code, you must first decide which target the executable is to run on. An ARMv8-A target can run in different states:
• AArch64 state targets execute A64 instructions using 64-bit wide general-purpose registers.
• AArch32 state targets execute A32 or T32 instructions using 32-bit wide general-purpose registers.
The –target option determines which target state to compile for. This option is a mandatory option.
To create an executable for an AArch64 target in a single step:
armclang –target=aarch64-arm-none-eabi hello.c
This command creates an executable, a.out.
The –target option selects the target that you want to compile for. This example compiles for an AArch64 state target. Because only –target is specified, the compiler defaults to generating code that runs on any ARMv8-A target. You can also use -mcpu to target a specific processor.
To create an executable for an AArch32 target in a single step:
armclang –target=arm-arm-none-eabi -mcpu=cortex-a53 hello.c
In this example, there is no default target for AArch32 state, so you must specify either -march to target an architecture or -mcpu to target a processor. This example uses -mcpu to target the Cortex®-A53 processor. The compiler generates code that is optimized specifically for the Cortex-A53, but might not run on other processors.
Use -mcpu=list or -march=list to see all available options.

• The –target option is an armclang option. For all of the other tools, such as armasm and armlink,

use the –cpu and –fpu options to specify target processors and architectures.

ARMv8-A有两种执行状态: AArch64和AArch32(后者是为了兼容以前的32bit的程序)。

AArch64执行A64指令,使用64bit的通用寄存器;
AArch32执行A32/T32指令,使用32bit的通用寄存器;
arm compiler使用 –target=aarch64-arm-none-eabi 来产生 AArch64的可执行程序。默认使用ARMv8-A target,也可使用 -mcpu 指定特定的ARMv8处理器。
使用 –target=arm-arm-none-eabi 来产生 AArch32的可执行程序。对AArch32而言,没有默认target(处理器),所以需要使用 -march 或者 -mcpu 来指定处理器:
–target=arm-arm-none-eabi -mcpu=cortex-a53

可使用 -mcpu=list 或者 -march=list 查看可选的架构和处理器选项。

–target是armclang用的参数,别的工具,例如armasm/armlink,使用 –cpu 和 -fpu 参数来指定处理器和架构。

转载地址:http://opqzb.baihongyu.com/

你可能感兴趣的文章
【LEETCODE】112-Path Sum
查看>>
【LEETCODE】9-Palindrome Number
查看>>
【极客学院】-python学习笔记-Python快速入门(面向对象-引入外部文件-Web2Py创建网站)
查看>>
【LEETCODE】190-Reverse Bits
查看>>
【LEETCODE】67-Add Binary
查看>>
【LEETCODE】7-Reverse Integer
查看>>
【LEETCODE】165-Compare Version Numbers
查看>>
【LEETCODE】299-Bulls and Cows
查看>>
【LEETCODE】223-Rectangle Area
查看>>
【LEETCODE】12-Integer to Roman
查看>>
【学习方法】如何分析源代码
查看>>
【LEETCODE】61- Rotate List [Python]
查看>>
【LEETCODE】143- Reorder List [Python]
查看>>
【LEETCODE】82- Remove Duplicates from Sorted List II [Python]
查看>>
【LEETCODE】86- Partition List [Python]
查看>>
【LEETCODE】147- Insertion Sort List [Python]
查看>>
【算法】- 动态规划的编织艺术
查看>>
用 TensorFlow 让你的机器人唱首原创给你听
查看>>
对比学习用 Keras 搭建 CNN RNN 等常用神经网络
查看>>
深度学习的主要应用举例
查看>>