[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 6/6] target/m68k: Reduce the scope of the 'zero' tcg
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH 6/6] target/m68k: Reduce the scope of the 'zero' tcg_temp |
Date: |
Sun, 10 Mar 2019 01:34:28 +0100 |
Reduce the scope of the 'zero' tcg_temp. Since this tcg_temp is
allocated with tcg_const_i32(), free it using tcg_temp_free_i32().
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
target/m68k/translate.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/target/m68k/translate.c b/target/m68k/translate.c
index b51b8a2a12..3f27079379 100644
--- a/target/m68k/translate.c
+++ b/target/m68k/translate.c
@@ -3664,7 +3664,7 @@ static void rotate_x_flags(TCGv reg, TCGv X, int size)
/* Result of rotate_x() is valid if 0 <= shift <= size */
static TCGv rotate_x(TCGv reg, TCGv shift, int left, int size)
{
- TCGv X, shl, shr, shx, sz, zero;
+ TCGv X, shl, shr, shx, sz;
sz = tcg_const_i32(size);
@@ -3672,14 +3672,14 @@ static TCGv rotate_x(TCGv reg, TCGv shift, int left,
int size)
shl = tcg_temp_new();
shx = tcg_temp_new();
if (left) {
+ TCGv zero = tcg_const_i32(0);
tcg_gen_mov_i32(shl, shift); /* shl = shift */
tcg_gen_movi_i32(shr, size + 1);
tcg_gen_sub_i32(shr, shr, shift); /* shr = size + 1 - shift */
tcg_gen_subi_i32(shx, shift, 1); /* shx = shift - 1 */
/* shx = shx < 0 ? size : shx; */
- zero = tcg_const_i32(0);
tcg_gen_movcond_i32(TCG_COND_LT, shx, shx, zero, sz, shx);
- tcg_temp_free(zero);
+ tcg_temp_free_i32(zero);
} else {
tcg_gen_mov_i32(shr, shift); /* shr = shift */
tcg_gen_movi_i32(shl, size + 1);
--
2.19.1
- [Qemu-devel] [PATCH 0/6] target/m68k: Optimize few instructions using deposit/extraxt_i32(), Philippe Mathieu-Daudé, 2019/03/09
- [Qemu-devel] [PATCH 1/6] target/m68k: Reduce the l1 TCGLabel scope, Philippe Mathieu-Daudé, 2019/03/09
- [Qemu-devel] [PATCH 2/6] target/m68k: Optimize the partset instruction using deposit_i32(), Philippe Mathieu-Daudé, 2019/03/09
- [Qemu-devel] [PATCH 3/6] target/m68k: Fix a tcg_temp leak, Philippe Mathieu-Daudé, 2019/03/09
- [Qemu-devel] [PATCH 4/6] target/m68k: Optimize get_sr() using deposit_i32(), Philippe Mathieu-Daudé, 2019/03/09
- [Qemu-devel] [PATCH 6/6] target/m68k: Reduce the scope of the 'zero' tcg_temp,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH 5/6] target/m68k: Optimize rotate_x() using extract_i32(), Philippe Mathieu-Daudé, 2019/03/09