comparison src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp @ 2089:037c727f35fb

7009231: C1: Incorrect CAS code for longs on SPARC 32bit Summary: Fix CAS of longs on SPARC 32bit and cmove on SPARC 64bit. Reviewed-by: kvn
author iveresov
date Mon, 27 Dec 2010 21:51:31 -0800
parents f95d63e2154a
children e1162778c1c8
comparison
equal deleted inserted replaced
2088:8d0b933dda2d 2089:037c727f35fb
660 LIR_Opr t2 = FrameMap::G3_opr; // temp for 64-bit value 660 LIR_Opr t2 = FrameMap::G3_opr; // temp for 64-bit value
661 __ cas_long(addr, cmp_value.result(), new_value.result(), t1, t2); 661 __ cas_long(addr, cmp_value.result(), new_value.result(), t1, t2);
662 662
663 // generate conditional move of boolean result 663 // generate conditional move of boolean result
664 LIR_Opr result = rlock_result(x); 664 LIR_Opr result = rlock_result(x);
665 __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result); 665 __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result, T_LONG);
666 } 666 }
667 667
668 668
669 void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) { 669 void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) {
670 assert(x->number_of_arguments() == 4, "wrong type"); 670 assert(x->number_of_arguments() == 4, "wrong type");
697 else if (type == longType) 697 else if (type == longType)
698 __ cas_long(addr, cmp.result(), val.result(), t1, t2); 698 __ cas_long(addr, cmp.result(), val.result(), t1, t2);
699 else { 699 else {
700 ShouldNotReachHere(); 700 ShouldNotReachHere();
701 } 701 }
702
703 // generate conditional move of boolean result 702 // generate conditional move of boolean result
704 LIR_Opr result = rlock_result(x); 703 LIR_Opr result = rlock_result(x);
705 __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result); 704 __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0),
705 result, as_BasicType(type));
706 if (type == objectType) { // Write-barrier needed for Object fields. 706 if (type == objectType) { // Write-barrier needed for Object fields.
707 // Precise card mark since could either be object or array 707 // Precise card mark since could either be object or array
708 post_barrier(addr, val.result()); 708 post_barrier(addr, val.result());
709 } 709 }
710 } 710 }