Commit 1121f87961e87563df65134b15db05c0c2cc67da

Authored by blueswir1
1 parent 64c68080

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
Showing 1 changed file with 5 additions and 5 deletions
target-sparc/op_helper.c
... ... @@ -2199,11 +2199,11 @@ target_ulong helper_cas_asi(target_ulong addr, target_ulong val1,
2199 2199 {
2200 2200 target_ulong ret;
2201 2201  
2202   - val1 &= 0xffffffffUL;
  2202 + val2 &= 0xffffffffUL;
2203 2203 ret = helper_ld_asi(addr, asi, 4, 0);
2204 2204 ret &= 0xffffffffUL;
2205   - if (val1 == ret)
2206   - helper_st_asi(addr, val2 & 0xffffffffUL, asi, 4);
  2205 + if (val2 == ret)
  2206 + helper_st_asi(addr, val1 & 0xffffffffUL, asi, 4);
2207 2207 return ret;
2208 2208 }
2209 2209  
... ... @@ -2213,8 +2213,8 @@ target_ulong helper_casx_asi(target_ulong addr, target_ulong val1,
2213 2213 target_ulong ret;
2214 2214  
2215 2215 ret = helper_ld_asi(addr, asi, 8, 0);
2216   - if (val1 == ret)
2217   - helper_st_asi(addr, val2, asi, 8);
  2216 + if (val2 == ret)
  2217 + helper_st_asi(addr, val1, asi, 8);
2218 2218 return ret;
2219 2219 }
2220 2220 #endif /* TARGET_SPARC64 */
... ...