Patchwork target-lm32: Use new qemu_ld/st opcodes

login
register
mail settings
Submitter Richard Henderson
Date Dec. 7, 2013, 2:03 a.m.
Message ID <1386381801-30251-1-git-send-email-rth@twiddle.net>
Download mbox | patch
Permalink /patch/298597/
State New
Headers show

Comments

Richard Henderson - Dec. 7, 2013, 2:03 a.m.
Cc: Michael Walle <michael@walle.cc>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target-lm32/translate.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
Michael Walle - Dec. 12, 2013, 10:18 p.m.
Hi Richard,

Am Samstag, 7. Dezember 2013, 03:03:21 schrieb Richard Henderson:
> Cc: Michael Walle <michael@walle.cc>
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
>  target-lm32/translate.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/target-lm32/translate.c b/target-lm32/translate.c
> index 6ea0ecd..3d2f2e8 100644
> --- a/target-lm32/translate.c
> +++ b/target-lm32/translate.c
> @@ -441,7 +441,7 @@ static void dec_lb(DisasContext *dc)
> 
>      t0 = tcg_temp_new();
>      tcg_gen_addi_tl(t0, cpu_R[dc->r0], sign_extend(dc->imm16, 16));
> -    tcg_gen_qemu_ld8s(cpu_R[dc->r1], t0, MEM_INDEX);
> +    tcg_gen_qemu_ld_tl(cpu_R[dc->r1], t0, MEM_INDEX, MO_SB);
>      tcg_temp_free(t0);
>  }
> 
> @@ -453,7 +453,7 @@ static void dec_lbu(DisasContext *dc)
> 
>      t0 = tcg_temp_new();
>      tcg_gen_addi_tl(t0, cpu_R[dc->r0], sign_extend(dc->imm16, 16));
> -    tcg_gen_qemu_ld8u(cpu_R[dc->r1], t0, MEM_INDEX);
> +    tcg_gen_qemu_ld_tl(cpu_R[dc->r1], t0, MEM_INDEX, MO_UB);
>      tcg_temp_free(t0);
>  }
> 
> @@ -465,7 +465,7 @@ static void dec_lh(DisasContext *dc)
> 
>      t0 = tcg_temp_new();
>      tcg_gen_addi_tl(t0, cpu_R[dc->r0], sign_extend(dc->imm16, 16));
> -    tcg_gen_qemu_ld16s(cpu_R[dc->r1], t0, MEM_INDEX);
> +    tcg_gen_qemu_ld_tl(cpu_R[dc->r1], t0, MEM_INDEX, MO_TESW);
>      tcg_temp_free(t0);
>  }
> 
> @@ -477,7 +477,7 @@ static void dec_lhu(DisasContext *dc)
> 
>      t0 = tcg_temp_new();
>      tcg_gen_addi_tl(t0, cpu_R[dc->r0], sign_extend(dc->imm16, 16));
> -    tcg_gen_qemu_ld16u(cpu_R[dc->r1], t0, MEM_INDEX);
> +    tcg_gen_qemu_ld_tl(cpu_R[dc->r1], t0, MEM_INDEX, MO_TEUW);
>      tcg_temp_free(t0);
>  }
> 
> @@ -489,7 +489,7 @@ static void dec_lw(DisasContext *dc)
> 
>      t0 = tcg_temp_new();
>      tcg_gen_addi_tl(t0, cpu_R[dc->r0], sign_extend(dc->imm16, 16));
> -    tcg_gen_qemu_ld32s(cpu_R[dc->r1], t0, MEM_INDEX);
> +    tcg_gen_qemu_ld_tl(cpu_R[dc->r1], t0, MEM_INDEX, MO_TEUL);

shouldn't this be MO_TESL?

>      tcg_temp_free(t0);
>  }
> 
> @@ -663,7 +663,7 @@ static void dec_sb(DisasContext *dc)
> 
>      t0 = tcg_temp_new();
>      tcg_gen_addi_tl(t0, cpu_R[dc->r0], sign_extend(dc->imm16, 16));
> -    tcg_gen_qemu_st8(cpu_R[dc->r1], t0, MEM_INDEX);
> +    tcg_gen_qemu_st_tl(cpu_R[dc->r1], t0, MEM_INDEX, MO_UB);
>      tcg_temp_free(t0);
>  }
> 
> @@ -697,7 +697,7 @@ static void dec_sh(DisasContext *dc)
> 
>      t0 = tcg_temp_new();
>      tcg_gen_addi_tl(t0, cpu_R[dc->r0], sign_extend(dc->imm16, 16));
> -    tcg_gen_qemu_st16(cpu_R[dc->r1], t0, MEM_INDEX);
> +    tcg_gen_qemu_st_tl(cpu_R[dc->r1], t0, MEM_INDEX, MO_TEUW);
>      tcg_temp_free(t0);
>  }
> 
> @@ -794,7 +794,7 @@ static void dec_sw(DisasContext *dc)
> 
>      t0 = tcg_temp_new();
>      tcg_gen_addi_tl(t0, cpu_R[dc->r0], sign_extend(dc->imm16, 16));
> -    tcg_gen_qemu_st32(cpu_R[dc->r1], t0, MEM_INDEX);
> +    tcg_gen_qemu_st_tl(cpu_R[dc->r1], t0, MEM_INDEX, MO_TEUL);
>      tcg_temp_free(t0);
>  }


