From 71817e48988acad1f1d92902ed5d46dc36dd2117 Mon Sep 17 00:00:00 2001 From: blueswir1 Date: Tue, 15 Jul 2008 14:52:09 +0000 Subject: [PATCH] Really fix cas git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4869 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-sparc/translate.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/target-sparc/translate.c b/target-sparc/translate.c index 49f998e90b..4412363e3a 100644 --- a/target-sparc/translate.c +++ b/target-sparc/translate.c @@ -4178,12 +4178,11 @@ static void disas_sparc_insn(DisasContext * dc) unsigned int xop = GET_FIELD(insn, 7, 12); cpu_src1 = get_src1(insn, cpu_src1); - if (xop == 0x3c || xop == 0x3e) - { + if (xop == 0x3c || xop == 0x3e) { // V9 casa/casxa rs2 = GET_FIELD(insn, 27, 31); gen_movl_reg_TN(rs2, cpu_src2); - } - else if (IS_IMM) { /* immediate */ + tcg_gen_mov_tl(cpu_addr, cpu_src1); + } else if (IS_IMM) { /* immediate */ rs2 = GET_FIELDs(insn, 19, 31); tcg_gen_addi_tl(cpu_addr, cpu_src1, (int)rs2); } else { /* register */ @@ -4615,11 +4614,11 @@ static void disas_sparc_insn(DisasContext * dc) gen_stf_asi(cpu_addr, insn, 8, DFPREG(rd)); break; case 0x3c: /* V9 casa */ - gen_cas_asi(cpu_val, cpu_addr, cpu_val, insn, rd); + gen_cas_asi(cpu_val, cpu_addr, cpu_src2, insn, rd); gen_movl_TN_reg(rd, cpu_val); break; case 0x3e: /* V9 casxa */ - gen_casx_asi(cpu_val, cpu_addr, cpu_val, insn, rd); + gen_casx_asi(cpu_val, cpu_addr, cpu_src2, insn, rd); gen_movl_TN_reg(rd, cpu_val); break; #else