| Age | Commit message (Collapse) | Author | |
|---|---|---|---|
| 2020-02-28 | all: Reformat C and Python source code with tools/codeformat.py. | Damien George | |
| This is run with uncrustify 0.70.1, and black 19.10b0. | |||
| 2019-10-05 | py: Add new Xtensa-Windowed arch for native emitter. | Damien George | |
| Enabled via the configuration MICROPY_EMIT_XTENSAWIN. | |||
| 2019-10-05 | py/asmxtensa: Add support for Xtensa with windowed registers. | Damien George | |
| Window-specific asm emit functions are added, along with a new macro option GENERIC_ASM_API_WIN. | |||
| 2019-03-08 | py: Add support to save native, viper and asm code to .mpy files. | Damien George | |
| This commit adds support for saving and loading .mpy files that contain native code (native, viper and inline-asm). A lot of the ground work was already done for this in the form of removing pointers from generated native code. The changes here are mainly to link in qstr values to the native code, and change the format of .mpy files to contain native code blocks (possibly mixed with bytecode). A top-level summary: - @micropython.native, @micropython.viper and @micropython.asm_thumb/ asm_xtensa are now allowed in .py files when compiling to .mpy, and they work transparently to the user. - Entire .py files can be compiled to native via mpy-cross -X emit=native and for the most part the generated .mpy files should work the same as their bytecode version. - The .mpy file format is changed to 1) specify in the header if the file contains native code and if so the architecture (eg x86, ARMV7M, Xtensa); 2) for each function block the kind of code is specified (bytecode, native, viper, asm). - When native code is loaded from a .mpy file the native code must be modified (in place) to link qstr values in, just like bytecode (see py/persistentcode.c:arch_link_qstr() function). In addition, this now defines a public, native ABI for dynamically loadable native code generated by other languages, like C. | |||
| 2018-10-13 | py/emitnative: Load native fun table ptr from const table for all archs. | Damien George | |
| All architectures now have a dedicated register to hold the pointer to the native function table mp_fun_table, and so they all need to load this register at the start of the native function. This commit makes the loading of this register uniform across architectures by passing the pointer in the constant table for the native function, and then loading the register from the constant table. Doing it this way means that the pointer is not stored in the assembly code, helping to make the code more portable. | |||
| 2018-10-01 | py/asmxtensa: Use proper calculation for const table offset. | Damien George | |
| Instead of hard-coding it to 4 bytes. This allows for there to be other data stored at the very start of the emitted native code. | |||
| 2018-09-16 | py/asmxtensa: Make indirect calls using func table, not raw pointers. | Damien George | |
| Loading a pointer by indexing into the native function table mp_fun_table, rather than loading an immediate value (via a PC-relative load), uses less code space. | |||
| 2018-08-17 | py/asmxtensa: Use narrow version of add instr to reduce native code size | Damien George | |
| 2018-08-17 | py/asmxtensa: Optimise loading local addr and support larger offsets. | Damien George | |
| 2018-08-16 | py/asm*: Support assembling code to jump to a register, and get PC+off. | Damien George | |
| Useful for position independent code, and implementing state machines. | |||
| 2018-08-16 | py/asmxtensa: Handle function entry/exit when stack use larger than 127. | Damien George | |
| 2016-12-09 | py/asm: Remove need for dummy_data when doing initial assembler passes. | Damien George | |
| For all but the last pass the assembler only needs to count how much space is needed for the machine code, it doesn't actually need to emit anything. The dummy_data just uses unnecessary RAM and without it the code is not any more complex (and code size does not increase for Thumb and Xtensa archs). | |||
| 2016-12-09 | py: Add inline Xtensa assembler. | Damien George | |
| This patch adds the MICROPY_EMIT_INLINE_XTENSA option, which, when enabled, allows the @micropython.asm_xtensa decorator to be used. The following opcodes are currently supported (ax is a register, a0-a15): ret_n() callx0(ax) j(label) jx(ax) beqz(ax, label) bnez(ax, label) mov(ax, ay) movi(ax, imm) # imm can be full 32-bit, uses l32r if needed and_(ax, ay, az) or_(ax, ay, az) xor(ax, ay, az) add(ax, ay, az) sub(ax, ay, az) mull(ax, ay, az) l8ui(ax, ay, imm) l16ui(ax, ay, imm) l32i(ax, ay, imm) s8i(ax, ay, imm) s16i(ax, ay, imm) s32i(ax, ay, imm) l16si(ax, ay, imm) addi(ax, ay, imm) ball(ax, ay, label) bany(ax, ay, label) bbc(ax, ay, label) bbs(ax, ay, label) beq(ax, ay, label) bge(ax, ay, label) bgeu(ax, ay, label) blt(ax, ay, label) bnall(ax, ay, label) bne(ax, ay, label) bnone(ax, ay, label) Upon entry to the assembly function the registers a0, a12, a13, a14 are pushed to the stack and the stack pointer (a1) decreased by 16. Upon exit, these registers and the stack pointer are restored, and ret.n is executed to return to the caller (caller address is in a0). Note that the ABI for the Xtensa emitters is non-windowing. | |||
| 2016-12-09 | py/asmxtensa: Add low-level Xtensa assembler. | Damien George | |
