[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 19/23] tcg/i386: Merge tcg_out_movcond{32,64}
From: |
Richard Henderson |
Subject: |
[PATCH v2 19/23] tcg/i386: Merge tcg_out_movcond{32,64} |
Date: |
Fri, 18 Aug 2023 15:13:23 -0700 |
Pass a rexw parameter instead of duplicating the functions.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/i386/tcg-target.c.inc | 28 +++++++---------------------
1 file changed, 7 insertions(+), 21 deletions(-)
diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc
index 010432d3a9..1542afd94d 100644
--- a/tcg/i386/tcg-target.c.inc
+++ b/tcg/i386/tcg-target.c.inc
@@ -1593,24 +1593,14 @@ static void tcg_out_cmov(TCGContext *s, TCGCond cond,
int rexw,
}
}
-static void tcg_out_movcond32(TCGContext *s, TCGCond cond, TCGReg dest,
- TCGReg c1, TCGArg c2, int const_c2,
- TCGReg v1)
+static void tcg_out_movcond(TCGContext *s, int rexw, TCGCond cond,
+ TCGReg dest, TCGReg c1, TCGArg c2, int const_c2,
+ TCGReg v1)
{
- tcg_out_cmp(s, c1, c2, const_c2, 0);
- tcg_out_cmov(s, cond, 0, dest, v1);
+ tcg_out_cmp(s, c1, c2, const_c2, rexw);
+ tcg_out_cmov(s, cond, rexw, dest, v1);
}
-#if TCG_TARGET_REG_BITS == 64
-static void tcg_out_movcond64(TCGContext *s, TCGCond cond, TCGReg dest,
- TCGReg c1, TCGArg c2, int const_c2,
- TCGReg v1)
-{
- tcg_out_cmp(s, c1, c2, const_c2, P_REXW);
- tcg_out_cmov(s, cond, P_REXW, dest, v1);
-}
-#endif
-
static void tcg_out_ctz(TCGContext *s, int rexw, TCGReg dest, TCGReg arg1,
TCGArg arg2, bool const_a2)
{
@@ -2564,8 +2554,8 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode
opc,
OP_32_64(setcond):
tcg_out_setcond(s, rexw, args[3], a0, a1, a2, const_a2);
break;
- case INDEX_op_movcond_i32:
- tcg_out_movcond32(s, args[5], a0, a1, a2, const_a2, args[3]);
+ OP_32_64(movcond):
+ tcg_out_movcond(s, rexw, args[5], a0, a1, a2, const_a2, args[3]);
break;
OP_32_64(bswap16):
@@ -2714,10 +2704,6 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode
opc,
}
break;
- case INDEX_op_movcond_i64:
- tcg_out_movcond64(s, args[5], a0, a1, a2, const_a2, args[3]);
- break;
-
case INDEX_op_bswap64_i64:
tcg_out_bswap64(s, a0);
break;
--
2.34.1
- [PATCH v2 11/23] tcg/ppc: Use the Set Boolean Extension, (continued)
- [PATCH v2 11/23] tcg/ppc: Use the Set Boolean Extension, Richard Henderson, 2023/08/18
- [PATCH v2 12/23] tcg/aarch64: Implement negsetcond_*, Richard Henderson, 2023/08/18
- [PATCH v2 13/23] tcg/arm: Implement negsetcond_i32, Richard Henderson, 2023/08/18
- [PATCH v2 14/23] tcg/riscv: Implement negsetcond_*, Richard Henderson, 2023/08/18
- [PATCH v2 15/23] tcg/s390x: Implement negsetcond_*, Richard Henderson, 2023/08/18
- [PATCH v2 16/23] tcg/sparc64: Implement negsetcond_*, Richard Henderson, 2023/08/18
- [PATCH v2 17/23] tcg/i386: Merge tcg_out_brcond{32,64}, Richard Henderson, 2023/08/18
- [PATCH v2 18/23] tcg/i386: Merge tcg_out_setcond{32,64}, Richard Henderson, 2023/08/18
- [PATCH v2 19/23] tcg/i386: Merge tcg_out_movcond{32,64},
Richard Henderson <=
- [PATCH v2 20/23] tcg/i386: Use CMP+SBB in tcg_out_setcond, Richard Henderson, 2023/08/18
- [PATCH v2 21/23] tcg/i386: Clear dest first in tcg_out_setcond if possible, Richard Henderson, 2023/08/18
- [PATCH v2 22/23] tcg/i386: Use shift in tcg_out_setcond, Richard Henderson, 2023/08/18
- [PATCH v2 23/23] tcg/i386: Implement negsetcond_*, Richard Henderson, 2023/08/18