comparison src/cpu/x86/vm/c1_LIRGenerator_x86.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 0cb042fd2d4b
children f966c66b5463
comparison
equal deleted inserted replaced
2088:8d0b933dda2d 2089:037c727f35fb
739 LIR_Opr t2 = LIR_OprFact::illegalOpr; // no temp needed 739 LIR_Opr t2 = LIR_OprFact::illegalOpr; // no temp needed
740 __ cas_long(addr, cmp_value.result(), new_value.result(), t1, t2); 740 __ cas_long(addr, cmp_value.result(), new_value.result(), t1, t2);
741 741
742 // generate conditional move of boolean result 742 // generate conditional move of boolean result
743 LIR_Opr result = rlock_result(x); 743 LIR_Opr result = rlock_result(x);
744 __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result); 744 __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result, T_LONG);
745 } 745 }
746 746
747 747
748 void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) { 748 void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) {
749 assert(x->number_of_arguments() == 4, "wrong type"); 749 assert(x->number_of_arguments() == 4, "wrong type");
808 ShouldNotReachHere(); 808 ShouldNotReachHere();
809 } 809 }
810 810
811 // generate conditional move of boolean result 811 // generate conditional move of boolean result
812 LIR_Opr result = rlock_result(x); 812 LIR_Opr result = rlock_result(x);
813 __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result); 813 __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0),
814 result, as_BasicType(type));
814 if (type == objectType) { // Write-barrier needed for Object fields. 815 if (type == objectType) { // Write-barrier needed for Object fields.
815 // Seems to be precise 816 // Seems to be precise
816 post_barrier(addr, val.result()); 817 post_barrier(addr, val.result());
817 } 818 }
818 } 819 }