提交 6eebb7a4 编写于 作者: R Richard Henderson

target-mips: Use the new extract op

Use extract for EXT and DEXT.
Reviewed-by: NYongbok Kim <yongbok.kim@imgtec.com>
Signed-off-by: NRichard Henderson <rth@twiddle.net>
上级 04fc2f1c
......@@ -4488,11 +4488,12 @@ static void gen_bitops (DisasContext *ctx, uint32_t opc, int rt,
if (lsb + msb > 31) {
goto fail;
}
tcg_gen_shri_tl(t0, t1, lsb);
if (msb != 31) {
tcg_gen_andi_tl(t0, t0, (1U << (msb + 1)) - 1);
tcg_gen_extract_tl(t0, t1, lsb, msb + 1);
} else {
tcg_gen_ext32s_tl(t0, t0);
/* The two checks together imply that lsb == 0,
so this is a simple sign-extension. */
tcg_gen_ext32s_tl(t0, t1);
}
break;
#if defined(TARGET_MIPS64)
......@@ -4507,10 +4508,7 @@ static void gen_bitops (DisasContext *ctx, uint32_t opc, int rt,
if (lsb + msb > 63) {
goto fail;
}
tcg_gen_shri_tl(t0, t1, lsb);
if (msb != 63) {
tcg_gen_andi_tl(t0, t0, (1ULL << (msb + 1)) - 1);
}
tcg_gen_extract_tl(t0, t1, lsb, msb + 1);
break;
#endif
case OPC_INS:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册