mpy-cross: Add armv6m architecture option.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2022-05-23 17:59:33 +10:00
parent 17ac68770c
commit 0e28a1f0e5

View File

@ -108,7 +108,7 @@ STATIC int usage(char **argv) {
"\n"
"Target specific options:\n"
"-msmall-int-bits=number : set the maximum bits used to encode a small-int\n"
"-march=<arch> : set architecture for native emitter; x86, x64, armv6, armv7m, armv7em, armv7emsp, armv7emdp, xtensa, xtensawin\n"
"-march=<arch> : set architecture for native emitter; x86, x64, armv6, armv6m, armv7m, armv7em, armv7emsp, armv7emdp, xtensa, xtensawin\n"
"\n"
"Implementation specific options:\n", argv[0]
);
@ -270,6 +270,9 @@ MP_NOINLINE int main_(int argc, char **argv) {
} else if (strcmp(arch, "armv6") == 0) {
mp_dynamic_compiler.native_arch = MP_NATIVE_ARCH_ARMV6;
mp_dynamic_compiler.nlr_buf_num_regs = MICROPY_NLR_NUM_REGS_ARM_THUMB_FP;
} else if (strcmp(arch, "armv6m") == 0) {
mp_dynamic_compiler.native_arch = MP_NATIVE_ARCH_ARMV6M;
mp_dynamic_compiler.nlr_buf_num_regs = MICROPY_NLR_NUM_REGS_ARM_THUMB_FP; // need to be conservative so this code can run on armv7emdp
} else if (strcmp(arch, "armv7m") == 0) {
mp_dynamic_compiler.native_arch = MP_NATIVE_ARCH_ARMV7M;
mp_dynamic_compiler.nlr_buf_num_regs = MICROPY_NLR_NUM_REGS_ARM_THUMB_FP;