summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
Diffstat (limited to 'py')
-rw-r--r--py/asmbase.c4
-rw-r--r--py/emitglue.c2
-rw-r--r--py/emitglue.h4
-rw-r--r--py/mpconfig.h3
-rw-r--r--py/nativeglue.c2
5 files changed, 9 insertions, 6 deletions
diff --git a/py/asmbase.c b/py/asmbase.c
index 4c84c3b255..ab861da152 100644
--- a/py/asmbase.c
+++ b/py/asmbase.c
@@ -31,7 +31,7 @@
#include "py/misc.h"
#include "py/asmbase.h"
-#if MICROPY_EMIT_NATIVE || MICROPY_EMIT_INLINE_ASM
+#if MICROPY_EMIT_MACHINE_CODE
void mp_asm_base_init(mp_asm_base_t *as, size_t max_num_labels) {
as->max_num_labels = max_num_labels;
@@ -99,4 +99,4 @@ void mp_asm_base_data(mp_asm_base_t* as, unsigned int bytesize, uintptr_t val) {
}
}
-#endif // MICROPY_EMIT_NATIVE || MICROPY_EMIT_INLINE_ASM
+#endif // MICROPY_EMIT_MACHINE_CODE
diff --git a/py/emitglue.c b/py/emitglue.c
index c073258f01..483a47025b 100644
--- a/py/emitglue.c
+++ b/py/emitglue.c
@@ -88,7 +88,7 @@ void mp_emit_glue_assign_bytecode(mp_raw_code_t *rc, const byte *code,
#endif
}
-#if MICROPY_EMIT_NATIVE || MICROPY_EMIT_INLINE_ASM
+#if MICROPY_EMIT_MACHINE_CODE
void mp_emit_glue_assign_native(mp_raw_code_t *rc, mp_raw_code_kind_t kind, void *fun_data, mp_uint_t fun_len, const mp_uint_t *const_table,
#if MICROPY_PERSISTENT_CODE_SAVE
uint16_t prelude_offset,
diff --git a/py/emitglue.h b/py/emitglue.h
index 058f060186..b67d49ed6d 100644
--- a/py/emitglue.h
+++ b/py/emitglue.h
@@ -63,13 +63,13 @@ typedef struct _mp_raw_code_t {
size_t fun_data_len;
uint16_t n_obj;
uint16_t n_raw_code;
- #if MICROPY_EMIT_NATIVE || MICROPY_EMIT_INLINE_ASM
+ #if MICROPY_EMIT_MACHINE_CODE
uint16_t prelude_offset;
uint16_t n_qstr;
mp_qstr_link_entry_t *qstr_link;
#endif
#endif
- #if MICROPY_EMIT_NATIVE || MICROPY_EMIT_INLINE_ASM
+ #if MICROPY_EMIT_MACHINE_CODE
mp_uint_t type_sig; // for viper, compressed as 2-bit types; ret is MSB, then arg0, arg1, etc
#endif
} mp_raw_code_t;
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 4172e175b2..a111b27aec 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -329,6 +329,9 @@
// Convenience definition for whether any inline assembler emitter is enabled
#define MICROPY_EMIT_INLINE_ASM (MICROPY_EMIT_INLINE_THUMB || MICROPY_EMIT_INLINE_XTENSA)
+// Convenience definition for whether any native or inline assembler emitter is enabled
+#define MICROPY_EMIT_MACHINE_CODE (MICROPY_EMIT_NATIVE || MICROPY_EMIT_INLINE_ASM)
+
/*****************************************************************************/
/* Compiler configuration */
diff --git a/py/nativeglue.c b/py/nativeglue.c
index 11d7a283a2..979265a870 100644
--- a/py/nativeglue.c
+++ b/py/nativeglue.c
@@ -77,7 +77,7 @@ mp_uint_t mp_native_from_obj(mp_obj_t obj, mp_uint_t type) {
#endif
-#if MICROPY_EMIT_NATIVE || MICROPY_EMIT_INLINE_ASM
+#if MICROPY_EMIT_MACHINE_CODE
// convert a native value to a MicroPython object based on type
mp_obj_t mp_native_to_obj(mp_uint_t val, mp_uint_t type) {