Damien George
25d904105c
py: Adjust regs for x86 so that 1 more local can live in a reg.
2014-09-06 23:24:32 +00:00
Damien George
03281b3850
py: Allow x86 native functions to take arguments.
...
Fix some bugs with x86 stack and saving registers correctly.
2014-09-06 22:38:50 +00:00
Damien George
c90f59ec3a
py: Add support for emitting native x86 machine code.
2014-09-06 23:06:36 +01:00
Damien George
33b50a0217
Merge branch 'master' of github.com:micropython/micropython
2014-09-06 18:39:39 +01:00
Damien George
e6ce10a3e7
py: Native emitter now supports delete name & global, and end finally.
2014-09-06 18:38:20 +01:00
Paul Sokolovsky
78fde4819c
modstruct: Implement 'O', 'P', 's' types for packed structs.
...
This is required to deal with, well, packed C structs containing pointers.
2014-09-06 20:22:06 +03:00
Paul Sokolovsky
722e562736
py: Correctly set sys.maxsize value for 64-bit.
...
Type representing signed size doesn't have to be int, so use special value
which defaults to SSIZE_MAX, but as it's not defined by C standard (but rather
by POSIX), allow ports to set it.
2014-09-06 20:22:06 +03:00
Damien George
8002d5d2b9
py: Fix definition of sys.maxsize with mpz changes.
2014-09-06 17:37:29 +01:00
Damien George
9a21d2e070
py: Make mpz able to use 16 bits per digit; and 32 on 64-bit arch.
...
Previously, mpz was restricted to using at most 15 bits in each digit,
where a digit was a uint16_t.
With this patch, mpz can use all 16 bits in the uint16_t (improvement
to mpn_div was required). This gives small inprovements in speed and
RAM usage. It also yields savings in ROM code size because all of the
digit masking operations become no-ops.
Also, mpz can now use a uint32_t as the digit type, and hence use 32
bits per digit. This will give decent improvements in mpz speed on
64-bit machines.
Test for big integer division added.
2014-09-06 17:15:34 +01:00
Damien George
afb1cf75dd
py: Convert (u)int to mp_(u)int_t in mpz, and remove unused function.
2014-09-05 20:37:06 +01:00
Damien George
e191d42188
py: Use % str formatting instead of {} in makeqstrdata.py.
...
Script is equivalent, but now also runs under ancient Python 2.6.
Goes part way to addressing issue #847 .
2014-09-05 13:16:19 +01:00
Damien George
b534e1b9f1
py: Use variable length encoded uints in more places in bytecode.
...
Code-info size, block name, source name, n_state and n_exc_stack now use
variable length encoded uints. This saves 7-9 bytes per bytecode
function for most functions.
2014-09-04 14:44:01 +01:00
Damien George
dda46460ff
Code style/whitespace cleanup; remove obsolete headers.
...
And move the MAP_ANON redefinition from py/asmx64.c to unix/alloc.c.
2014-09-03 22:47:23 +01:00
Fabian Vogt
b7235b8412
Add cache flush in py/asmarm.c and add new MP_PLAT_ALLOC_EXEC and MP_PLAT_FREE_EXEC macros
...
Fixes issue #840
2014-09-03 23:07:42 +02:00
Damien George
ca6d75f16d
py: Small simplifications in tuple and list accessors.
2014-08-30 15:17:47 +01:00
Damien George
4abff7500f
py: Change uint to mp_uint_t in runtime.h, stackctrl.h, binary.h.
...
Part of code cleanup, working towards resolving issue #50 .
2014-08-30 14:59:21 +01:00
Damien George
4d91723587
py: Remove use of int type in obj.h.
...
Part of code cleanup, working towards resolving issue #50 .
2014-08-30 14:28:06 +01:00
Damien George
d182b98a37
py: Change all uint to mp_uint_t in obj.h.
...
Part of code cleanup, working towards resolving issue #50 .
2014-08-30 14:19:41 +01:00
Damien George
9c4cbe2ac0
py: Make tuple and list use mp_int_t/mp_uint_t.
...
Part of code cleanup, to resolve issue #50 .
2014-08-30 14:04:14 +01:00
Damien George
93965e726f
py: Make map, dict, set use mp_int_t/mp_uint_t exclusively.
...
Part of code cleanup, towards resolving issue #50 .
2014-08-30 13:23:35 +01:00
Damien George
1c70cbf151
py: Save about 200 bytes of ROM by using smaller type for static table.
2014-08-30 00:38:16 +01:00
Damien George
ecc88e949c
Change some parts of the core API to use mp_uint_t instead of uint/int.
...
Addressing issue #50 , still some way to go yet.
2014-08-30 00:35:11 +01:00
Damien George
17ae2395c2
py: Use memmove instead of memcpy when appropriate.
...
Found this bug by running unix/ tests with DEBUG=1 enabled when
compiling.
2014-08-29 21:07:54 +01:00
Damien George
02d95d7ce9
py: Fix 2 bugs in native emitter: jump_or_pop and stack settling.
...
Addresses issue #838 .
2014-08-29 20:05:32 +01:00
Damien George
eb4e18f057
py: Add compiler optimisation for conditions in parenthesis.
...
Optimises:
if () -> if False
if (x,...) -> if True
if (a and b) -> if a and b
2014-08-29 20:04:01 +01:00