summaryrefslogtreecommitdiffstatshomepage
path: root/py/nativeglue.c
Commit message (Collapse)AuthorAge
* py/viper: Allow casting of Python integers to viper pointers.Damien George2016-02-09
| | | | | | | | | This allows you to pass a number (being an address) to a viper function that expects a pointer, and also allows casting of integers to pointers within viper functions. This was actually the original behaviour, but it regressed due to native type identifiers being promoted to 4 bits in width.
* py: Extend native type-sig to use 4 bits, so uint is separate to ptr.Damien George2016-02-02
| | | | | | | Before this patch, the native types for uint and ptr/ptr8/ptr16/ptr32 all overlapped and it was possible to make a mistake in casting. Now, these types are all separate and any coding mistakes will be raised as runtime errors.
* py/inlineasm: Add ability to specify return type of asm_thumb funcs.Damien George2016-01-27
| | | | | | | | | | Supported return types are: object, bool, int, uint. For example: @micropython.asm_thumb def foo(r0, r1) -> uint: add(r0, r0, r1)
* py/viper: Truncate viper integer args so they can be up to 32-bit.Damien George2016-01-07
|
* py: Rename MP_BOOL() to mp_obj_new_bool() for consistency in naming.Paul Sokolovsky2015-10-11
|
* py: Remove mp_load_const_bytes and instead load precreated bytes object.Damien George2015-06-25
| | | | | | | | | | | | | | | | Previous to this patch each time a bytes object was referenced a new instance (with the same data) was created. With this patch a single bytes object is created in the compiler and is loaded directly at execute time as a true constant (similar to loading bignum and float objects). This saves on allocating RAM and means that bytes objects can now be used when the memory manager is locked (eg in interrupts). The MP_BC_LOAD_CONST_BYTES bytecode was removed as part of this. Generated bytecode is slightly larger due to storing a pointer to the bytes object instead of the qstr identifier. Code size is reduced by about 60 bytes on Thumb2 architectures.
* py: Remove mp_load_const_str and replace uses with inlined version.Damien George2015-06-25
|
* py: Implement full func arg passing for native emitter.Damien George2015-04-07
| | | | | | | | | | | This patch gets full function argument passing working with native emitter. Includes named args, keyword args, default args, var args and var keyword args. Fully Python compliant. It reuses the bytecode mp_setup_code_state function to do all the hard work. This function is slightly adjusted to accommodate native calls, and the native emitter is forced a bit to emit similar prelude and code-info as bytecode.
* py: Implement calling functions with *args in native emitter.Damien George2015-04-06
|
* py: Implement closures in native code generator.Damien George2015-04-03
| | | | Currently supports only x64 and Thumb2 archs.
* py: Parse big-int/float/imag constants directly in parser.Damien George2015-02-08
| | | | | | | | | Previous to this patch, a big-int, float or imag constant was interned (made into a qstr) and then parsed at runtime to create an object each time it was needed. This is wasteful in RAM and not efficient. Now, these constants are parsed straight away in the parser and turned into objects. This allows constants with large numbers of digits (so addresses issue #1103) and takes us a step closer to #722.
* py: Implement proper re-raising in native codegen's finally handler.Damien George2015-01-21
| | | | | This allows an exception to propagate correctly through a finally handler.
* py: Move to guarded includes, everywhere in py/ core.Damien George2015-01-01
| | | | Addresses issue #1022.
* py: Add casting to viper; add native mem stores to viper.Damien George2014-09-29
| | | | | | | | | | Viper can now do the following: def store(p:ptr8, c:int): p[0] = c This does a store of c to the memory pointed to by p using a machine instructions inline in the code.
* py: Native emitter now supports delete name & global, and end finally.Damien George2014-09-06
|
* py: Change uint to mp_uint_t in runtime.h, stackctrl.h, binary.h.Damien George2014-08-30
| | | | Part of code cleanup, working towards resolving issue #50.
* py: Move native glue code from runtime.c to new file nativeglue.c.v1.3.1Damien George2014-08-28
This way, the native glue code is only compiled if native code is enabled (which makes complete sense; thanks to Paul Sokolovsky for the idea). Should fix issue #834.