<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/runtime0.h, branch v1.9.3</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.9.3</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.9.3'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2017-10-11T07:54:34+00:00</updated>
<entry>
<title>py/emitnative: Implement floor-division and modulo for viper emitter.</title>
<updated>2017-10-11T07:54:34+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-10-11T07:54:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a3afa8cfc46913f471d5eb55da4ae22dee92c25f'/>
<id>urn:sha1:a3afa8cfc46913f471d5eb55da4ae22dee92c25f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Clean up unary and binary enum list to keep groups together.</title>
<updated>2017-10-04T23:49:44+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-10-03T12:34:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=0864a6957fe4717c3ec40ceeb373b19614a18434'/>
<id>urn:sha1:0864a6957fe4717c3ec40ceeb373b19614a18434</id>
<content type='text'>
2 non-bytecode binary ops (NOT_IN and IN_NOT) are moved out of the
bytecode group, so this change will change the bytecode format.
</content>
</entry>
<entry>
<title>py: Clarify which mp_unary_op_t's may appear in the bytecode.</title>
<updated>2017-09-25T23:35:19+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2017-09-25T23:35:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=9d836fedbdb1d28bdfc4ba475bbdfc1adb3f007a'/>
<id>urn:sha1:9d836fedbdb1d28bdfc4ba475bbdfc1adb3f007a</id>
<content type='text'>
Not all can, so we don't need to reserve bytecodes for them, and can
use free slots for something else later.
</content>
</entry>
<entry>
<title>py/runtime0: Add comments about unary/binary-op enums used in bytecode.</title>
<updated>2017-09-22T01:54:08+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-09-22T01:54:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=8edc2e4b141ffad74754686fbdc66e033ff24f34'/>
<id>urn:sha1:8edc2e4b141ffad74754686fbdc66e033ff24f34</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/modbuiltins: Implement abs() by dispatching to MP_UNARY_OP_ABS.</title>
<updated>2017-09-17T21:06:43+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2017-09-17T21:06:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=9dce823cfd0a9991350184f08a1373f3887134f4'/>
<id>urn:sha1:9dce823cfd0a9991350184f08a1373f3887134f4</id>
<content type='text'>
This allows user classes to implement __abs__ special method, and saves
code size (104 bytes for x86_64), even though during refactor, an issue
was fixed and few optimizations were made:

* abs() of minimum (negative) small int value is calculated properly.
* objint_longlong and objint_mpz avoid allocating new object is the
  argument is already non-negative.
</content>
</entry>
<entry>
<title>py/runtime: Implement dispatch for "reverse op" special methods.</title>
<updated>2017-09-10T14:05:57+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2017-09-10T14:05:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=eb84a830df62813f5af7f0144fc77444bf18f3a8'/>
<id>urn:sha1:eb84a830df62813f5af7f0144fc77444bf18f3a8</id>
<content type='text'>
If, for class X, X.__add__(Y) doesn't exist (or returns NotImplemented),
try Y.__radd__(X) instead.

This patch could be simpler, but requires undoing operand swap and
operation switch to get non-confusing error message in case __radd__
doesn't exist.
</content>
</entry>
<entry>
<title>py/runtime0.h: Put inplace arith ops in front of normal operations.</title>
<updated>2017-09-07T21:10:10+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2017-09-07T21:10:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=b8ee7ab5b988f424e34e778fe3a679710d675efa'/>
<id>urn:sha1:b8ee7ab5b988f424e34e778fe3a679710d675efa</id>
<content type='text'>
This is to allow to place reverse ops immediately after normal ops, so
they can be tested as one range (which is optimization for reverse ops
introduction in the next patch).
</content>
</entry>
<entry>
<title>py/runtime0.h: Regroup operations a bit.</title>
<updated>2017-09-07T10:37:33+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2017-09-07T10:37:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=c460f6f15af681860f7606761da7579c9945761b'/>
<id>urn:sha1:c460f6f15af681860f7606761da7579c9945761b</id>
<content type='text'>
Originally, there were grouped in blocks of 5, to make it easier e.g.
to assess and numeric code of each. But now it makes more sense to
group it by semantics/properties, and then split in chunks still,
which usually leads to chunks of ~6 ops.
</content>
</entry>
<entry>
<title>py/objtype: Make sure mp_binary_op_method_name has full size again.</title>
<updated>2017-09-07T09:54:58+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2017-09-07T09:54:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6d4cac088eb29c7909f81121608546ca1b5e292e'/>
<id>urn:sha1:6d4cac088eb29c7909f81121608546ca1b5e292e</id>
<content type='text'>
After recent refactorings to mp_binary_op_t, and make it future refactoring
proof for now, at the cost of extra element in the array.
</content>
</entry>
<entry>
<title>py/runtime0.h: Move MP_BINARY_OP_DIVMOD to the end of mp_binary_op_t.</title>
<updated>2017-09-07T08:26:42+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2017-09-07T08:26:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=50b9329eba29a36b6948699aaea9473681d4f46b'/>
<id>urn:sha1:50b9329eba29a36b6948699aaea9473681d4f46b</id>
<content type='text'>
It starts a dichotomy of mp_binary_op_t values which can't appear in the
bytecode. Another reason to move it is to VALUES of OP_* and OP_INPLACE_*
nicely adjacent. This also will be needed for OP_REVERSE_*, to be soon
introduced.
</content>
</entry>
</feed>
