qemu-ppc
[Top][All Lists]
Advanced

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

Re: [PATCH 02/24] tcg: Use tcg_gen_negsetcond_*


From: Richard Henderson
Subject: Re: [PATCH 02/24] tcg: Use tcg_gen_negsetcond_*
Date: Tue, 8 Aug 2023 09:04:30 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

On 8/8/23 08:55, Peter Maydell wrote:
On Tue, 8 Aug 2023 at 04:13, Richard Henderson
<richard.henderson@linaro.org> wrote:

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
  tcg/tcg-op-gvec.c | 6 ++----
  tcg/tcg-op.c      | 6 ++----
  2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/tcg/tcg-op-gvec.c b/tcg/tcg-op-gvec.c
index a062239804..e260a07c61 100644
--- a/tcg/tcg-op-gvec.c
+++ b/tcg/tcg-op-gvec.c
@@ -3692,8 +3692,7 @@ static void expand_cmp_i32(uint32_t dofs, uint32_t aofs, 
uint32_t bofs,
      for (i = 0; i < oprsz; i += 4) {
          tcg_gen_ld_i32(t0, cpu_env, aofs + i);
          tcg_gen_ld_i32(t1, cpu_env, bofs + i);
-        tcg_gen_setcond_i32(cond, t0, t0, t1);
-        tcg_gen_neg_i32(t0, t0);
+        tcg_gen_negsetcond_i32(cond, t0, t0, t1);
          tcg_gen_st_i32(t0, cpu_env, dofs + i);
      }

Is it not possible for the optimizer to notice "you did
a setcond followed by a neg, let me turn it into negsetcond
for you" ?

Not at present, no. That sort of peephole optimization is a bit more difficult than what we do at present.


r~




reply via email to

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