< prev index next >

src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp

Print this page

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



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

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

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