I'm trying to make my iOS app smaller (the code section of the binary is 70 MB) by using thumb instructions. There seems to be a good amount of discussion around using the thumb version of armv7, e.g. here: http://wanderingcoder.net/2010/07/19/ought-arm/ . However, I can't find very much about arm64 + Thumb. Is it even possible? If so, how can I have clang compile that way?
Asked
Active
Viewed 4,461 times
1 Answers
13
From the ARMv8 Reference Manual, §A1.3.2 (p. A1-35):
AArch64 state supports only a single instruction set, called A64. This is a fixed-length instruction set that uses 32-bit instruction encodings.
So no, 64-bit Thumb is not a thing.

Siguza
- 21,155
- 6
- 52
- 89
-
Worth noting you can compile a binary with T32 instructions that runs in AArch32 state on ARMv8 cores – chrisvarnz Apr 06 '20 at 18:04
-
@chrisvarnz in turn worth noting that not all ARMv8 cores support AArch32. – Siguza Apr 06 '20 at 19:19
-
Absolutely, I think Android doesn't support it either! – chrisvarnz Apr 07 '20 at 07:57
-
@Siguza do some cores really not support AArch32? Your quote relates to the AArch64 execution state, but the manual states clearly that AArch32 is a valid execution state, and that the processor can switch to a different execution state. – Benni Jun 11 '20 at 22:56
-
4@Benni The `ID_AA64PFR0_EL1` feature register specifies whether AArch32 is supported in each of EL3, EL2, EL1 and EL0. AArch64 is implied/required, but AArch32 is not. And as an example, if you (manage to) examine that register on an Apple A11 CPU or later, you will find that indeed AArch32 is not supported at any exception level. – Siguza Jun 12 '20 at 04:19