IOS编译选项GCC_THUMB_SUPPORT

转自:http://stackoverflow.com/questions/5524906/gcc-thumb-support-can-it-be-turned-off-for-just-one-module

 

Be aware, however, that turning off building for Thumb is only recommended for the non-ARMv7 devices.  Building using the Thumb2 instruction set in the ARMv7 devices (the iPhone 3G S and newer) is recommended in almost all cases.  The Thumb instruction set can lead to a smaller binary, and it only slows down floating-point-heavy calculations on the older ARMv6 devices, not the overwhelming majority of hardware out there right now.

 

 

转自:http://stackoverflow.com/questions/1460378/iphone-compile-for-thumb

 

The standard instruction set for ARM is 4-bytes.  Using "Compile for Thumb", the compiler is able to use 2-byte instructions.  This results in a much smaller library, but also a slower one (somewhat debatable).  More critically, there are issues with running under ARMv6.  In our case, we could not generate stable output from Monotouch (fix in MT4.0 alpha).  In Xcode, you can find the setting by clicking on your Target, and looking under Build and searching for "thumb".  Mine is under GCC 4.2 - Code Generation, but sometimes it is under LVVM GCC 4.2.

 

 

转自:http://blog.163.com/liuyunqian@yeah/blog/static/703958432010026115419484/

 

The Thumb-2 Instruction Set Architecture (ISA) 

The Thumb-23 ISA is a highly efficient and powerful instruction set that delivers significant
benefits in terms of ease of use, code size, and performance. The Thumb-2 instruction set is
a superset of the previous 16-bit Thumb instruction set, with additional 16-bit instructions
alongside 32-bit instructions. It allows more complex operations to be carried out in the
Thumb state, thus allowing higher efficiency by reducing the number of states switching
between ARM state and Thumb state.

Focused on small memory system devices such as microcontrollers and reducing the size of
the processor, the Cortex-M3 supports only the Thumb-2 (and traditional Thumb) instruction
set. Instead of using ARM instructions for some operations, as in traditional ARM processors,
it uses the Thumb-2 instruction set for all operations. As a result, the Cortex-M3 processor is
not backward compatible with traditional ARM processors. That is, you cannot run a binary
image for ARM7 processors on the Cortex-M3 processor. Nevertheless, the Cortex-M3
processor can execute almost all the 16-bit Thumb instructions, including all 16-bit Thumb
instructions supported on ARM7 family processors, making application porting easy.

With support for both 16-bit and 32-bit instructions in the Thumb-2 instructions set, there is
no need to switch the processor between Thumb state (16-bit instructions) and ARM state
(32-bit instructions). For example, in ARM7 or ARM9 family processors, you might need
to switch to ARM state if you want to carry out complex calculations or a large number of
conditional operations and good performance is needed; whereas in the Cortex-M3 processor,
you can mix 32-bit instructions with 16-bit instructions without switching state, getting high
code density and high performance with no extra complexity.

The Thumb-2 instruction set is a very important feature of the ARMv7 architecture. Compared
with the instructions supported on ARM7 family processors (ARMv4T architecture), the
Cortex-M3 processor instruction set has a large number of new features. For the fi rst time,
hardware divide instruction is available on an ARM processor, and a number of multiply
instructions are also available on the Cortex-M3 processor to improve data-crunching
performance. The Cortex-M3 processor also supports unaligned data accesses, a feature
previously available only in high-end processors.

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值