ARM claims that Thumb-2 instructions (for ARM Cortex cores and all ARMv7 processors) provides performance improvements and code size optimization: Thumb-2 technology is the instruction set underlying the ARM Cortex architecture which provides enhanced levels of performance, energy efficiency, and code density for a wide range of embedded applications. For performance optimized code Thumb-2 technology uses 31 percent less memory to reduce system cost, while providing up to 38 percent higher performance than existing high density code, which can be used to prolong battery-life or to enrich the product feature set. Thumb-2 technology is featured in the processor, and in all ARMv7 architecture-based processors. Dave Martin (Linaro) has recently posted a message entitled “ARM/Thumb-2 kernel size comparison” on Linaro mailing list:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
The question of the size impact of building the kernel in Thumb-2 came up to day, so I extracted some quick numbers: $ size vmlinux-* text data bss dec hex filename 8420507 463356 826928 9710791 942cc7 vmlinux-arm 6715539 463260 826928 8005727 7a285f vmlinux-thumb2 This is for a recent mainline kernel built with the linaro omap config. In this case we save about 20% for code and read-only data (i.e., text) and 17.5% overall -- which accounts for a little under 2MB saved in this example. This doesn't take loadable modules into account; we can probably expect to see a similar size ratio there. |
The results provided by Linaro at not as high as those claimed by ARM, but a 20% code size reduction is still impressive. If you want to use Thumb2 to compile […]