summaryrefslogtreecommitdiff
path: root/tools/mpy-tool.py
diff options
context:
space:
mode:
authorAlessandro Gatti <a.gatti@frob.it>2024-06-16 20:40:28 +0200
committerDamien George <damien@micropython.org>2024-06-21 15:06:29 +1000
commit99f5659cf5fa84d3b9dc8bbd286315fcf56ad899 (patch)
treefc55cd22a9d5c266d20879f189c87119a0040bf2 /tools/mpy-tool.py
parent8338f663523d675847b8c0b9b92977b76995de8f (diff)
mpy-cross: Add RISC-V RV32IMC support in MPY files.
MPY files can now hold generated RV32IMC native code. This can be accomplished by passing the `-march=rv32imc` flag to mpy-cross. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
Diffstat (limited to 'tools/mpy-tool.py')
-rwxr-xr-xtools/mpy-tool.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/mpy-tool.py b/tools/mpy-tool.py
index 86c4ba757..3b06572c3 100755
--- a/tools/mpy-tool.py
+++ b/tools/mpy-tool.py
@@ -113,6 +113,7 @@ MP_NATIVE_ARCH_ARMV7EMSP = 7
MP_NATIVE_ARCH_ARMV7EMDP = 8
MP_NATIVE_ARCH_XTENSA = 9
MP_NATIVE_ARCH_XTENSAWIN = 10
+MP_NATIVE_ARCH_RV32IMC = 11
MP_PERSISTENT_OBJ_FUN_TABLE = 0
MP_PERSISTENT_OBJ_NONE = 1
@@ -1094,8 +1095,10 @@ class RawCodeNative(RawCode):
):
# ARMV6 or Xtensa -- four byte align.
self.fun_data_attributes += " __attribute__ ((aligned (4)))"
- elif MP_NATIVE_ARCH_ARMV6M <= config.native_arch <= MP_NATIVE_ARCH_ARMV7EMDP:
- # ARMVxxM -- two byte align.
+ elif (
+ MP_NATIVE_ARCH_ARMV6M <= config.native_arch <= MP_NATIVE_ARCH_ARMV7EMDP
+ ) or config.native_arch == MP_NATIVE_ARCH_RV32IMC:
+ # ARMVxxM or RV32IMC -- two byte align.
self.fun_data_attributes += " __attribute__ ((aligned (2)))"
def disassemble(self):