[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v4 1/6] coccinelle: add a script to optimize
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-devel] [RFC PATCH v4 1/6] coccinelle: add a script to optimize tcg op using tcg_gen_extract() |
Date: |
Mon, 15 May 2017 16:10:54 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 |
On 15/05/2017 16:06, Paolo Bonzini wrote:
>
>
> On 15/05/2017 16:04, Eric Blake wrote:
>> On 05/12/2017 06:38 PM, Philippe Mathieu-Daudé wrote:
>>> If you have coccinelle installed you can apply this script using:
>>>
>>> $ spatch \
>>> --macro-file scripts/cocci-macro-file.h \
>>> --dir target --in-place
>>>
>>> You can also use directly Peter Senna Tschudin docker image (easier):
>>>
>>> $ 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
>>>
>>> Then verified that no manual touchups are required.
>>>
>>> The following thread was helpful while writing this script:
>>>
>>> https://github.com/coccinelle/coccinelle/issues/86
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
>>> ---
>>> scripts/coccinelle/tcg_gen_extract.cocci | 103
>>> +++++++++++++++++++++++++++++++
>>> 1 file changed, 103 insertions(+)
>>> create mode 100644 scripts/coccinelle/tcg_gen_extract.cocci
>>
>> It's still not obvious to me whether we want this script in the tree (as
>> something we plan to rerun regularly to check for regressions), or just
>> in the commit message (useful for the one-time location of spots to
>> optimize, but something we don't anticipate repeating).
>
> I think it's useful. New backends can have this issue, plus it shows
> some advanced Coccinelle techniques.
>
I agree: I think it's a good idea to have a place in QEMU directory with
all past coccinelle scripts to help to write the new ones.
Laurent
- [Qemu-devel] [RFC PATCH v4 0/6] optimize various tcg_gen() functions using extract op, Philippe Mathieu-Daudé, 2017/05/12
- [Qemu-devel] [PATCH v4 2/6] target/alpha: optimize cvtlq() using extract op, Philippe Mathieu-Daudé, 2017/05/12
- [Qemu-devel] [PATCH v4 3/6] target/arm: optimize rev16() using extract op, Philippe Mathieu-Daudé, 2017/05/12
- [Qemu-devel] [PATCH v4 4/6] target/m68k: optimize bcd_flags() using extract op, Philippe Mathieu-Daudé, 2017/05/12
- [Qemu-devel] [PATCH v4 5/6] target/ppc: optimize various functions using extract op, Philippe Mathieu-Daudé, 2017/05/12
- [Qemu-devel] [PATCH v4 6/6] target/sparc: optimize various functions using extract op, Philippe Mathieu-Daudé, 2017/05/12