[pypy-dev] [pypy-commit] pypy default: use jit.loop_unrolling_heuristic where possible
Armin Rigo
arigo at tunes.org
Thu Mar 28 17:33:55 CET 2013
Hi Brian, hi Carl Friedrich,
On Mon, Mar 25, 2013 at 1:26 PM, Carl Friedrich Bolz <cfbolz at gmx.de> wrote:
> m = l0
> if l1 < m:
> m = l1
> if l2 < m
> m = l2
> if l3 < m
> m = l3
> if l3 < m
> m = l3
Alternatively, we could work a bit more and have it jitted as a single
non-branching piece of code. For example, with "space.min(w_a, w_b)",
which would check the types, and if both are ints, then just return
"space.newint(min(w_a.value, w_b.value))". There are various way to
compute min(x, y) with two integer arguments in RPython, without
branching. At worst we make it a special ResOperation, but there are
also other ways.
A bientôt,
Armin.
More information about the pypy-dev
mailing list