[pypy-svn] pypy jit-longlong: Clean up some operations that are (most probably) never emitted any more.
arigo
commits-noreply at bitbucket.org
Fri Jan 7 11:48:17 CET 2011
Author: Armin Rigo <arigo at tunes.org>
Branch: jit-longlong
Changeset: r40447:5329ac8a1435
Date: 2011-01-07 11:43 +0100
http://bitbucket.org/pypy/pypy/changeset/5329ac8a1435/
Log: Clean up some operations that are (most probably) never emitted any
more.
diff --git a/pypy/rpython/lltypesystem/lloperation.py b/pypy/rpython/lltypesystem/lloperation.py
--- a/pypy/rpython/lltypesystem/lloperation.py
+++ b/pypy/rpython/lltypesystem/lloperation.py
@@ -288,9 +288,7 @@
'llong_is_true': LLOp(canfold=True),
'llong_neg': LLOp(canfold=True),
- 'llong_neg_ovf': LLOp(canraise=(OverflowError,), tryfold=True),
'llong_abs': LLOp(canfold=True),
- 'llong_abs_ovf': LLOp(canraise=(OverflowError,), tryfold=True),
'llong_invert': LLOp(canfold=True),
'llong_add': LLOp(canfold=True),
diff --git a/pypy/translator/c/src/int.h b/pypy/translator/c/src/int.h
--- a/pypy/translator/c/src/int.h
+++ b/pypy/translator/c/src/int.h
@@ -12,18 +12,12 @@
#define OP_INT_NEG_OVF(x,r) \
if ((x) == LONG_MIN) FAIL_OVF("integer negate"); \
OP_INT_NEG(x,r)
-#define OP_LLONG_NEG_OVF(x,r) \
- if ((x) == LLONG_MIN) FAIL_OVF("integer negate"); \
- OP_LLONG_NEG(x,r)
#define OP_INT_ABS(x,r) r = (x) >= 0 ? x : -(x)
#define OP_INT_ABS_OVF(x,r) \
if ((x) == LONG_MIN) FAIL_OVF("integer absolute"); \
OP_INT_ABS(x,r)
-#define OP_LLONG_ABS_OVF(x,r) \
- if ((x) == LLONG_MIN) FAIL_OVF("integer absolute"); \
- OP_LLONG_ABS(x,r)
/*** binary operations ***/
@@ -51,10 +45,6 @@
r = (long)((unsigned long)x + y); \
if ((r^x) < 0 && (r^y) < 0) FAIL_OVF("integer addition")
-#define OP_LLONG_ADD_OVF(x,y,r) \
- r = (long long)((unsigned long long)x + y); \
- if ((r^x) < 0 && (r^y) < 0) FAIL_OVF("integer addition")
-
#define OP_INT_ADD_NONNEG_OVF(x,y,r) /* y can be assumed >= 0 */ \
r = (long)((unsigned long)x + y); \
if ((r&~x) < 0) FAIL_OVF("integer addition")
@@ -65,10 +55,6 @@
r = (long)((unsigned long)x - y); \
if ((r^x) < 0 && (r^~y) < 0) FAIL_OVF("integer subtraction")
-#define OP_LLONG_SUB_OVF(x,y,r) \
- r = (long long)((unsigned long long)x - y); \
- if ((r^x) < 0 && (r^~y) < 0) FAIL_OVF("integer subtraction")
-
#define OP_INT_MUL(x,y,r) r = (x) * (y)
#if SIZEOF_LONG * 2 <= SIZEOF_LONG_LONG
@@ -83,9 +69,6 @@
r = op_llong_mul_ovf(x, y) /* long == long long */
#endif
-#define OP_LLONG_MUL_OVF(x,y,r) \
- r = op_llong_mul_ovf(x, y)
-
/* shifting */
/* NB. shifting has same limitations as C: the shift count must be
@@ -117,11 +100,6 @@
{ FAIL_OVF("integer division"); r=0; } \
else \
r = (x) / (y)
-#define OP_LLONG_FLOORDIV_OVF(x,y,r) \
- if ((y) == -1 && (x) == LLONG_MIN) \
- { FAIL_OVF("integer division"); r=0; } \
- else \
- r = (x) / (y)
#define OP_INT_FLOORDIV_ZER(x,y,r) \
if ((y) == 0) \
@@ -149,11 +127,6 @@
{ FAIL_ZER("integer division"); r=0; } \
else \
{ OP_INT_FLOORDIV_OVF(x,y,r); }
-#define OP_LLONG_FLOORDIV_OVF_ZER(x,y,r) \
- if ((y) == 0) \
- { FAIL_ZER("integer division"); r=0; } \
- else \
- { OP_LLONG_FLOORDIV_OVF(x,y,r); }
/* modulus */
@@ -167,11 +140,6 @@
{ FAIL_OVF("integer modulo"); r=0; } \
else \
r = (x) % (y)
-#define OP_LLONG_MOD_OVF(x,y,r) \
- if ((y) == -1 && (x) == LLONG_MIN) \
- { FAIL_OVF("integer modulo"); r=0; } \
- else \
- r = (x) % (y)
#define OP_INT_MOD_ZER(x,y,r) \
if ((y) == 0) \
{ FAIL_ZER("integer modulo"); r=0; } \
@@ -198,11 +166,6 @@
{ FAIL_ZER("integer modulo"); r=0; } \
else \
{ OP_INT_MOD_OVF(x,y,r); }
-#define OP_LLONG_MOD_OVF_ZER(x,y,r) \
- if ((y) == 0) \
- { FAIL_ZER("integer modulo"); r=0; } \
- else \
- { OP_LLONG_MOD_OVF(x,y,r); }
/* bit operations */
More information about the Pypy-commit
mailing list