Skip to content

Commit 469a316

Browse files
committed
target/mips: Use explicit extract32() calls in gen_msa_i5()
We already use sextract32(), use extract32() for completeness instead of open-coding it. Signed-off-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Richard Henderson <[email protected]> Message-Id: <[email protected]>
1 parent 1b5c0a1 commit 469a316

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

target/mips/tcg/msa_translate.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -473,15 +473,12 @@ static void gen_msa_i8(DisasContext *ctx)
473473
static void gen_msa_i5(DisasContext *ctx)
474474
{
475475
#define MASK_MSA_I5(op) (MASK_MSA_MINOR(op) | (op & (0x7 << 23)))
476-
uint8_t df = (ctx->opcode >> 21) & 0x3;
477476
int8_t s5 = (int8_t) sextract32(ctx->opcode, 16, 5);
478-
uint8_t u5 = (ctx->opcode >> 16) & 0x1f;
479-
uint8_t ws = (ctx->opcode >> 11) & 0x1f;
480-
uint8_t wd = (ctx->opcode >> 6) & 0x1f;
477+
uint8_t u5 = extract32(ctx->opcode, 16, 5);
481478

482-
TCGv_i32 tdf = tcg_const_i32(df);
483-
TCGv_i32 twd = tcg_const_i32(wd);
484-
TCGv_i32 tws = tcg_const_i32(ws);
479+
TCGv_i32 tdf = tcg_const_i32(extract32(ctx->opcode, 21, 2));
480+
TCGv_i32 twd = tcg_const_i32(extract32(ctx->opcode, 11, 5));
481+
TCGv_i32 tws = tcg_const_i32(extract32(ctx->opcode, 6, 5));
485482
TCGv_i32 timm = tcg_temp_new_i32();
486483
tcg_gen_movi_i32(timm, u5);
487484

0 commit comments

Comments
 (0)