Skip to content

Commit

Permalink
tcg/loongarch64: 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,
via ".w" instructions, 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 2899062 commit 341ac0a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tcg/loongarch64/tcg-target.c.inc
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,9 @@ static void tcg_out_ext32s(TCGContext *s, TCGReg ret, TCGReg arg)

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

static void tcg_out_extu_i32_i64(TCGContext *s, TCGReg ret, TCGReg arg)
Expand Down

0 comments on commit 341ac0a

Please sign in to comment.