[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 10/54] tcg/loongarch64: Conditionalize tcg_out_exts_i32_i64
From: |
Richard Henderson |
Subject: |
[PATCH v2 10/54] tcg/loongarch64: Conditionalize tcg_out_exts_i32_i64 |
Date: |
Mon, 10 Apr 2023 18:04:28 -0700 |
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.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/loongarch64/tcg-target.c.inc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc
index 989632e08a..b2146988be 100644
--- a/tcg/loongarch64/tcg-target.c.inc
+++ b/tcg/loongarch64/tcg-target.c.inc
@@ -458,7 +458,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_clzctz(TCGContext *s, LoongArchInsn opc,
--
2.34.1
- Re: [PATCH v2 04/54] tcg: Split out tcg_out_ext8u, (continued)
- [PATCH v2 03/54] tcg: Split out tcg_out_ext8s, Richard Henderson, 2023/04/10
- [PATCH v2 06/54] tcg: Split out tcg_out_ext16u, Richard Henderson, 2023/04/10
- [PATCH v2 07/54] tcg: Split out tcg_out_ext32s, Richard Henderson, 2023/04/10
- [PATCH v2 08/54] tcg: Split out tcg_out_ext32u, Richard Henderson, 2023/04/10
- [PATCH v2 10/54] tcg/loongarch64: Conditionalize tcg_out_exts_i32_i64,
Richard Henderson <=
- [PATCH v2 09/54] tcg: Split out tcg_out_exts_i32_i64, Richard Henderson, 2023/04/10
- [PATCH v2 11/54] tcg/mips: Conditionalize tcg_out_exts_i32_i64, Richard Henderson, 2023/04/10
- [PATCH v2 12/54] tcg/riscv: Conditionalize tcg_out_exts_i32_i64, Richard Henderson, 2023/04/10
- [PATCH v2 13/54] tcg: Split out tcg_out_extu_i32_i64, Richard Henderson, 2023/04/10
- [PATCH v2 20/54] tcg/i386: Rationalize args to tcg_out_qemu_{ld,st}, Richard Henderson, 2023/04/10
- [PATCH v2 21/54] tcg/aarch64: Rationalize args to tcg_out_qemu_{ld, st}, Richard Henderson, 2023/04/10