qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH v2] coccinelle: add a script to optimize tcg


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [RFC PATCH v2] coccinelle: add a script to optimize tcg op using tcg_gen_extract()
Date: Thu, 11 May 2017 23:01:09 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Hi Markus,

On 05/11/2017 06:03 AM, Markus Armbruster wrote:
Philippe Mathieu-Daudé <address@hidden> writes:

Ok I just understood Richard explanation, so this patch is WRONG and I
need to get some real rest :(

Ha!  Get some sleep; we'll still be around in the morning ;)

On 05/10/2017 08:52 PM, Philippe Mathieu-Daudé wrote:
Apply this script using:

$ docker run -v `pwd`:`pwd` -w `pwd` petersenna/coccinelle \
    --sp-file scripts/coccinelle/tcg_gen_extract.cocci \
    --macro-file scripts/cocci-macro-file.h \
    --dir target \
    --in-place

Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---

This is a new version of the coccinelle script addressing Richard comments and
trying to do it correctly. Also changed license to GPLv2+.

The first rule matches, it calls a python2 script that basically checks the
target_ulong is not overflowed: (msk << ofs) >> sizeof(target_ulong) == 0

WRONG
[...]

Is this script likely to be rerun in the future?  If yes, keeping it in
scripts/coccinelle/ is a good idea.  If no, I recommend to store it in
the commit message instead.

It is unlikely to be rerun in the future, at least for this specific pattern. But it can be easily adapted for another TCG optimization.

I could not find much documentation about how to do a such script using Python, except on a thread [1]. If it is documented enough I think it is worth to keep it.

About putting it in each commit message, it is now 3 times bigger than the patch it generates!

Regards,

Phil.



reply via email to

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