摘自【整理】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.參考之前的:
去搞清楚,到底參數該怎麼寫。
2.參考:
用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全程指導
可知:
此處的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
比如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配置這些參數的時候:
實際上,針對xscale,mtune應該是參考:
中的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