Message ID | 1313614358-29289-1-git-send-email-blanham@gmail.com |
---|---|
State | New |
Headers | show |
diff --git a/target-m68k/translate.c b/target-m68k/translate.c index 96ea93f..52df274 100644 --- a/target-m68k/translate.c +++ b/target-m68k/translate.c @@ -3215,7 +3215,11 @@ static void gen_bitfield_ins(TCGv offset, TCGv width, TCGv src, /* tmp = (1u << width) - 1; */ - tcg_gen_shl_i32(tmp, tcg_const_i32(1), width); + /* width is between 1 and 32 + * tcg_gen_shl_i32() cannot manage value 32 + */ + tcg_gen_subi_i32(tmp, width, 1); + tcg_gen_shl_i32(tmp, tcg_const_i32(2), tmp); tcg_gen_subi_i32(tmp, tmp, 1); /* tmp = tmp & src; */