From 2e2e15cec2f85ece763f3f80152d759aecfad47c Mon Sep 17 00:00:00 2001 From: Doug Currie Date: Sat, 30 Jan 2016 22:35:58 -0500 Subject: 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. --- py/mpconfig.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'py/mpconfig.h') diff --git a/py/mpconfig.h b/py/mpconfig.h index 402e97acc..0c46bf3e5 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 */ -- cgit v1.2.3