qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 07/81] target/arm: Do not test TCG_TARGET_HAS_bitsel_vec


From: Richard Henderson
Subject: Re: [PATCH v2 07/81] target/arm: Do not test TCG_TARGET_HAS_bitsel_vec
Date: Wed, 8 Jan 2025 14:30:59 -0800
User-agent: Mozilla Thunderbird

On 1/8/25 14:14, Philippe Mathieu-Daudé wrote:
  static void gen_bsl1n_vec(unsigned vece, TCGv_vec d, TCGv_vec n,
                            TCGv_vec m, TCGv_vec k)
  {
-    if (TCG_TARGET_HAS_bitsel_vec) {
-        tcg_gen_not_vec(vece, n, n);
-        tcg_gen_bitsel_vec(vece, d, k, n, m);
-    } else {

Why aren't we doing the NOT n operation here?

-        tcg_gen_andc_vec(vece, n, k, n);
-        tcg_gen_andc_vec(vece, m, m, k);
-        tcg_gen_or_vec(vece, d, n, m);
-    }
+    tcg_gen_not_vec(vece, n, n);
+    tcg_gen_bitsel_vec(vece, d, k, n, m);

Pardon?  It's right there, unindented.

Sorry I'm not clear. Previous to your change, in the
TCG_TARGET_HAS_bitsel_vec side we use the NOT opcode,
but not in the other side where we expand, why?

Are you asking about the code being removed?

Recall that bitsel = (n & k) | (m & ~k).

Passing n = ~n' we get (~n & k) | (m & ~k),
                     = (k & ~n) | (m & ~k).

which is the two andc + or operations above.


r~



reply via email to

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