-michael

Patch

diff --git a/target-lm32/translate.c b/target-lm32/translate.c
index 6ea0ecd..3d2f2e8 100644
--- a/target-lm32/translate.c
+++ b/target-lm32/translate.c
@@ -441,7 +441,7 @@  static void dec_lb(DisasContext *dc)
 
     t0 = tcg_temp_new();
     tcg_gen_addi_tl(t0, cpu_R[dc->r0], sign_extend(dc->imm16, 16));
-    tcg_gen_qemu_ld8s(cpu_R[dc->r1], t0, MEM_INDEX);
+    tcg_gen_qemu_ld_tl(cpu_R[dc->r1], t0, MEM_INDEX, MO_SB);
     tcg_temp_free(t0);
 }
 
@@ -453,7 +453,7 @@  static void dec_lbu(DisasContext *dc)
 
     t0 = tcg_temp_new();
     tcg_gen_addi_tl(t0, cpu_R[dc->r0], sign_extend(dc->imm16, 16));
-    tcg_gen_qemu_ld8u(cpu_R[dc->r1], t0, MEM_INDEX);
+    tcg_gen_qemu_ld_tl(cpu_R[dc->r1], t0, MEM_INDEX, MO_UB);
     tcg_temp_free(t0);
 }
 
@@ -465,7 +465,7 @@  static void dec_lh(DisasContext *dc)
 
     t0 = tcg_temp_new();
     tcg_gen_addi_tl(t0, cpu_R[dc->r0], sign_extend(dc->imm16, 16));
-    tcg_gen_qemu_ld16s(cpu_R[dc->r1], t0, MEM_INDEX);
+    tcg_gen_qemu_ld_tl(cpu_R[dc->r1], t0, MEM_INDEX, MO_TESW);
     tcg_temp_free(t0);
 }
 
@@ -477,7 +477,7 @@  static void dec_lhu(DisasContext *dc)
 
     t0 = tcg_temp_new();
     tcg_gen_addi_tl(t0, cpu_R[dc->r0], sign_extend(dc->imm16, 16));
-    tcg_gen_qemu_ld16u(cpu_R[dc->r1], t0, MEM_INDEX);
+    tcg_gen_qemu_ld_tl(cpu_R[dc->r1], t0, MEM_INDEX, MO_TEUW);
     tcg_temp_free(t0);
 }
 
@@ -489,7 +489,7 @@  static void dec_lw(DisasContext *dc)
 
     t0 = tcg_temp_new();
     tcg_gen_addi_tl(t0, cpu_R[dc->r0], sign_extend(dc->imm16, 16));
-    tcg_gen_qemu_ld32s(cpu_R[dc->r1], t0, MEM_INDEX);
+    tcg_gen_qemu_ld_tl(cpu_R[dc->r1], t0, MEM_INDEX, MO_TEUL);
     tcg_temp_free(t0);
 }
 
@@ -663,7 +663,7 @@  static void dec_sb(DisasContext *dc)
 
     t0 = tcg_temp_new();
     tcg_gen_addi_tl(t0, cpu_R[dc->r0], sign_extend(dc->imm16, 16));
-    tcg_gen_qemu_st8(cpu_R[dc->r1], t0, MEM_INDEX);
+    tcg_gen_qemu_st_tl(cpu_R[dc->r1], t0, MEM_INDEX, MO_UB);
     tcg_temp_free(t0);
 }
 
@@ -697,7 +697,7 @@  static void dec_sh(DisasContext *dc)
 
     t0 = tcg_temp_new();
     tcg_gen_addi_tl(t0, cpu_R[dc->r0], sign_extend(dc->imm16, 16));
-    tcg_gen_qemu_st16(cpu_R[dc->r1], t0, MEM_INDEX);
+    tcg_gen_qemu_st_tl(cpu_R[dc->r1], t0, MEM_INDEX, MO_TEUW);
     tcg_temp_free(t0);
 }
 
@@ -794,7 +794,7 @@  static void dec_sw(DisasContext *dc)
 
     t0 = tcg_temp_new();
     tcg_gen_addi_tl(t0, cpu_R[dc->r0], sign_extend(dc->imm16, 16));
-    tcg_gen_qemu_st32(cpu_R[dc->r1], t0, MEM_INDEX);
+    tcg_gen_qemu_st_tl(cpu_R[dc->r1], t0, MEM_INDEX, MO_TEUL);
     tcg_temp_free(t0);
 }