On Thu, 17 Dec 2009, Richard Henderson wrote: > Defines setcond and movcond for implementing conditional moves at > the tcg opcode level. 64-bit-on-32-bit is expanded via a setcond2 > primitive plus other operations. > > Signed-off-by: Richard Henderson <r...@twiddle.net> > --- > tcg/README | 26 +++++++++++++++- > tcg/tcg-op.h | 91 > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > tcg/tcg-opc.h | 5 +++ > tcg/tcg.c | 23 ++++++++++---- > 4 files changed, 138 insertions(+), 7 deletions(-) > > diff --git a/tcg/README b/tcg/README > index e672258..8617994 100644 > --- a/tcg/README > +++ b/tcg/README > @@ -152,6 +152,11 @@ Conditional jump if t0 cond t1 is true. cond can be: > TCG_COND_LEU /* unsigned */ > TCG_COND_GTU /* unsigned */ > > +* brcond2_i32 cond, t0_low, t0_high, t1_low, t1_high, label > + > +Similar to brcond, except that the 64-bit values T0 and T1 > +are formed from two 32-bit arguments. > + > ********* Arithmetic > > * add_i32/i64 t0, t1, t2 > @@ -282,6 +287,25 @@ order bytes must be set to zero. > Indicate that the value of t0 won't be used later. It is useful to > force dead code elimination. > > +********* Conditional moves > + > +* setcond_i32/i64 cond, dest, t1, t2 > + > +dest = (t1 cond t2) > + > +Set DEST to 1 if (T1 cond T2) is true, otherwise set to 0. > + > +* movcond_i32/i64 cond, dest, c1, c2, vtrue, vfalse > + > +dest= (c1 cond c2 ? vtrue : of)
Nitpick: no space before '=' > + > +Set DEST to VTRUE if (c1 cond c2) is true, otherwise set to VFALSE. But it reads `? vtrue : of'. Should probably be `? vtrue : vfalse` [..snip..] -- mailto:av1...@comtv.ru