<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/emitinlinethumb.c, branch master</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=master</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2018-10-06T23:09:44+00:00</updated>
<entry>
<title>fix compilation errors in emitinlinethumb.c</title>
<updated>2018-10-06T23:09:44+00:00</updated>
<author>
<name>Uri Shaked</name>
<email>uri@urishaked.com</email>
</author>
<published>2018-10-06T12:02:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=cea079a0222685e1fd3652f7677ef441b9484c59'/>
<id>urn:sha1:cea079a0222685e1fd3652f7677ef441b9484c59</id>
<content type='text'>
</content>
</entry>
<entry>
<title>all: Use the name MicroPython consistently in comments</title>
<updated>2017-07-31T08:35:40+00:00</updated>
<author>
<name>Alexander Steffen</name>
<email>devel.20.webmeister@spamgourmet.com</email>
</author>
<published>2017-06-30T07:22:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=55f33240f3d7051d4213629e92437a36f1fac50e'/>
<id>urn:sha1:55f33240f3d7051d4213629e92437a36f1fac50e</id>
<content type='text'>
There were several different spellings of MicroPython present in comments,
when there should be only one.
</content>
</entry>
<entry>
<title>py: Create str/bytes objects in the parser, not the compiler.</title>
<updated>2017-02-24T02:43:43+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-02-24T02:43:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=5255255fb9ea003db65935fe6cf2ac9d17410faa'/>
<id>urn:sha1:5255255fb9ea003db65935fe6cf2ac9d17410faa</id>
<content type='text'>
Previous to this patch any non-interned str/bytes objects would create a
special parse node that held a copy of the str/bytes data.  Then in the
compiler this data would be turned into a str/bytes object.  This actually
lead to 2 copies of the data, one in the parse node and one in the object.
The parse node's copy of the data would be freed at the end of the compile
stage but nevertheless it meant that the peak memory usage of the
parse/compile stage was higher than it needed to be (by an amount equal to
the number of bytes in all the non-interned str/bytes objects).

This patch changes the behaviour so that str/bytes objects are created
directly in the parser and the object stored in a const-object parse node
(which already exists for bignum, float and complex const objects).  This
reduces peak RAM usage of the parse/compile stage, simplifies the parser
and compiler, and reduces code size by about 170 bytes on Thumb2 archs,
and by about 300 bytes on Xtensa archs.
</content>
</entry>
<entry>
<title>py/grammar: Group no-compile grammar rules together to shrink tables.</title>
<updated>2017-02-16T08:45:06+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-02-14T23:58:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=71019ae4f5ba8819af27152198afc0274085c8a9'/>
<id>urn:sha1:71019ae4f5ba8819af27152198afc0274085c8a9</id>
<content type='text'>
Grammar rules have 2 variants: ones that are attached to a specific
compile function which is called to compile that grammar node, and ones
that don't have a compile function and are instead just inspected to see
what form they take.

In the compiler there is a table of all grammar rules, with each entry
having a pointer to the associated compile function.  Those rules with no
compile function have a null pointer.  There are 120 such rules, so that's
120 words of essentially wasted code space.

By grouping together the compile vs no-compile rules we can put all the
no-compile rules at the end of the list of rules, and then we don't need
to store the null pointers.  We just have a truncated table and it's
guaranteed that when indexing this table we only index the first half,
the half with populated pointers.

This patch implements such a grouping by having a specific macro for the
compile vs no-compile grammar rules (DEF_RULE vs DEF_RULE_NC).  It saves
around 460 bytes of code on 32-bit archs.
</content>
</entry>
<entry>
<title>py/emitinline: Move common code for end of final pass to compiler.</title>
<updated>2016-12-09T10:23:17+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-12-09T10:23:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=e920bab9768f71c7e22fcfc5af3e1c40f2db8eeb'/>
<id>urn:sha1:e920bab9768f71c7e22fcfc5af3e1c40f2db8eeb</id>
<content type='text'>
This patch moves some common code from the individual inline assemblers to
the compiler, the code that calls the emit-glue to assign the machine code
to the functions scope.
</content>
</entry>
<entry>
<title>py/emitinline: Move inline-asm align and data methods to compiler.</title>
<updated>2016-12-09T09:54:54+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-12-09T09:54:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=dd53b12193dca4800ab207170fcc883142dd0f22'/>
<id>urn:sha1:dd53b12193dca4800ab207170fcc883142dd0f22</id>
<content type='text'>
These are generic methods that don't depend on the architecture and so
can be handled directly by the compiler.
</content>
</entry>
<entry>
<title>py/emitinline: Embed entire asm struct instead of a pointer to it.</title>
<updated>2016-12-09T09:35:21+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-12-09T09:35:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a7fd786a1f8a0bd13ec97d9742f8705b90cd1c46'/>
<id>urn:sha1:a7fd786a1f8a0bd13ec97d9742f8705b90cd1c46</id>
<content type='text'>
This reduces fragmentation, and memory use by 1 word.  But more
importantly it means the emit_inline_asm_t struct now "derives" from
mp_asm_base.
</content>
</entry>
<entry>
<title>py: Factor out common code from assemblers into asmbase.[ch].</title>
<updated>2016-11-27T22:24:50+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-11-27T22:24:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=612599587bef71e1deca9a77a8e2e16e69b045de'/>
<id>urn:sha1:612599587bef71e1deca9a77a8e2e16e69b045de</id>
<content type='text'>
All assemblers should "derive" from mp_asm_base_t.
</content>
</entry>
<entry>
<title>py/emitinlinethumb: Use qstrs instead of char* for names of asm ops.</title>
<updated>2016-02-23T15:20:39+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-02-23T15:20:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=28adab36c795691a9064495a18d44ebc69c5db64'/>
<id>urn:sha1:28adab36c795691a9064495a18d44ebc69c5db64</id>
<content type='text'>
Reduces code size by 112 bytes on Thumb2 arch, and makes assembler faster
because comparison can be a simple equals instead of a string compare.

Not all ops have been converted, only those that were simple to convert
and reduced code size.
</content>
</entry>
<entry>
<title>py/inlineasm: Add ability to specify return type of asm_thumb funcs.</title>
<updated>2016-01-27T14:27:10+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-01-15T15:20:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=8f54c08691faa3dd859852d211230fd7d9791abd'/>
<id>urn:sha1:8f54c08691faa3dd859852d211230fd7d9791abd</id>
<content type='text'>
Supported return types are: object, bool, int, uint.

For example:

@micropython.asm_thumb
def foo(r0, r1) -&gt; uint:
    add(r0, r0, r1)
</content>
</entry>
</feed>
