[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 05/17] target/riscv: Use gpr_{src, dst} and tcg_constant_tl in ge
From: |
Richard Henderson |
Subject: |
[PATCH 05/17] target/riscv: Use gpr_{src, dst} and tcg_constant_tl in gen_grevi |
Date: |
Thu, 8 Jul 2021 21:25:56 -0700 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/riscv/translate.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/target/riscv/translate.c b/target/riscv/translate.c
index 7dedfd548b..6ad40e43b0 100644
--- a/target/riscv/translate.c
+++ b/target/riscv/translate.c
@@ -620,23 +620,16 @@ static void gen_sro(TCGv ret, TCGv arg1, TCGv arg2)
static bool gen_grevi(DisasContext *ctx, arg_grevi *a)
{
- TCGv source1 = tcg_temp_new();
- TCGv source2;
-
- gen_get_gpr(source1, a->rs1);
+ TCGv dest = gpr_dst(ctx, a->rd);
+ TCGv src1 = gpr_src(ctx, a->rs1);
if (a->shamt == (TARGET_LONG_BITS - 8)) {
/* rev8, byte swaps */
- tcg_gen_bswap_tl(source1, source1);
+ tcg_gen_bswap_tl(dest, src1);
} else {
- source2 = tcg_temp_new();
- tcg_gen_movi_tl(source2, a->shamt);
- gen_helper_grev(source1, source1, source2);
- tcg_temp_free(source2);
+ TCGv src2 = tcg_constant_tl(a->shamt);
+ gen_helper_grev(dest, src1, src2);
}
-
- gen_set_gpr(a->rd, source1);
- tcg_temp_free(source1);
return true;
}
--
2.25.1
- [PATCH 00/17] target/riscv: Use tcg_constant_*, Richard Henderson, 2021/07/09
- [PATCH 05/17] target/riscv: Use gpr_{src, dst} and tcg_constant_tl in gen_grevi,
Richard Henderson <=
- [PATCH 01/17] target/riscv: Use tcg_constant_*, Richard Henderson, 2021/07/09
- [PATCH 02/17] target/riscv: Introduce gpr_src, gpr_dst, Richard Henderson, 2021/07/09
- [PATCH 04/17] target/riscv: Use gpr_{src, dst} in word division operations, Richard Henderson, 2021/07/09
- [PATCH 03/17] target/riscv: Use gpr_{src,dst} in shift operations, Richard Henderson, 2021/07/09