< prev index next >

src/cpu/x86/vm/c1_LIRAssembler_x86.cpp

Print this page
rev 9067 : 8139040: Fix initializations before ShouldNotReachHere()


1978   } else if (op->code() == lir_cas_long) {
1979     Register addr = (op->addr()->is_single_cpu() ? op->addr()->as_register() : op->addr()->as_register_lo());
1980     Register newval = op->new_value()->as_register_lo();
1981     Register cmpval = op->cmp_value()->as_register_lo();
1982     assert(cmpval == rax, "wrong register");
1983     assert(newval != NULL, "new val must be register");
1984     assert(cmpval != newval, "cmp and new values must be in different registers");
1985     assert(cmpval != addr, "cmp and addr must be in different registers");
1986     assert(newval != addr, "new value and addr must be in different registers");
1987     if (os::is_MP()) {
1988       __ lock();
1989     }
1990     __ cmpxchgq(newval, Address(addr, 0));
1991 #endif // _LP64
1992   } else {
1993     Unimplemented();
1994   }
1995 }
1996 
1997 void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type) {
1998   Assembler::Condition acond, ncond;
1999   switch (condition) {
2000     case lir_cond_equal:        acond = Assembler::equal;        ncond = Assembler::notEqual;     break;
2001     case lir_cond_notEqual:     acond = Assembler::notEqual;     ncond = Assembler::equal;        break;
2002     case lir_cond_less:         acond = Assembler::less;         ncond = Assembler::greaterEqual; break;
2003     case lir_cond_lessEqual:    acond = Assembler::lessEqual;    ncond = Assembler::greater;      break;
2004     case lir_cond_greaterEqual: acond = Assembler::greaterEqual; ncond = Assembler::less;         break;
2005     case lir_cond_greater:      acond = Assembler::greater;      ncond = Assembler::lessEqual;    break;
2006     case lir_cond_belowEqual:   acond = Assembler::belowEqual;   ncond = Assembler::above;        break;
2007     case lir_cond_aboveEqual:   acond = Assembler::aboveEqual;   ncond = Assembler::below;        break;
2008     default:                    ShouldNotReachHere();
2009   }
2010 
2011   if (opr1->is_cpu_register()) {
2012     reg2reg(opr1, result);
2013   } else if (opr1->is_stack()) {
2014     stack2reg(opr1, result, result->type());
2015   } else if (opr1->is_constant()) {
2016     const2reg(opr1, result, lir_patch_none, NULL);
2017   } else {
2018     ShouldNotReachHere();




1978   } else if (op->code() == lir_cas_long) {
1979     Register addr = (op->addr()->is_single_cpu() ? op->addr()->as_register() : op->addr()->as_register_lo());
1980     Register newval = op->new_value()->as_register_lo();
1981     Register cmpval = op->cmp_value()->as_register_lo();
1982     assert(cmpval == rax, "wrong register");
1983     assert(newval != NULL, "new val must be register");
1984     assert(cmpval != newval, "cmp and new values must be in different registers");
1985     assert(cmpval != addr, "cmp and addr must be in different registers");
1986     assert(newval != addr, "new value and addr must be in different registers");
1987     if (os::is_MP()) {
1988       __ lock();
1989     }
1990     __ cmpxchgq(newval, Address(addr, 0));
1991 #endif // _LP64
1992   } else {
1993     Unimplemented();
1994   }
1995 }
1996 
1997 void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type) {
1998   Assembler::Condition acond = Assembler::equal, ncond = Assembler::notEqual;
1999   switch (condition) {
2000     case lir_cond_equal:        acond = Assembler::equal;        ncond = Assembler::notEqual;     break;
2001     case lir_cond_notEqual:     acond = Assembler::notEqual;     ncond = Assembler::equal;        break;
2002     case lir_cond_less:         acond = Assembler::less;         ncond = Assembler::greaterEqual; break;
2003     case lir_cond_lessEqual:    acond = Assembler::lessEqual;    ncond = Assembler::greater;      break;
2004     case lir_cond_greaterEqual: acond = Assembler::greaterEqual; ncond = Assembler::less;         break;
2005     case lir_cond_greater:      acond = Assembler::greater;      ncond = Assembler::lessEqual;    break;
2006     case lir_cond_belowEqual:   acond = Assembler::belowEqual;   ncond = Assembler::above;        break;
2007     case lir_cond_aboveEqual:   acond = Assembler::aboveEqual;   ncond = Assembler::below;        break;
2008     default:                    ShouldNotReachHere();
2009   }
2010 
2011   if (opr1->is_cpu_register()) {
2012     reg2reg(opr1, result);
2013   } else if (opr1->is_stack()) {
2014     stack2reg(opr1, result, result->type());
2015   } else if (opr1->is_constant()) {
2016     const2reg(opr1, result, lir_patch_none, NULL);
2017   } else {
2018     ShouldNotReachHere();


< prev index next >