qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 02/24] tcg/tci: Remove TCG_TARGET_HAS_* ifdefs


From: Stefan Weil
Subject: Re: [PATCH v3 02/24] tcg/tci: Remove TCG_TARGET_HAS_* ifdefs
Date: Sat, 30 Jan 2021 08:15:41 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.7.0

Am 30.01.21 um 07:47 schrieb Richard Henderson:

On 1/29/21 1:16 PM, Peter Maydell wrote:
On Fri, 29 Jan 2021 at 20:13, Richard Henderson
<richard.henderson@linaro.org> wrote:
The opcodes always exist, regardless of whether or not they
are enabled.  Remove the unnecessary ifdefs.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
  tcg/tci/tcg-target.c.inc | 82 ----------------------------------------
  1 file changed, 82 deletions(-)

diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc
index 9c45f5f88f..b62e14d5ce 100644
--- a/tcg/tci/tcg-target.c.inc
+++ b/tcg/tci/tcg-target.c.inc
@@ -71,70 +71,42 @@ static const TCGTargetOpDef tcg_target_op_defs[] = {
      { INDEX_op_add_i32, { R, RI, RI } },
      { INDEX_op_sub_i32, { R, RI, RI } },
      { INDEX_op_mul_i32, { R, RI, RI } },
-#if TCG_TARGET_HAS_div_i32
      { INDEX_op_div_i32, { R, R, R } },
      { INDEX_op_divu_i32, { R, R, R } },
      { INDEX_op_rem_i32, { R, R, R } },
      { INDEX_op_remu_i32, { R, R, R } },
-#elif TCG_TARGET_HAS_div2_i32
-    { INDEX_op_div2_i32, { R, R, "0", "1", R } },
-    { INDEX_op_divu2_i32, { R, R, "0", "1", R } },
-#endif
-#if TCG_TARGET_HAS_div_i64
      { INDEX_op_div_i64, { R, R, R } },
      { INDEX_op_divu_i64, { R, R, R } },
      { INDEX_op_rem_i64, { R, R, R } },
      { INDEX_op_remu_i64, { R, R, R } },
-#elif TCG_TARGET_HAS_div2_i64
-    { INDEX_op_div2_i64, { R, R, "0", "1", R } },
-    { INDEX_op_divu2_i64, { R, R, "0", "1", R } },
-#endif
Why are div2/divu2 special cases such that their entries
get deleted rather than unconditionally included ?
Because div/div2 are mutually exclusive.


Yes, that's correct, but as you wrote, "the opcodes always exist, regardless of whether or not they are enabled." The old code already shows that both cases are mutually exclusive.

If someone decides to use TCG_TARGET_HAS_div2_i64 instead of TCG_TARGET_HAS_div_i64 with TCI, that lines (in addition to the implementation of the opcodes) would be needed again.

Regards,

Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]