From 21fc3cfc10a016a8cd253898b5c1cb8f331983e5 Mon Sep 17 00:00:00 2001 From: pbrook Date: Tue, 4 Mar 2008 23:52:47 +0000 Subject: [PATCH] 32-bit host sign extension fix (Juergen Lock). git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4017 c046a42c-6fe2-441c-8c8c-71466251a162 --- tcg/tcg-op.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h index e5047418a6..602a6bf9ce 100644 --- a/tcg/tcg-op.h +++ b/tcg/tcg-op.h @@ -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 }