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. --- tests/misc/non_compliant.py | 19 ------------------- tests/misc/non_compliant.py.exp | 3 --- 2 files changed, 22 deletions(-) (limited to 'tests/misc') diff --git a/tests/misc/non_compliant.py b/tests/misc/non_compliant.py index 9c55ac2c3..c760c2acc 100644 --- a/tests/misc/non_compliant.py +++ b/tests/misc/non_compliant.py @@ -70,22 +70,3 @@ try: except NotImplementedError: print('NotImplementedError') -mpz = 1 << 70 - -# mpz and with both args negative -try: - -mpz & -2 -except NotImplementedError: - print('NotImplementedError') - -# mpz or with args opposite sign -try: - -mpz | 2 -except NotImplementedError: - print('NotImplementedError') - -# mpz xor with args opposite sign -try: - -mpz ^ 2 -except NotImplementedError: - print('NotImplementedError') diff --git a/tests/misc/non_compliant.py.exp b/tests/misc/non_compliant.py.exp index 5937ccb2f..28b1470d7 100644 --- a/tests/misc/non_compliant.py.exp +++ b/tests/misc/non_compliant.py.exp @@ -9,6 +9,3 @@ NotImplementedError NotImplementedError NotImplementedError NotImplementedError -NotImplementedError -NotImplementedError -NotImplementedError -- cgit v1.2.3