aboutsummaryrefslogtreecommitdiff
path: root/target-sparc
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-08-06 18:13:54 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-08-06 18:13:54 +0000
commit01b1fa6d16c4def89ef4dc94d0a37d6d220d5fa0 (patch)
tree0aba6a11ae3a3c6818c5301842e50134774ac67d /target-sparc
parentae6b5e5afd991b52ab2bc2c13ef18837544d741d (diff)
downloadqemu-01b1fa6d16c4def89ef4dc94d0a37d6d220d5fa0.zip
qemu-01b1fa6d16c4def89ef4dc94d0a37d6d220d5fa0.tar.gz
qemu-01b1fa6d16c4def89ef4dc94d0a37d6d220d5fa0.tar.bz2
Fix Sparc64 shifts
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4990 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-sparc')
-rw-r--r--target-sparc/translate.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index 9d5230f..4429063 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -2920,20 +2920,17 @@ static void disas_sparc_insn(DisasContext * dc)
if (insn & (1 << 12)) {
tcg_gen_shli_i64(cpu_dst, cpu_src1, rs2 & 0x3f);
} else {
- tcg_gen_andi_i64(cpu_dst, cpu_src1, 0xffffffffULL);
- tcg_gen_shli_i64(cpu_dst, cpu_dst, rs2 & 0x1f);
+ tcg_gen_shli_i64(cpu_dst, cpu_src1, rs2 & 0x1f);
}
} else { /* register */
rs2 = GET_FIELD(insn, 27, 31);
gen_movl_reg_TN(rs2, cpu_src2);
if (insn & (1 << 12)) {
tcg_gen_andi_i64(cpu_tmp0, cpu_src2, 0x3f);
- tcg_gen_shl_i64(cpu_dst, cpu_src1, cpu_tmp0);
} else {
tcg_gen_andi_i64(cpu_tmp0, cpu_src2, 0x1f);
- tcg_gen_andi_i64(cpu_dst, cpu_src1, 0xffffffffULL);
- tcg_gen_shl_i64(cpu_dst, cpu_dst, cpu_tmp0);
}
+ tcg_gen_shl_i64(cpu_dst, cpu_src1, cpu_tmp0);
}
gen_movl_TN_reg(rd, cpu_dst);
} else if (xop == 0x26) { /* srl, V9 srlx */
@@ -2979,6 +2976,7 @@ static void disas_sparc_insn(DisasContext * dc)
} else {
tcg_gen_andi_i64(cpu_tmp0, cpu_src2, 0x1f);
tcg_gen_andi_i64(cpu_dst, cpu_src1, 0xffffffffULL);
+ tcg_gen_ext_i32_i64(cpu_dst, cpu_dst);
tcg_gen_sar_i64(cpu_dst, cpu_dst, cpu_tmp0);
}
}