Skip to content

Commit

Permalink
tcg/mips: Conditionalize tcg_out_exts_i32_i64
Browse files Browse the repository at this point in the history
Since TCG_TYPE_I32 values are kept sign-extended in registers, we need not
extend if the register matches.  This is already relied upon by comparisons.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed May 2, 2023
1 parent 6887ff0 commit 7f98ec2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tcg/mips/tcg-target.c.inc
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,9 @@ static void tcg_out_ext32s(TCGContext *s, TCGReg rd, TCGReg rs)

static void tcg_out_exts_i32_i64(TCGContext *s, TCGReg rd, TCGReg rs)
{
tcg_out_ext32s(s, rd, rs);
if (rd != rs) {
tcg_out_ext32s(s, rd, rs);
}
}

static void tcg_out_extu_i32_i64(TCGContext *s, TCGReg rd, TCGReg rs)
Expand Down

0 comments on commit 7f98ec2

Please sign in to comment.