<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/mpz.c, branch cross</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=cross</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=cross'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2016-05-09T16:21:42+00:00</updated>
<entry>
<title>py/mpz: Fix mpn_div so that it doesn't modify memory of denominator.</title>
<updated>2016-05-09T16:21:42+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-05-09T16:21:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=460b0863334fb143667ae6aa1b5f0bd2bbdf8282'/>
<id>urn:sha1:460b0863334fb143667ae6aa1b5f0bd2bbdf8282</id>
<content type='text'>
Previous to this patch bignum division and modulo would temporarily
modify the RHS argument to the operation (eg x/y would modify y), but on
return the RHS would be restored to its original value.  This is not
allowed because arguments to binary operations are const, and in
particular might live in ROM.  The modification was to normalise the arg
(and then unnormalise before returning), and this patch makes it so the
normalisation is done on the fly and the arg is now accessed as read-only.

This change doesn't increase the order complexity of the operation, and
actually reduces code size.
</content>
</entry>
<entry>
<title>py/mpz: Do Python style division/modulo within bignum divmod routine.</title>
<updated>2016-05-08T21:21:21+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-05-08T21:21:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=65402ab1ec05fd552ceae63e2dcac69095ab1338'/>
<id>urn:sha1:65402ab1ec05fd552ceae63e2dcac69095ab1338</id>
<content type='text'>
This patch consolidates the Python logic for division/modulo to one place
within the bignum code.
</content>
</entry>
<entry>
<title>py/mpz: Fix bug with overflowing C-shift in division routine.</title>
<updated>2016-05-08T20:38:43+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-05-08T20:38:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=dc3faea0405dea803828f5a2be314734b8c166b6'/>
<id>urn:sha1:dc3faea0405dea803828f5a2be314734b8c166b6</id>
<content type='text'>
When DIG_SIZE=32, a uint32_t is used to store limbs, and no normalisation
is needed because the MSB is already set, then there will be left and
right shifts (in C) by 32 of a 32-bit variable, leading to undefined
behaviour.  This patch fixes this bug.
</content>
</entry>
<entry>
<title>py/mpz: Add commented-out mpz_pow3_inpl function, to compute (x**y)%z.</title>
<updated>2016-02-03T22:30:49+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-02-03T22:30:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ff1a96ce2cd95c42beca5209b353f83da773522d'/>
<id>urn:sha1:ff1a96ce2cd95c42beca5209b353f83da773522d</id>
<content type='text'>
This function computes (x**y)%z in an efficient way.  For large arguments
this operation is otherwise not computable by doing x**y and then %z.

It's currently not used, but is added in case it's useful one day.
</content>
</entry>
<entry>
<title>py/mpz: Complete implementation of mpz_{and,or,xor} for negative args.</title>
<updated>2016-02-03T22:13:39+00:00</updated>
<author>
<name>Doug Currie</name>
<email>github.9.eeeeeee@spamgourmet.com</email>
</author>
<published>2016-01-31T03:35:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=2e2e15cec2f85ece763f3f80152d759aecfad47c'/>
<id>urn:sha1:2e2e15cec2f85ece763f3f80152d759aecfad47c</id>
<content type='text'>
For these 3 bitwise operations there are now fast functions for
positive-only arguments, and general functions for arbitrary sign
arguments (the fast functions are the existing implementation).

By default the fast functions are not used (to save space) and instead
the general functions are used for all operations.

Enable MICROPY_OPT_MPZ_BITWISE to use the fast functions for positive
arguments.
</content>
</entry>
<entry>
<title>py/mpz: Fix conversion of float to mpz so it works on big endian archs.</title>
<updated>2016-01-08T17:56:58+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-01-08T17:56:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=2adf7ec3dd4da9188be60e9536b401ab99189558'/>
<id>urn:sha1:2adf7ec3dd4da9188be60e9536b401ab99189558</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/mpz: Normalize (remove leading zeros) xor operation result.</title>
<updated>2015-11-22T20:03:18+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-11-22T20:03:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=b3be4710aaa53429c78d03a86e9be909dca923c0'/>
<id>urn:sha1:b3be4710aaa53429c78d03a86e9be909dca923c0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/mpz: Fix bignum anding of large negative with smaller positive int.</title>
<updated>2015-10-01T21:35:06+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-10-01T21:35:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=2065373f67b126edfc3e0f2519aaad0956902c14'/>
<id>urn:sha1:2065373f67b126edfc3e0f2519aaad0956902c14</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/mpz: Force rhs of mpz_shl_inpl/mpz_shr_inpl to be unsigned.</title>
<updated>2015-10-01T17:01:37+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-10-01T17:01:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=2f4e8511cd602a6110b3636c316b5cac21181bf3'/>
<id>urn:sha1:2f4e8511cd602a6110b3636c316b5cac21181bf3</id>
<content type='text'>
Python semantics are that rhs of shift must be non-negative, so there's
no need to handle negative values in the underlying mpz implementation.
</content>
</entry>
<entry>
<title>py/mpz: Raise NotImplError instead of failing assertion.</title>
<updated>2015-10-01T16:57:36+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-10-01T16:57:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=4c02e54298b0f955c5d60023310b724baa890d67'/>
<id>urn:sha1:4c02e54298b0f955c5d60023310b724baa890d67</id>
<content type='text'>
</content>
</entry>
</feed>
