【整理】crosstool-ng中的Architecture level,Emit assembly for CPU,Tune for CPU对于TQ2440的S3C2440的ARM920T填写何值

【背景】

折腾:

【记录】Cygwin下为arm920t配置crosstool-ng

期间,需要对于TQ2440的S3C2440的ARM920T,搞清楚Architecture level,Emit assembly for CPU,Tune for CPU分别填写何值。

【折腾过程】

1.参考之前的:

【整理】crosstool中的Architecture level(CT_ARCH_ARCH),Emit assembly for CPU(CT_ARCH_CPU),Tune for CPU(CT_ARCH_TUNE)的值,对于arm的xscale应该是填写什么

去搞清楚,到底参数该怎么写。

2.参考:

3.17.3 ARM Options

用crosstool-ng建立Linux交叉编译环境(以S3C2440(armv4t)为例)

http://infocenter.arm.com/help/topic/com.arm.doc.ddi0151c/ARM920T_TRM1_S.pdf

中的“The ARM920T processor incorporates the ARM9TDMI integer core, which implements the ARM architecture v4T. ”

http://www.bdtic.com/ARM/ARM920T.html

qt4.7.2移植到arm-linux s3c2440全程指导

http://stuff.mit.edu/afs/athena/system/i386_deb50/os-ubuntu-9.04/usr/src/linux-headers-2.6.28-16/arch/arm/Makefile

可知:

此处的S3C2440是ARM920T,用的是ARM9TDMI的核心,对应着arm的armv4架构

针对S3C2440,对应的参数分别是:

(1)Architecture level=CT_ARCH_ARCH=-march=armv4t

(2)Emit assembly for CPU=CT_ARCH_CPU=-mcpu=arm9tdmi

(3)Tune for CPU=CT_ARCH_TUNE=-mtune=arm920t

3.其中,开始还以为是:

-mcpu=arm920t

-mtune=arm9tdmi

呢。

后来才明白:

mcpu,值得是内核用的是什么,此处内核是arm9tdmi,而不是arm920t

即,arm9tdmi的内核,对应着有多种CPU

(参考:http://stuff.mit.edu/afs/athena/system/i386_deb50/os-ubuntu-9.04/usr/src/linux-headers-2.6.28-16/arch/arm/Makefile

比如ARM920T,ARM922T,ARM925T,ARM926T,ARM940T,ARM946E等等。

所以,此处应该是:

-mcpu=所用内核=arm9tdmi=对应产生的汇编代码是哪个内核的(GCC uses this name to determine what kind of instructions it can emit when generating assembly code)

-mtune=具体是哪一款的cpu==arm920t=gcc会(针对产生的硬件的指令)为了该款cpu进行微调(tune)(specifying the actual target processor type, and hence restricting which instructions can be used, it specifies that GCC should tune the performance of the code as if the target were of the type specified in this option, but still choosing the instructions it generates based on the CPU specified by a -mcpu= option. For some ARM implementations better performance can be obtained by using this option. )

【总结】

所以,至此渐渐更加清楚了,针对于TQ2440开发板所用的S3C2440:

-march=对应的架构是什么=此处是arm下面的v4t,即armv4t

-mcpu=具体用的什么cpu核心=此处是arm9tdmi的内核

-mtune=具体是哪一款cpu=此处是arm920t    


此刻,又想到,之前给xscale配置这些参数的时候:

【整理】crosstool中的Architecture level(CT_ARCH_ARCH),Emit assembly for CPU(CT_ARCH_CPU),Tune for CPU(CT_ARCH_TUNE)的值,对于arm的xscale应该是填写什么

实际上,针对xscale,mtune应该是参考:

http://stuff.mit.edu/afs/athena/system/i386_deb50/os-ubuntu-9.04/usr/src/linux-headers-2.6.28-16/arch/arm/Makefile

中的strongarm110,即整体配置是:

对于xscale应该是:

(1)Architecture level=CT_ARCH_ARCH=-march=armv5te

(2)Emit assembly for CPU=CT_ARCH_CPU=-mcpu=xscale

(3)Tune for CPU=CT_ARCH_TUNE=-mtune=strongarm110



One Thought on “【整理】crosstool-ng中的Architecture level,Emit assembly for CPU,Tune for CPU对于TQ2440的S3C2440的ARM920T填写何值

  1. Pingback: 基于FL2440的QT5.6.0移植记录 - 移动开发 - 阿里欧歌

发表评论

电子邮件地址不会被公开。 必填项已用*标注

无觅相关文章插件,快速提升流量