[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 33/48] tcg/i386: Merge tcg_out_setcond{32,64}
From: |
Richard Henderson |
Subject: |
[PULL 33/48] tcg/i386: Merge tcg_out_setcond{32,64} |
Date: |
Wed, 23 Aug 2023 13:23:11 -0700 |
Pass a rexw parameter instead of duplicating the functions.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/i386/tcg-target.c.inc | 24 +++++++-----------------
1 file changed, 7 insertions(+), 17 deletions(-)
diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc
index 33f66ba204..010432d3a9 100644
--- a/tcg/i386/tcg-target.c.inc
+++ b/tcg/i386/tcg-target.c.inc
@@ -1527,23 +1527,16 @@ static void tcg_out_brcond2(TCGContext *s, const TCGArg
*args,
}
#endif
-static void tcg_out_setcond32(TCGContext *s, TCGCond cond, TCGArg dest,
- TCGArg arg1, TCGArg arg2, int const_arg2)
+static void tcg_out_setcond(TCGContext *s, int rexw, TCGCond cond,
+ TCGArg dest, TCGArg arg1, TCGArg arg2,
+ int const_arg2)
{
- tcg_out_cmp(s, arg1, arg2, const_arg2, 0);
+ tcg_out_cmp(s, arg1, arg2, const_arg2, rexw);
tcg_out_modrm(s, OPC_SETCC | tcg_cond_to_jcc[cond], 0, dest);
tcg_out_ext8u(s, dest, dest);
}
-#if TCG_TARGET_REG_BITS == 64
-static void tcg_out_setcond64(TCGContext *s, TCGCond cond, TCGArg dest,
- TCGArg arg1, TCGArg arg2, int const_arg2)
-{
- tcg_out_cmp(s, arg1, arg2, const_arg2, P_REXW);
- tcg_out_modrm(s, OPC_SETCC | tcg_cond_to_jcc[cond], 0, dest);
- tcg_out_ext8u(s, dest, dest);
-}
-#else
+#if TCG_TARGET_REG_BITS == 32
static void tcg_out_setcond2(TCGContext *s, const TCGArg *args,
const int *const_args)
{
@@ -2568,8 +2561,8 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode
opc,
tcg_out_brcond(s, rexw, a2, a0, a1, const_args[1],
arg_label(args[3]), 0);
break;
- case INDEX_op_setcond_i32:
- tcg_out_setcond32(s, args[3], a0, a1, a2, const_a2);
+ 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]);
@@ -2721,9 +2714,6 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode
opc,
}
break;
- case INDEX_op_setcond_i64:
- tcg_out_setcond64(s, args[3], a0, a1, a2, const_a2);
- break;
case INDEX_op_movcond_i64:
tcg_out_movcond64(s, args[5], a0, a1, a2, const_a2, args[3]);
break;
--
2.34.1
- [PULL 02/48] accel/hvf: Widen pc/saved_insn for hvf_sw_breakpoint, (continued)
- [PULL 02/48] accel/hvf: Widen pc/saved_insn for hvf_sw_breakpoint, Richard Henderson, 2023/08/23
- [PULL 05/48] include/exec: Replace target_ulong with abi_ptr in cpu_[st|ld]*(), Richard Henderson, 2023/08/23
- [PULL 34/48] tcg/i386: Merge tcg_out_movcond{32,64}, Richard Henderson, 2023/08/23
- [PULL 39/48] tcg/tcg-op: Document bswap16_i32() byte pattern, Richard Henderson, 2023/08/23
- [PULL 06/48] include/exec: typedef abi_ptr to vaddr in softmmu, Richard Henderson, 2023/08/23
- [PULL 01/48] accel/kvm: Widen pc/saved_insn for kvm_sw_breakpoint, Richard Henderson, 2023/08/23
- [PULL 32/48] tcg/i386: Merge tcg_out_brcond{32,64}, Richard Henderson, 2023/08/23
- [PULL 27/48] tcg/aarch64: Implement negsetcond_*, Richard Henderson, 2023/08/23
- [PULL 24/48] target/tricore: Replace gen_cond_w with tcg_gen_negsetcond_tl, Richard Henderson, 2023/08/23
- [PULL 31/48] tcg/sparc64: Implement negsetcond_*, Richard Henderson, 2023/08/23
- [PULL 33/48] tcg/i386: Merge tcg_out_setcond{32,64},
Richard Henderson <=
- [PULL 35/48] tcg/i386: Use CMP+SBB in tcg_out_setcond, Richard Henderson, 2023/08/23
- [PULL 20/48] target/m68k: Use tcg_gen_negsetcond_*, Richard Henderson, 2023/08/23
- [PULL 19/48] target/arm: Use tcg_gen_negsetcond_*, Richard Henderson, 2023/08/23
- [PULL 37/48] tcg/i386: Use shift in tcg_out_setcond, Richard Henderson, 2023/08/23
- [PULL 36/48] tcg/i386: Clear dest first in tcg_out_setcond if possible, Richard Henderson, 2023/08/23
- [PULL 13/48] tcg/i386: Allow immediate as input to deposit_*, Richard Henderson, 2023/08/23
- [PULL 14/48] docs/devel/tcg-ops: Bury mentions of trunc_shr_i64_i32(), Richard Henderson, 2023/08/23
- [PULL 07/48] include/exec: Widen tlb_hit/tlb_hit_page(), Richard Henderson, 2023/08/23
- [PULL 09/48] accel/tcg: Update run_on_cpu_data static assert, Richard Henderson, 2023/08/23
- [PULL 15/48] tcg: Unify TCG_TARGET_HAS_extr[lh]_i64_i32, Richard Henderson, 2023/08/23