[pypy-dev] [pypy-commit] pypy default: use jit.loop_unrolling_heuristic where possible

Armin Rigo arigo at tunes.org
Thu Mar 28 18:05:03 CET 2013


Hi,

On Thu, Mar 28, 2013 at 5:33 PM, Armin Rigo <arigo at tunes.org> wrote:
> There are various way to compute min(x, y) with two integer
> arguments in RPython, without branching.

The best might be to implement min(x, y) in RPython as returning
"int_select(x < y, x, y)", using a new rarithmetic.int_select(a, b, c)
function similar to rarithmetic.int_between(), which would turn into
the C code "a ? b : c".  We can easily support this operation a bit
everywhere, down to the JIT backends --- and then on x86 it is done
with a single conditional move instruction.


A bientôt,

Armin.


More information about the pypy-dev mailing list