[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/14] target/openrisc: Use dc->zero in gen_add, gen_addc
|
From: |
Richard Henderson |
|
Subject: |
[PULL 12/14] target/openrisc: Use dc->zero in gen_add, gen_addc |
|
Date: |
Tue, 13 Jul 2021 09:42:09 -0700 |
We still need the t0 temporary for computing overflow,
but we do not need to initialize it to zero first.
Reviewed-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/openrisc/translate.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c
index 6aba4c2ffc..059da48475 100644
--- a/target/openrisc/translate.c
+++ b/target/openrisc/translate.c
@@ -199,10 +199,10 @@ static void gen_ove_cyov(DisasContext *dc)
static void gen_add(DisasContext *dc, TCGv dest, TCGv srca, TCGv srcb)
{
- TCGv t0 = tcg_const_tl(0);
+ TCGv t0 = tcg_temp_new();
TCGv res = tcg_temp_new();
- tcg_gen_add2_tl(res, cpu_sr_cy, srca, t0, srcb, t0);
+ tcg_gen_add2_tl(res, cpu_sr_cy, srca, dc->zero, srcb, dc->zero);
tcg_gen_xor_tl(cpu_sr_ov, srca, srcb);
tcg_gen_xor_tl(t0, res, srcb);
tcg_gen_andc_tl(cpu_sr_ov, t0, cpu_sr_ov);
@@ -216,11 +216,11 @@ static void gen_add(DisasContext *dc, TCGv dest, TCGv
srca, TCGv srcb)
static void gen_addc(DisasContext *dc, TCGv dest, TCGv srca, TCGv srcb)
{
- TCGv t0 = tcg_const_tl(0);
+ TCGv t0 = tcg_temp_new();
TCGv res = tcg_temp_new();
- tcg_gen_add2_tl(res, cpu_sr_cy, srca, t0, cpu_sr_cy, t0);
- tcg_gen_add2_tl(res, cpu_sr_cy, res, cpu_sr_cy, srcb, t0);
+ tcg_gen_add2_tl(res, cpu_sr_cy, srca, dc->zero, cpu_sr_cy, dc->zero);
+ tcg_gen_add2_tl(res, cpu_sr_cy, res, cpu_sr_cy, srcb, dc->zero);
tcg_gen_xor_tl(cpu_sr_ov, srca, srcb);
tcg_gen_xor_tl(t0, res, srcb);
tcg_gen_andc_tl(cpu_sr_ov, t0, cpu_sr_ov);
--
2.25.1
- [PULL 03/14] target/i386: Split out do_fninit, (continued)
- [PULL 03/14] target/i386: Split out do_fninit, Richard Henderson, 2021/07/13
- [PULL 02/14] target/i386: Trivial code motion and code style fix, Richard Henderson, 2021/07/13
- [PULL 05/14] target/alpha: Store set into rx flag, Richard Henderson, 2021/07/13
- [PULL 06/14] target/alpha: Use dest_sink for HW_RET temporary, Richard Henderson, 2021/07/13
- [PULL 04/14] target/i386: Correct implementation for FCS, FIP, FDS and FDP, Richard Henderson, 2021/07/13
- [PULL 07/14] target/alpha: Use tcg_constant_i64 for zero and lit, Richard Henderson, 2021/07/13
- [PULL 11/14] target/openrisc: Cache constant 0 in DisasContext, Richard Henderson, 2021/07/13
- [PULL 08/14] target/alpha: Use tcg_constant_* elsewhere, Richard Henderson, 2021/07/13
- [PULL 10/14] target/openrisc: Use tcg_constant_tl for dc->R0, Richard Henderson, 2021/07/13
- [PULL 09/14] target/openrisc: Use tcg_constant_*, Richard Henderson, 2021/07/13
- [PULL 12/14] target/openrisc: Use dc->zero in gen_add, gen_addc,
Richard Henderson <=
- [PULL 14/14] target/hppa: Clean up DisasCond, Richard Henderson, 2021/07/13
- [PULL 13/14] target/hppa: Use tcg_constant_*, Richard Henderson, 2021/07/13
- Re: [PULL 00/14] misc translator patch queue, Peter Maydell, 2021/07/14