qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] tcg: Fix tcg gen for vectorized absolute value
@ 2020-08-13 16:18 Stephen Long
  2020-08-13 16:56 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Long @ 2020-08-13 16:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: richard.henderson

Signed-off-by: Stephen Long <steplong@quicinc.com>
---
 tcg/tcg-op-gvec.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Whoops, I forgot to add the signed off line.

diff --git a/tcg/tcg-op-gvec.c b/tcg/tcg-op-gvec.c
index 3707c0effb..793d4ba64c 100644
--- a/tcg/tcg-op-gvec.c
+++ b/tcg/tcg-op-gvec.c
@@ -2264,12 +2264,13 @@ static void gen_absv_mask(TCGv_i64 d, TCGv_i64 b, unsigned vece)
     tcg_gen_muli_i64(t, t, (1 << nbit) - 1);
 
     /*
-     * Invert (via xor -1) and add one (via sub -1).
+     * Invert (via xor -1) and add one.
      * Because of the ordering the msb is cleared,
      * so we never have carry into the next element.
      */
     tcg_gen_xor_i64(d, b, t);
-    tcg_gen_sub_i64(d, d, t);
+    tcg_gen_andi_i64(t, t, dup_const(vece, 1));
+    tcg_gen_add_i64(d, d, t);
 
     tcg_temp_free_i64(t);
 }
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] tcg: Fix tcg gen for vectorized absolute value
  2020-08-13 16:18 [PATCH v2] tcg: Fix tcg gen for vectorized absolute value Stephen Long
@ 2020-08-13 16:56 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2020-08-13 16:56 UTC (permalink / raw)
  To: Stephen Long, qemu-devel

On 8/13/20 9:18 AM, Stephen Long wrote:
> Signed-off-by: Stephen Long <steplong@quicinc.com>
> ---
>  tcg/tcg-op-gvec.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> Whoops, I forgot to add the signed off line.

Queued, copying the patch description from v1.

Which, by the way, should have been above the "---" line there as well, so that
it gets included in the commit message.


r~


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-13 16:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-13 16:18 [PATCH v2] tcg: Fix tcg gen for vectorized absolute value Stephen Long
2020-08-13 16:56 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).