qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/8] target/cris: optimize gen_swapb() using ext


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCH 4/8] target/cris: optimize gen_swapb() using extract op
Date: Thu, 11 May 2017 22:29:14 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Hi,

As reviewd by Richard this patch is WRONG, so need to further review :)

http://lists.nongnu.org/archive/html/qemu-devel/2017-05/msg02551.html

On 05/10/2017 05:05 PM, Philippe Mathieu-Daudé wrote:
Applied using Coccinelle script.

Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
 target/cris/translate.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/cris/translate.c b/target/cris/translate.c
index 0ee05ca02d..c03403ac62 100644
--- a/target/cris/translate.c
+++ b/target/cris/translate.c
@@ -442,8 +442,7 @@ static inline void t_gen_swapb(TCGv d, TCGv s)
     tcg_gen_mov_tl(org_s, s);
     tcg_gen_shli_tl(t, org_s, 8);
     tcg_gen_andi_tl(d, t, 0xff00ff00);
-    tcg_gen_shri_tl(t, org_s, 8);
-    tcg_gen_andi_tl(t, t, 0x00ff00ff);
+    tcg_gen_extract_tl(t, org_s, 8, 0x00ff00ff);
     tcg_gen_or_tl(d, d, t);
     tcg_temp_free(t);
     tcg_temp_free(org_s);


corrected Coccinelle script displays:

candidate at target/cris/translate.c:445
  op_size: tl/tl (same)
  low_bits: 8 (value: 0xff)
  len: 0xff00ff
  len_bits != low_bits
  candidate is NOT optimizable




reply via email to

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