值得注意的是: 也有在64位处理器上使用ILP32数据模型,该数据模型减小了代码大小,并减小了包含指针的数据结构的大小,所以造成的结果就是地址空间会小很多(这里应该是指操作系统给应用进程分配的虚拟内存空间)。对于某些嵌入式系统来说,ILP32 是一个不错的选择。已在Apple Watch Series 4 / 5中使用。
data models
Data model
short
int
long
long long
pointer
LLP64
16
32
32
64
64
LP64
16
32
64
64
64
ILP64
16
64
64
64
64
SILP64
64
64
64
64
64
ILP32
16
32
32
64
32
__ARM_ARCH_7K__
isWatchABI
1 2 3 4
// Unfortunately, __ARM_ARCH_7K__ is now more of an ABI descriptor. The CPU // happens to be Cortex-A7 though, so it should still get __ARM_ARCH_7A__. if (getTriple().isWatchABI()) Builder.defineMacro("__ARM_ARCH_7K__", "2");
SUPPORT_PACKED_ISA
在iOS中采用__LP64__数据模型;
即:# define SUPPORT_PACKED_ISA 1
1 2 3 4 5 6 7 8
// Define SUPPORT_PACKED_ISA=1 on platforms that store the class in the isa // field as a maskable pointer with other data around it. #if (!__LP64__ || TARGET_OS_WIN32 || \ (TARGET_OS_SIMULATOR && !TARGET_OS_IOSMAC)) # define SUPPORT_PACKED_ISA 0 #else # define SUPPORT_PACKED_ISA 1 #endif
// Define SUPPORT_INDEXED_ISA=1 on platforms that store the class in the isa // field as an index into a class table. // Note, keep this in sync with any .s files which also define it. // Be sure to edit objc-abi.h as well. #if __ARM_ARCH_7K__ >= 2 || (__arm64__ && !__LP64__) # define SUPPORT_INDEXED_ISA 1 #else # define SUPPORT_INDEXED_ISA 0 #endif
SUPPORT_NONPOINTER_ISA
与isa指针类型有关系
SUPPORT_NONPOINTER_ISA=1: 非单纯指针类型的isa
iOS中 SUPPORT_INDEXED_ISA 0,SUPPORT_PACKED_ISA 1
# define SUPPORT_NONPOINTER_ISA 1
1 2 3 4 5 6 7
// Define SUPPORT_NONPOINTER_ISA=1 on any platform that may store something // in the isa field that is not a raw pointer. #if !SUPPORT_INDEXED_ISA && !SUPPORT_PACKED_ISA # define SUPPORT_NONPOINTER_ISA 0 #else # define SUPPORT_NONPOINTER_ISA 1 #endif