提交 352367e8 编写于 作者: S Sebastian Macke 提交者: Jia Liu

target-openrisc: Speed up move instruction

The OpenRISC architecture does not have its own move register
instruction. Instead it uses either "l.addi rd, r0, x" or
"l.ori rd, rs, 0" or "l.or rd, rx, r0"

The l.ori instruction is automatically optimized but not the l.addi instruction.
This patch optimizes for this special case.
Signed-off-by: NSebastian Macke <sebastian@macke.de>
Reviewed-by: NJia Liu <proljc@gmail.com>
Signed-off-by: NJia Liu <proljc@gmail.com>
上级 394cfa39
......@@ -904,6 +904,9 @@ static void dec_misc(DisasContext *dc, uint32_t insn)
case 0x27: /* l.addi */
LOG_DIS("l.addi r%d, r%d, %d\n", rd, ra, I16);
{
if (I16 == 0) {
tcg_gen_mov_tl(cpu_R[rd], cpu_R[ra]);
} else {
int lab = gen_new_label();
TCGv_i64 ta = tcg_temp_new_i64();
TCGv_i64 td = tcg_temp_local_new_i64();
......@@ -928,6 +931,7 @@ static void dec_misc(DisasContext *dc, uint32_t insn)
tcg_temp_free_i32(res);
tcg_temp_free_i32(sr_ove);
}
}
break;
case 0x28: /* l.addic */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册