Author: Squeaky <squeaky...@gmx.com> Branch: bounds-int-add-or Changeset: r69190:41581d8d194b Date: 2014-02-17 15:24 +0100 http://bitbucket.org/pypy/pypy/changeset/41581d8d194b/
Log: add bounds propagation from INT_AND diff --git a/rpython/jit/metainterp/optimizeopt/intbounds.py b/rpython/jit/metainterp/optimizeopt/intbounds.py --- a/rpython/jit/metainterp/optimizeopt/intbounds.py +++ b/rpython/jit/metainterp/optimizeopt/intbounds.py @@ -7,6 +7,7 @@ CONST_0, MODE_ARRAY, MODE_STR, MODE_UNICODE) from rpython.jit.metainterp.optimizeopt.util import make_dispatcher_method from rpython.jit.metainterp.resoperation import rop +from rpython.jit.backend.llsupport import symbolic def get_integer_min(is_unsigned, byte_size): @@ -94,7 +95,10 @@ if val >= 0: r.intbound.intersect(IntBound(0, val)) elif v1.intbound.lower >= 0 and v2.intbound.lower >= 0: - pass + lesser = min(v1.intbound.upper, v2.intbound.upper) + # check if next_power2 won't overflow + if lesser < (1 << ((symbolic.WORD - 1) << 3)): + r.intbound.intersect(IntBound(0, next_power2(lesser) - 1)) def optimize_INT_SUB(self, op): v1 = self.getvalue(op.getarg(0)) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit