summaryrefslogtreecommitdiffstatshomepage
path: root/py/mpconfig.h
diff options
context:
space:
mode:
authorDoug Currie <github.9.eeeeeee@spamgourmet.com>2016-01-30 22:35:58 -0500
committerDamien George <damien.p.george@gmail.com>2016-02-03 22:13:39 +0000
commit2e2e15cec2f85ece763f3f80152d759aecfad47c (patch)
treefc70fb1001ea72640bdb5f5b49c6951a65410817 /py/mpconfig.h
parent5f3e005b6791634b104fa6385c8a9bf5ed1af164 (diff)
downloadmicropython-2e2e15cec2f85ece763f3f80152d759aecfad47c.tar.gz
micropython-2e2e15cec2f85ece763f3f80152d759aecfad47c.zip
py/mpz: Complete implementation of mpz_{and,or,xor} for negative args.
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.
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r--py/mpconfig.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 402e97acc2..0c46bf3e5a 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -342,6 +342,12 @@
#define MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE (0)
#endif
+// Whether to use fast versions of bitwise operations (and, or, xor) when the
+// arguments are both positive. Increases Thumb2 code size by about 250 bytes.
+#ifndef MICROPY_OPT_MPZ_BITWISE
+#define MICROPY_OPT_MPZ_BITWISE (0)
+#endif
+
/*****************************************************************************/
/* Python internal features */