32-bit host sign extension fix (Juergen Lock).

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4017 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
pbrook 2008-03-04 23:52:47 +00:00
parent f32d7ec537
commit 21fc3cfc10

View File

@ -1172,7 +1172,7 @@ static inline void tcg_gen_qemu_ld8s(TCGv ret, TCGv addr, int mem_index)
tcg_gen_op3i(INDEX_op_qemu_ld8s, ret, addr, mem_index);
#else
tcg_gen_op4i(INDEX_op_qemu_ld8s, ret, addr, TCGV_HIGH(addr), mem_index);
tcg_gen_ext8s_i32(TCGV_HIGH(ret), ret);
tcg_gen_sari_i32(TCGV_HIGH(ret), ret, 31);
#endif
}
@ -1192,7 +1192,7 @@ static inline void tcg_gen_qemu_ld16s(TCGv ret, TCGv addr, int mem_index)
tcg_gen_op3i(INDEX_op_qemu_ld16s, ret, addr, mem_index);
#else
tcg_gen_op4i(INDEX_op_qemu_ld16s, ret, addr, TCGV_HIGH(addr), mem_index);
tcg_gen_ext16s_i32(TCGV_HIGH(ret), ret);
tcg_gen_sari_i32(TCGV_HIGH(ret), ret, 31);
#endif
}