< prev index next >

src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp

Print this page

1529     __ cmpd(CCR0, left->as_register_lo(), right->as_register_lo());
1530     __ set_cmp3(Rdst);  // set result as follows: <: -1, =: 0, >: 1
1531   } else {
1532     ShouldNotReachHere();
1533   }
1534 }
1535 
1536 
1537 inline void load_to_reg(LIR_Assembler *lasm, LIR_Opr src, LIR_Opr dst) {
1538   if (src->is_constant()) {
1539     lasm->const2reg(src, dst, lir_patch_none, NULL);
1540   } else if (src->is_register()) {
1541     lasm->reg2reg(src, dst);
1542   } else if (src->is_stack()) {
1543     lasm->stack2reg(src, dst, dst->type());
1544   } else {
1545     ShouldNotReachHere();
1546   }
1547 }
1548 



1549 
1550 void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type) {
1551   if (opr1->is_equal(opr2) || opr1->is_same_register(opr2)) {
1552     load_to_reg(this, opr1, result); // Condition doesn't matter.
1553     return;
1554   }
1555 
1556   bool positive = false;
1557   Assembler::Condition cond = Assembler::equal;
1558   switch (condition) {
1559     case lir_cond_equal:        positive = true ; cond = Assembler::equal  ; break;
1560     case lir_cond_notEqual:     positive = false; cond = Assembler::equal  ; break;
1561     case lir_cond_less:         positive = true ; cond = Assembler::less   ; break;
1562     case lir_cond_belowEqual:
1563     case lir_cond_lessEqual:    positive = false; cond = Assembler::greater; break;
1564     case lir_cond_greater:      positive = true ; cond = Assembler::greater; break;
1565     case lir_cond_aboveEqual:
1566     case lir_cond_greaterEqual: positive = false; cond = Assembler::less   ; break;
1567     default:                    ShouldNotReachHere();
1568   }
1569 
1570   // Try to use isel on >=Power7.

1529     __ cmpd(CCR0, left->as_register_lo(), right->as_register_lo());
1530     __ set_cmp3(Rdst);  // set result as follows: <: -1, =: 0, >: 1
1531   } else {
1532     ShouldNotReachHere();
1533   }
1534 }
1535 
1536 
1537 inline void load_to_reg(LIR_Assembler *lasm, LIR_Opr src, LIR_Opr dst) {
1538   if (src->is_constant()) {
1539     lasm->const2reg(src, dst, lir_patch_none, NULL);
1540   } else if (src->is_register()) {
1541     lasm->reg2reg(src, dst);
1542   } else if (src->is_stack()) {
1543     lasm->stack2reg(src, dst, dst->type());
1544   } else {
1545     ShouldNotReachHere();
1546   }
1547 }
1548 
1549 void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type,
1550                           LIR_Opr cmp_opr1, LIR_Opr cmp_opr2) {
1551   assert(cmp_opr1 == LIR_OprFact::illegalOpr && cmp_opr2 == LIR_OprFact::illegalOpr, "unnecessary cmp oprs on ppc");
1552 

1553   if (opr1->is_equal(opr2) || opr1->is_same_register(opr2)) {
1554     load_to_reg(this, opr1, result); // Condition doesn't matter.
1555     return;
1556   }
1557 
1558   bool positive = false;
1559   Assembler::Condition cond = Assembler::equal;
1560   switch (condition) {
1561     case lir_cond_equal:        positive = true ; cond = Assembler::equal  ; break;
1562     case lir_cond_notEqual:     positive = false; cond = Assembler::equal  ; break;
1563     case lir_cond_less:         positive = true ; cond = Assembler::less   ; break;
1564     case lir_cond_belowEqual:
1565     case lir_cond_lessEqual:    positive = false; cond = Assembler::greater; break;
1566     case lir_cond_greater:      positive = true ; cond = Assembler::greater; break;
1567     case lir_cond_aboveEqual:
1568     case lir_cond_greaterEqual: positive = false; cond = Assembler::less   ; break;
1569     default:                    ShouldNotReachHere();
1570   }
1571 
1572   // Try to use isel on >=Power7.
< prev index next >