py/persistentcode: Make ARM Thumb archs support multiple sub-archs.
This commit is contained in:
@@ -55,19 +55,34 @@
|
||||
|
||||
// Define the host architecture
|
||||
#if MICROPY_EMIT_X86
|
||||
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_X86)
|
||||
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_X86)
|
||||
#elif MICROPY_EMIT_X64
|
||||
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_X64)
|
||||
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_X64)
|
||||
#elif MICROPY_EMIT_THUMB
|
||||
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_ARMV7M)
|
||||
#if defined(__thumb2__)
|
||||
#if defined(__ARM_FP) && (__ARM_FP & 8) == 8
|
||||
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_ARMV7EMDP)
|
||||
#elif defined(__ARM_FP) && (__ARM_FP & 4) == 4
|
||||
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_ARMV7EMSP)
|
||||
#else
|
||||
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_ARMV7EM)
|
||||
#endif
|
||||
#else
|
||||
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_ARMV7M)
|
||||
#endif
|
||||
#define MPY_FEATURE_ARCH_TEST(x) (MP_NATIVE_ARCH_ARMV6M <= (x) && (x) <= MPY_FEATURE_ARCH)
|
||||
#elif MICROPY_EMIT_ARM
|
||||
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_ARMV6)
|
||||
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_ARMV6)
|
||||
#elif MICROPY_EMIT_XTENSA
|
||||
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_XTENSA)
|
||||
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_XTENSA)
|
||||
#elif MICROPY_EMIT_XTENSAWIN
|
||||
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_XTENSAWIN)
|
||||
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_XTENSAWIN)
|
||||
#else
|
||||
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_NONE)
|
||||
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_NONE)
|
||||
#endif
|
||||
|
||||
#ifndef MPY_FEATURE_ARCH_TEST
|
||||
#define MPY_FEATURE_ARCH_TEST(x) ((x) == MPY_FEATURE_ARCH)
|
||||
#endif
|
||||
|
||||
// 16-bit little-endian integer with the second and third bytes of supported .mpy files
|
||||
|
||||
Reference in New Issue
Block a user