aboutsummaryrefslogtreecommitdiff
path: root/target-cris
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2013-12-07 14:52:34 +1300
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2013-12-08 09:36:02 +0100
commita1d22a367d5780c9553b2cd5a24f665534ce6ed6 (patch)
treeb5071a33746b1257b0430586e702c7f27f096bb7 /target-cris
parentd2aa90cda81ae3f860dd047ce5e37e0473452d54 (diff)
target-cris: Use new qemu_ld/st opcodes
Using the new opcodes we can reduce if/else trees to a single statement. Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com> Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'target-cris')
-rw-r--r--target-cris/translate.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/target-cris/translate.c b/target-cris/translate.c
index 5faa44c1ea..f990d591c7 100644
--- a/target-cris/translate.c
+++ b/target-cris/translate.c
@@ -1133,7 +1133,7 @@ static void gen_load64(DisasContext *dc, TCGv_i64 dst, TCGv addr)
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,
@@ -1147,23 +1147,8 @@ static void gen_load(DisasContext *dc, TCGv dst, TCGv addr,
cris_store_direct_jmp(dc);
}
- if (size == 1) {
- if (sign) {
- 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();
- }
+ tcg_gen_qemu_ld_tl(dst, addr, mem_index,
+ MO_TE + ctz32(size) + (sign ? MO_SIGN : 0));
}
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;
}
- if (size == 1) {
- 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);
- }
+ tcg_gen_qemu_st_tl(val, addr, mem_index, MO_TE + ctz32(size));
if (dc->flagx_known && dc->flags_x) {
cris_evaluate_flags(dc);