>From 64c6c9e8a312ae6030794ae1c0fb8e45ce0d77a3 Mon Sep 17 00:00:00 2001 From: Bastian Koppelmann Date: Thu, 12 Mar 2015 14:47:29 +0000 Subject: [PATCH] tcg: tcg_gen_or_i32 causing in some cases tcg_opt_gen_mov to fail A first try to fix this is to emit the mov in tcg_or_i32. Signed-off-by: Bastian Koppelmann --- tcg/tcg-op.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h index 96adf9a..4c8ff70 100644 --- a/tcg/tcg-op.h +++ b/tcg/tcg-op.h @@ -396,7 +396,11 @@ static inline void tcg_gen_and_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2) static inline void tcg_gen_or_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2) { - tcg_gen_op3_i32(INDEX_op_or_i32, ret, arg1, arg2); + if (TCGV_EQUAL_I32(arg1, arg2)) { + tcg_gen_mov_i32(ret, arg1); + } else { + tcg_gen_op3_i32(INDEX_op_or_i32, ret, arg1, arg2); + } } static inline void tcg_gen_xor_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2) -- 2.3.2