【整理】crosstool-ng中的Architecture level,Emit assembly for CPU,Tune for CPU對於TQ2440的S3C2440的ARM920T填寫何值

摘自【整理】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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章