From 1121f87961e87563df65134b15db05c0c2cc67da Mon Sep 17 00:00:00 2001 From: blueswir1 Date: Mon, 22 Sep 2008 16:52:28 +0000 Subject: [PATCH] Fix arguments used in cas/casx, thanks to Igor Kovalenko for spotting git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5296 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-sparc/op_helper.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c index cf15cd3..163e82b 100644 --- a/target-sparc/op_helper.c +++ b/target-sparc/op_helper.c @@ -2199,11 +2199,11 @@ target_ulong helper_cas_asi(target_ulong addr, target_ulong val1, { target_ulong ret; - val1 &= 0xffffffffUL; + val2 &= 0xffffffffUL; ret = helper_ld_asi(addr, asi, 4, 0); ret &= 0xffffffffUL; - if (val1 == ret) - helper_st_asi(addr, val2 & 0xffffffffUL, asi, 4); + if (val2 == ret) + helper_st_asi(addr, val1 & 0xffffffffUL, asi, 4); return ret; } @@ -2213,8 +2213,8 @@ target_ulong helper_casx_asi(target_ulong addr, target_ulong val1, target_ulong ret; ret = helper_ld_asi(addr, asi, 8, 0); - if (val1 == ret) - helper_st_asi(addr, val2, asi, 8); + if (val2 == ret) + helper_st_asi(addr, val1, asi, 8); return ret; } #endif /* TARGET_SPARC64 */ -- 1.7.9.5