Damien George
3e02b1d19a
py/viper: Allow casting of Python integers to viper pointers.
...
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.
2016-02-09 13:29:20 +00:00
Damien George
2ec835f572
tests: Add more tests for viper 16/32-bit load/store, and ellipsis.
2015-10-13 18:24:36 +01:00
Damien George
b8f9ac5411
py: Implement ptr32 load and store in viper emitter.
2015-10-13 00:50:17 +01:00
Damien George
9f5f156b9d
py/emitnative: Raise ViperTypeError for unsupported unary ops.
2015-10-08 13:08:59 +01:00
Paul Sokolovsky
a3fe307400
tests: Consolidate all feature check snippets under feature_check/.
2015-08-30 11:36:42 +03:00
Damien George
e45c1dbd6f
py: Allow viper functions to take up to 4 arguments.
...
Addresses issue #1380 .
2015-07-23 14:11:29 +01:00
Damien George
6e56bb623c
py: Fallback to stack alloca for Python-stack if heap alloc fails.
...
If heap allocation for the Python-stack of a function fails then we may
as well allocate the Python-stack on the C stack. This will allow to
run more code without using the heap.
2015-06-08 22:07:27 +01:00
Damien George
567b349c2b
py: Implement native multiply operation in viper emitter.
2015-06-04 14:00:29 +00:00
Damien George
4d9cad180d
py: Implement implicit cast to obj for viper load/store index/value.
...
This allows to do "ar[i]" and "ar[i] = val" in viper when ar is a Python
object and i and/or val are native viper types (eg ints).
Patch also includes tests for this feature.
2015-06-04 11:52:16 +01:00
Damien George
40d43ea88d
tests: Add more tests for viper, including tests for ViperTypeError's.
2015-04-22 23:18:28 +01:00
Damien George
044c473de2
py: Add %q format support to mp_[v]printf, and use it.
2015-04-16 14:30:16 +00:00
Damien George
9dd3640464
tests: Add missing tests for builtins, and many other things.
2015-04-04 22:05:30 +01:00
Damien George
82f37bf0d1
tests: Add specific test for closures in native emitter.
2015-04-03 16:14:25 +01:00
Damien George
214179b430
tests: Add tests for SyntaxError, TypeError, and other missing things.
...
This is intended to improve coverage of the test suite.
2015-03-25 23:10:09 +00:00
Damien George
af43565322
tests: Add tests for things that are not already tested.
...
The aim here is to improve coverage of the code.
2015-03-12 22:48:45 +00:00
Damien George
47538cc880
tests: Add test for micropython const feature when it has a SyntaxError.
2015-03-01 12:06:24 +00:00
Damien George
ed8b4da0db
tests: Remove obsolete test; don't use fp in micropython/ tests.
2015-02-15 01:57:39 +00:00
Damien George
d1c3788375
py: Fix loading of immediate pointer in Thumb assembler.
...
Addresses issue #1117 .
2015-02-15 00:45:28 +00:00
Paul Sokolovsky
c0bc3bd736
asmarm: Fix bug with encoding small negative ints using MVN instruction.
2014-12-14 03:24:17 +02:00
Damien George
c7da7838ba
tests: Add heapalloc.py.exp, since CPython can't generate it.
2014-10-31 22:09:40 +00:00
Damien George
109c1de015
py: Make gc.enable/disable just control auto-GC; alloc is still allowed.
...
gc.enable/disable are now the same as CPython: they just control whether
automatic garbage collection is enabled or not. If disabled, you can
still allocate heap memory, and initiate a manual collection.
2014-10-31 21:30:46 +00:00
Damien George
e7a478204a
py: Remove unused and unneeded SystemError exception.
...
It's purpose is for internal errors that are not catastrophic (ie not as
bad as RuntimeError). Since we don't use it, we don't need it.
2014-10-22 19:42:55 +01:00
Damien George
21ca2d76a2
py: Partially fix viper multi-comparison; add test for it.
2014-10-19 19:00:51 +01:00
Damien George
91cfd414c0
py: Implement native load for viper.
...
Viper can now do: ptr8(buf)[0], which loads a byte from a buffer using
machine instructions.
2014-10-12 16:59:29 +01:00
Damien George
1ef2348df0
py: Implement and,or,xor native ops for viper.
2014-10-12 14:21:06 +01:00