<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/compile.c, branch 0.9.0</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=0.9.0</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=0.9.0'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2016-12-19T06:42:25+00:00</updated>
<entry>
<title>py/compile: Add an extra pass for Xtensa inline assembler.</title>
<updated>2016-12-19T06:42:25+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-12-19T06:42:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=de9cd00b39fbd66279dda69bc642ac2f3c459fa1'/>
<id>urn:sha1:de9cd00b39fbd66279dda69bc642ac2f3c459fa1</id>
<content type='text'>
It needs an extra pass to compute the size of the constant table for the
l32r instructions.
</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: Add inline Xtensa assembler.</title>
<updated>2016-12-09T06:07:38+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-12-09T06:03:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=f76b1bfa9f59fcfa03837c6934ad51d2db3ff4a3'/>
<id>urn:sha1:f76b1bfa9f59fcfa03837c6934ad51d2db3ff4a3</id>
<content type='text'>
This patch adds the MICROPY_EMIT_INLINE_XTENSA option, which, when
enabled, allows the @micropython.asm_xtensa decorator to be used.

The following opcodes are currently supported (ax is a register, a0-a15):

    ret_n()
    callx0(ax)
    j(label)
    jx(ax)

    beqz(ax, label)
    bnez(ax, label)
    mov(ax, ay)
    movi(ax, imm) # imm can be full 32-bit, uses l32r if needed

    and_(ax, ay, az)
    or_(ax, ay, az)
    xor(ax, ay, az)
    add(ax, ay, az)
    sub(ax, ay, az)
    mull(ax, ay, az)

    l8ui(ax, ay, imm)
    l16ui(ax, ay, imm)
    l32i(ax, ay, imm)
    s8i(ax, ay, imm)
    s16i(ax, ay, imm)
    s32i(ax, ay, imm)
    l16si(ax, ay, imm)
    addi(ax, ay, imm)

    ball(ax, ay, label)
    bany(ax, ay, label)
    bbc(ax, ay, label)
    bbs(ax, ay, label)
    beq(ax, ay, label)
    bge(ax, ay, label)
    bgeu(ax, ay, label)
    blt(ax, ay, label)
    bnall(ax, ay, label)
    bne(ax, ay, label)
    bnone(ax, ay, label)

Upon entry to the assembly function the registers a0, a12, a13, a14 are
pushed to the stack and the stack pointer (a1) decreased by 16.  Upon
exit, these registers and the stack pointer are restored, and ret.n is
executed to return to the caller (caller address is in a0).

Note that the ABI for the Xtensa emitters is non-windowing.
</content>
</entry>
<entry>
<title>py: Allow inline-assembler emitter to be generic.</title>
<updated>2016-12-09T06:06:21+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-12-09T02:17:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ad297a1950c74c35c90dd655ae9a69d33ed28dc0'/>
<id>urn:sha1:ad297a1950c74c35c90dd655ae9a69d33ed28dc0</id>
<content type='text'>
This patch refactors some code so that it is easier to integrate new
inline assemblers for different architectures other than ARM Thumb.
</content>
</entry>
<entry>
<title>py: Integrate Xtensa assembler into native emitter.</title>
<updated>2016-12-09T05:51:49+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-12-09T05:39:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=8e5aced1fd4845b23b203d8d15f9b34b6b022ceb'/>
<id>urn:sha1:8e5aced1fd4845b23b203d8d15f9b34b6b022ceb</id>
<content type='text'>
The config option MICROPY_EMIT_XTENSA can now be enabled to target the
Xtensa architecture with @micropython.native and @micropython.viper
decorators.
</content>
</entry>
<entry>
<title>py/compile: Simplify configuration of native emitter.</title>
<updated>2016-12-07T00:17:17+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-12-07T00:17:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=080a78b15edc465010864002d1c83a5730a85dd0'/>
<id>urn:sha1:080a78b15edc465010864002d1c83a5730a85dd0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/compile: Remove comment about TODO for short circuiting for if-stmt.</title>
<updated>2016-11-26T05:15:55+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-11-26T05:15:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=e6cf5fb2cc43a94210203f4d45d38f29f33a82a8'/>
<id>urn:sha1:e6cf5fb2cc43a94210203f4d45d38f29f33a82a8</id>
<content type='text'>
Short circuiting is handled correctly by c_if_cond, and constants within
short-circuit expressions are optimised by the parser.
</content>
</entry>
<entry>
<title>py/parse: Make mp_parse_node_new_leaf an inline function.</title>
<updated>2016-11-15T05:48:48+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-11-13T04:35:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ed9c93f0f13fe2b6b4b0fbc1155b1e38ee1be242'/>
<id>urn:sha1:ed9c93f0f13fe2b6b4b0fbc1155b1e38ee1be242</id>
<content type='text'>
It is split into 2 functions, one to make small ints and the other to make
a non-small-int leaf node.  This reduces code size by 32 bytes on
bare-arm, 64 bytes on unix (x64-64) and 144 bytes on stmhal.
</content>
</entry>
<entry>
<title>py/parse: Move function to check for const parse node to parse.[ch].</title>
<updated>2016-11-15T05:48:48+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-11-13T04:32:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=b0cbfb0492028192a28f0514fba71ec954330108'/>
<id>urn:sha1:b0cbfb0492028192a28f0514fba71ec954330108</id>
<content type='text'>
</content>
</entry>
</feed>
