[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/8] target/mips: Simplify gen_helper() macros by using tcg_const
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 4/8] target/mips: Simplify gen_helper() macros by using tcg_constant_i32() |
Date: |
Mon, 16 Aug 2021 22:51:03 +0200 |
In all call sites the last argument is always used as a
read-only value, so we can replace tcg_const_i32() temporary
by tcg_constant_i32().
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/mips/tcg/translate.c | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
index a6df9beb670..3417fc433ff 100644
--- a/target/mips/tcg/translate.c
+++ b/target/mips/tcg/translate.c
@@ -1214,33 +1214,23 @@ TCGv_i64 fpu_f64[32];
#include "exec/gen-icount.h"
#define gen_helper_0e0i(name, arg) do { \
- TCGv_i32 helper_tmp = tcg_const_i32(arg); \
- gen_helper_##name(cpu_env, helper_tmp); \
- tcg_temp_free_i32(helper_tmp); \
+ gen_helper_##name(cpu_env, tcg_constant_i32(arg)); \
} while (0)
#define gen_helper_0e1i(name, arg1, arg2) do { \
- TCGv_i32 helper_tmp = tcg_const_i32(arg2); \
- gen_helper_##name(cpu_env, arg1, helper_tmp); \
- tcg_temp_free_i32(helper_tmp); \
+ gen_helper_##name(cpu_env, arg1, tcg_constant_i32(arg2)); \
} while (0)
#define gen_helper_1e0i(name, ret, arg1) do { \
- TCGv_i32 helper_tmp = tcg_const_i32(arg1); \
- gen_helper_##name(ret, cpu_env, helper_tmp); \
- tcg_temp_free_i32(helper_tmp); \
+ gen_helper_##name(ret, cpu_env, tcg_constant_i32(arg1)); \
} while (0)
#define gen_helper_1e1i(name, ret, arg1, arg2) do { \
- TCGv_i32 helper_tmp = tcg_const_i32(arg2); \
- gen_helper_##name(ret, cpu_env, arg1, helper_tmp); \
- tcg_temp_free_i32(helper_tmp); \
+ gen_helper_##name(ret, cpu_env, arg1, tcg_constant_i32(arg2));\
} while (0)
#define gen_helper_0e2i(name, arg1, arg2, arg3) do { \
- TCGv_i32 helper_tmp = tcg_const_i32(arg3); \
- gen_helper_##name(cpu_env, arg1, arg2, helper_tmp); \
- tcg_temp_free_i32(helper_tmp); \
+ gen_helper_##name(cpu_env, arg1, arg2, tcg_constant_i32(arg3));\
} while (0)
#define DISAS_STOP DISAS_TARGET_0
--
2.31.1
- [PATCH 0/8] target/mips: Housekeeping in gen_helper() macros, Philippe Mathieu-Daudé, 2021/08/16
- [PATCH 1/8] target/mips: Remove gen_helper_0e3i(), Philippe Mathieu-Daudé, 2021/08/16
- [PATCH 3/8] target/mips: Use tcg_constant_i32() in gen_helper_0e2i(), Philippe Mathieu-Daudé, 2021/08/16
- [PATCH 2/8] target/mips: Remove gen_helper_1e2i(), Philippe Mathieu-Daudé, 2021/08/16
- [PATCH 4/8] target/mips: Simplify gen_helper() macros by using tcg_constant_i32(),
Philippe Mathieu-Daudé <=
- [PATCH 5/8] target/mips: Inline gen_helper_1e1i() call in op_ld_INSN() macros, Philippe Mathieu-Daudé, 2021/08/16
- [PATCH 6/8] target/mips: Inline gen_helper_0e0i(), Philippe Mathieu-Daudé, 2021/08/16
- [PATCH 7/8] target/mips: Use tcg_constant_i32() in generate_exception_err(), Philippe Mathieu-Daudé, 2021/08/16
- [PATCH 8/8] target/mips: Define gen_helper() macros in translate.h, Philippe Mathieu-Daudé, 2021/08/16
- Re: [PATCH 0/8] target/mips: Housekeeping in gen_helper() macros, Richard Henderson, 2021/08/17