提交 a1d22a36 编写于 作者: R Richard Henderson 提交者: Edgar E. Iglesias

target-cris: Use new qemu_ld/st opcodes

Using the new opcodes we can reduce if/else trees to
a single statement.
Reviewed-by: NEdgar E. Iglesias <edgar.iglesias@gmail.com>
Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: NRichard Henderson <rth@twiddle.net>
Signed-off-by: NEdgar E. Iglesias <edgar.iglesias@gmail.com>
上级 d2aa90cd
...@@ -1133,7 +1133,7 @@ static void gen_load64(DisasContext *dc, TCGv_i64 dst, TCGv addr) ...@@ -1133,7 +1133,7 @@ static void gen_load64(DisasContext *dc, TCGv_i64 dst, TCGv addr)
cris_store_direct_jmp(dc); cris_store_direct_jmp(dc);
} }
tcg_gen_qemu_ld64(dst, addr, mem_index); tcg_gen_qemu_ld_i64(dst, addr, mem_index, MO_TEQ);
} }
static void gen_load(DisasContext *dc, TCGv dst, TCGv addr, static void gen_load(DisasContext *dc, TCGv dst, TCGv addr,
...@@ -1147,23 +1147,8 @@ static void gen_load(DisasContext *dc, TCGv dst, TCGv addr, ...@@ -1147,23 +1147,8 @@ static void gen_load(DisasContext *dc, TCGv dst, TCGv addr,
cris_store_direct_jmp(dc); cris_store_direct_jmp(dc);
} }
if (size == 1) { tcg_gen_qemu_ld_tl(dst, addr, mem_index,
if (sign) { MO_TE + ctz32(size) + (sign ? MO_SIGN : 0));
tcg_gen_qemu_ld8s(dst, addr, mem_index);
} else {
tcg_gen_qemu_ld8u(dst, addr, mem_index);
}
} else if (size == 2) {
if (sign) {
tcg_gen_qemu_ld16s(dst, addr, mem_index);
} else {
tcg_gen_qemu_ld16u(dst, addr, mem_index);
}
} else if (size == 4) {
tcg_gen_qemu_ld32u(dst, addr, mem_index);
} else {
abort();
}
} }
static void gen_store (DisasContext *dc, TCGv addr, TCGv val, static void gen_store (DisasContext *dc, TCGv addr, TCGv val,
...@@ -1187,13 +1172,7 @@ static void gen_store (DisasContext *dc, TCGv addr, TCGv val, ...@@ -1187,13 +1172,7 @@ static void gen_store (DisasContext *dc, TCGv addr, TCGv val,
return; return;
} }
if (size == 1) { tcg_gen_qemu_st_tl(val, addr, mem_index, MO_TE + ctz32(size));
tcg_gen_qemu_st8(val, addr, mem_index);
} else if (size == 2) {
tcg_gen_qemu_st16(val, addr, mem_index);
} else {
tcg_gen_qemu_st32(val, addr, mem_index);
}
if (dc->flagx_known && dc->flags_x) { if (dc->flagx_known && dc->flags_x) {
cris_evaluate_flags(dc); cris_evaluate_flags(dc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册