[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/8] target/mips: Use explicit extract32() calls in gen_msa_i5()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 6/8] target/mips: Use explicit extract32() calls in gen_msa_i5() |
Date: |
Sun, 3 Oct 2021 19:57:41 +0200 |
We already use sextract32(), use extract32() for completeness
instead of open-coding it.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/mips/tcg/msa_translate.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/target/mips/tcg/msa_translate.c b/target/mips/tcg/msa_translate.c
index e107cad57ee..3ef912da6b8 100644
--- a/target/mips/tcg/msa_translate.c
+++ b/target/mips/tcg/msa_translate.c
@@ -473,15 +473,12 @@ static void gen_msa_i8(DisasContext *ctx)
static void gen_msa_i5(DisasContext *ctx)
{
#define MASK_MSA_I5(op) (MASK_MSA_MINOR(op) | (op & (0x7 << 23)))
- uint8_t df = (ctx->opcode >> 21) & 0x3;
int8_t s5 = (int8_t) sextract32(ctx->opcode, 16, 5);
- uint8_t u5 = (ctx->opcode >> 16) & 0x1f;
- uint8_t ws = (ctx->opcode >> 11) & 0x1f;
- uint8_t wd = (ctx->opcode >> 6) & 0x1f;
+ uint8_t u5 = extract32(ctx->opcode, 16, 5);
- TCGv_i32 tdf = tcg_const_i32(df);
- TCGv_i32 twd = tcg_const_i32(wd);
- TCGv_i32 tws = tcg_const_i32(ws);
+ TCGv_i32 tdf = tcg_const_i32(extract32(ctx->opcode, 21, 2));
+ TCGv_i32 twd = tcg_const_i32(extract32(ctx->opcode, 11, 5));
+ TCGv_i32 tws = tcg_const_i32(extract32(ctx->opcode, 6, 5));
TCGv_i32 timm = tcg_temp_new_i32();
tcg_gen_movi_i32(timm, u5);
--
2.31.1
- [PATCH 0/8] target/mips: Use tcg_constant_*, Philippe Mathieu-Daudé, 2021/10/03
- [PATCH 1/8] target/mips: Remove unused register from MSA 2R/2RF instruction format, Philippe Mathieu-Daudé, 2021/10/03
- [PATCH 2/8] target/mips: Use tcg_constant_i32() in gen_msa_elm_df(), Philippe Mathieu-Daudé, 2021/10/03
- [PATCH 3/8] target/mips: Use tcg_constant_i32() in gen_msa_2rf(), Philippe Mathieu-Daudé, 2021/10/03
- [PATCH 4/8] target/mips: Use tcg_constant_i32() in gen_msa_2r(), Philippe Mathieu-Daudé, 2021/10/03
- [PATCH 5/8] target/mips: Use tcg_constant_i32() in gen_msa_3rf(), Philippe Mathieu-Daudé, 2021/10/03
- [PATCH 6/8] target/mips: Use explicit extract32() calls in gen_msa_i5(),
Philippe Mathieu-Daudé <=
- [PATCH 7/8] target/mips: Use tcg_constant_i32() in gen_msa_i5(), Philippe Mathieu-Daudé, 2021/10/03
- [PATCH 8/8] target/mips: Use tcg_constant_tl() in gen_compute_compact_branch(), Philippe Mathieu-Daudé, 2021/10/03
- Re: [PATCH 0/8] target/mips: Use tcg_constant_*, Philippe Mathieu-Daudé, 2021/10/11