Determine if an ARM64 device is

I'm trying to make a setup for iOS 7, so when the device is ARM64, it launches one version, and when it does not start the other (since float is for 32 bits and double for 64 (if you have a solution for this, let me know. )

So it will be like

if ARM64 {
    \\run double code
}
else {
    \\run float code
}
+3
source share
3 answers

Would you do the following

#if __LP64__
    \\You're running on 64 bit
#else
    \\You're running on 32 bit
#endif
+9
source

In an arm64 environment, a pointer occupies 8 bytes.

- (BOOL)isArm64
{
    static BOOL arm64 = NO ;
    static dispatch_once_t once ;
    dispatch_once(&once, ^{
        arm64 = sizeof(int *) == 8 ;
    });
    return arm64 ;
}
+1
source

arm_neon.h, , __arm64. Xcode 6.1.

In addition to this, some ARM NEONs available on older ARM (32-bit) architectures are not available on ARM64 or are replaced by equivalents that have a slightly different name.

In particular, it vtbl2is replaced by vtbl1q, because the main architecture emphasizes 128-bit NEON registers more.

If you have an ARM NEON assembly code that does not compile under ARM64, try to find changes like this.

0
source

All Articles