summaryrefslogtreecommitdiff
path: root/py/asmarm.c
AgeCommit message (Collapse)Author
2019-07-12py/asmarm: Use __builtin___clear_cache instead of __clear_cache.David Lechner
__clear_cache causes a compile error when using clang. Instead use __builtin___clear_cache which is available under both gcc and clang. Also replace tabs with spaces in this section of code (introduced by a previous commit).
2019-07-03py/asmarm: Use __clear_cache on Linux/GCC when creating new asm code.David Lechner
Comes from https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/caches-and-self-modifying-code This fixes a crash when running MicroPython using qemu-arm.
2019-03-08py: 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-13py/asmarm: Simplify asm_arm_bl_ind to only load via index, not literal.Damien George
The maximum index into mp_fun_table is currently less than 1024 and should stay that way to keep things efficient for all architectures, so there is no need to handle loading the pointer directly via a literal in this function.
2018-08-16py/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-02-24py/asm*.c: Remove unnecessary check for num_locals<0 in asm entry func.Damien George
All callers of the asm entry function guarantee that num_locals>=0, so no need to add an explicit check for it. Use an assertion instead. Also, the signature of asm_x86_entry is changed to match the other asm entry functions.
2017-07-31all: Use the name MicroPython consistently in commentsAlexander Steffen
There were several different spellings of MicroPython present in comments, when there should be only one.
2017-07-19all: Remove trailing spaces, per coding conventions.Damien George
2017-01-03py/asmarm: Fix assembler's PASS_EMIT constant name.Damien George
2016-12-09py/asm: Fix x86 and ARM assemblers due to recent code refactoring.Damien George
2016-12-09py/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-11-28py: Factor out common code from assemblers into asmbase.[ch].Damien George
All assemblers should "derive" from mp_asm_base_t.
2015-06-04py: Implement native multiply operation in viper emitter.Damien George
2015-05-08emitnative: Revamp ARM codegen compile after full-arg support refactors.Paul Sokolovsky
The code was apparently broken after 9988618e0e0f5c319e31b135d993e22efb593093 "py: Implement full func arg passing for native emitter.". This attempts to propagate those changes to ARM emitter.
2015-04-09py: Adjust some spaces in code style/format, purely for consistency.Damien George
2015-01-14py: Allocate memory for assembled code at start of PASS_EMIT.Damien George
Previously was allocating at end of PASS_COMPUTE, and this pass was being run twice, so memory was being allocated twice.
2015-01-01py: Move to guarded includes, everywhere in py/ core.Damien George
Addresses issue #1022.
2014-12-14asmarm: Fix bug with encoding small negative ints using MVN instruction.Paul Sokolovsky
2014-10-12py: Implement native load for viper.Damien George
Viper can now do: ptr8(buf)[0], which loads a byte from a buffer using machine instructions.
2014-10-12py: Implement and,or,xor native ops for viper.Damien George
2014-10-04Implement missing ARM emitter functions for viperFabian Vogt
2014-09-29py: Implement more binary ops for viper emitter.Damien George
This included a bit of restructuring of the assembler backends. Note that the ARM backend is missing a few functions and won't compile.
2014-09-29py: Make macro names in assemblers consistent, and tidy up a bit.Damien George
2014-09-15py: Make asm_arm_less_op take destination register as first arg.Damien George
This gets ARM native emitter working againg and addresses issue #858.
2014-09-03Code style/whitespace cleanup; remove obsolete headers.Damien George
And move the MAP_ANON redefinition from py/asmx64.c to unix/alloc.c.
2014-09-03Add cache flush in py/asmarm.c and add new MP_PLAT_ALLOC_EXEC and ↵Fabian Vogt
MP_PLAT_FREE_EXEC macros Fixes issue #840
2014-08-28Clarify copyright on asmarm filesFabian Vogt
2014-08-27Basic native ARM emitterFabian Vogt