Hi, On Thu, Mar 28, 2013 at 5:33 PM, Armin Rigo <[email protected]> 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. _______________________________________________ pypy-dev mailing list [email protected] http://mail.python.org/mailman/listinfo/pypy-dev
