qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v5 00/10] optimize various tcg_gen() functions using extract/deposit op
@ 2017-07-18  4:55 Philippe Mathieu-Daudé
  2017-07-18  4:55 ` [Qemu-devel] [PATCH v5 01/10] coccinelle: ignore ASTs pre-parsed cached C files Philippe Mathieu-Daudé
                   ` (10 more replies)
  0 siblings, 11 replies; 18+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-07-18  4:55 UTC (permalink / raw)
  To: Richard Henderson
  Cc: Philippe Mathieu-Daudé, qemu-devel, Aurelien Jarno,
	Laurent Vivier, Nikunj A Dadhania, Paolo Bonzini, Peter Maydell

Hi Richard,

Please find here the update series. Maybe you'll need to update the commit sha-1
58daf05d07dd in commits 3-8.

Regards,

Phil.

[v5]

- gitignore entries for cocci generated files
- cleaned/improved cocci script, updated usage
- fix output using Mersenne "number" instead of "prime" (Eric Blake)
- use deposit() on alpha and sparc (Richard Henderson)
- enable tci bswap16_i64()

[v4]

Tried to fix wrong previous attempt...
After getting some nice/fast pieces of advice from Coccinelle folks, I tried to
improved the script (not much inline documentation yet although).
- correctly check if this optimizable?
- document as Mersenne number instead of prime (Eric Blake)
- try to write Python code instead of BASIC (Markus Elfring advices)
- try to reduce regex usage
- try to match shri(); unrelated(); andi(); pattern to optimize, I was surprised
  to see the alpha diff Coccinelle found.

This is surely not the last version of this patchset, but I think now the
generated patches are correct and I prefer reviewers to look at them fixed
instead of wrong one in the ML.
Still lot of work to do in the cocci script, now it seems to hang trying to
parse "target/arm/translate.c".

[v3]

In my first attempt I misunderstood tcg_gen_extract() intrinsics, and Richard
Henderson pointed that out.
In this patchset the cocci script is corrected and clarified, it also print how
arguments are checked while running.
Also:
- incorrect patches have been removed. (Richard Henderson, Nikunj A Dadhania)
- Coccinelle script licensed GPLv2+ (Eric Blake)
- comment in each commit about how to apply the patch (Eric Blake)
- added Acked-by for m68k (Laurent Vivier)
- Cc: Coccinelle developers.

[v2]

Resent the cocci script.
 
[v1]

While reviewing a commit from Aurelien Jarno where he optimized a TCG generator
for SH-4 [1] I found the same optimization done on PPC by Nikunj A Dadhania few
months ago [2].
After asking on the ML about a cocci script [3] I thought it would be easier to
learn about Coccinelle.

citing Aurelien Jarno:
    This doesn't change the generated code on x86, but optimizes it on most
    RISC architectures and makes the code simpler to read.

I actually applied the script using the following command:

$ 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

Please review again! thanks.

[1] http://lists.nongnu.org/archive/html/qemu-devel/2017-05/msg01466.html
[2] http://lists.nongnu.org/archive/html/qemu-devel/2017-02/msg05211.html
[3] http://lists.nongnu.org/archive/html/qemu-devel/2017-05/msg01499.html

Philippe Mathieu-Daudé (10):
  coccinelle: ignore ASTs pre-parsed cached C files
  coccinelle: add a script to optimize tcg op using tcg_gen_extract()
  target/arm: optimize aarch64 rev16() using extract op
  target/m68k: optimize bcd_flags() using extract op
  target/ppc: optimize various functions using extract op
  target/sparc: optimize various functions using extract op
  target/sparc: optimize gen_op_mulscc() using extract op
  target/sparc: optimize gen_op_mulscc() using deposit op
  target/alpha: optimize gen_cvtlq() using extract op
  tcg/tci: enable bswap16_i64

 .gitignore                               |   2 +
 scripts/coccinelle/tcg_gen_extract.cocci | 107 +++++++++++++++++++++++++++++++
 target/alpha/translate.c                 |   8 +--
 target/arm/translate-a64.c               |   6 +-
 target/m68k/translate.c                  |   3 +-
 target/ppc/translate.c                   |  21 ++----
 target/ppc/translate/vsx-impl.inc.c      |  24 +++----
 target/sparc/translate.c                 |  20 ++----
 tcg/tci.c                                |   1 -
 9 files changed, 136 insertions(+), 56 deletions(-)
 create mode 100644 scripts/coccinelle/tcg_gen_extract.cocci

-- 
2.13.2

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

end of thread, other threads:[~2017-07-18 21:50 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-18  4:55 [Qemu-devel] [PATCH v5 00/10] optimize various tcg_gen() functions using extract/deposit op Philippe Mathieu-Daudé
2017-07-18  4:55 ` [Qemu-devel] [PATCH v5 01/10] coccinelle: ignore ASTs pre-parsed cached C files Philippe Mathieu-Daudé
2017-07-18 21:46   ` Eric Blake
2017-07-18  4:55 ` [Qemu-devel] [PATCH v5 02/10] coccinelle: add a script to optimize tcg op using tcg_gen_extract() Philippe Mathieu-Daudé
2017-07-18  4:55 ` [Qemu-devel] [PATCH v5 03/10] target/arm: optimize aarch64 rev16() using extract op Philippe Mathieu-Daudé
2017-07-18  6:25   ` Richard Henderson
2017-07-18  7:14     ` Aurelien Jarno
2017-07-18 20:06       ` Richard Henderson
2017-07-18 21:50   ` Eric Blake
2017-07-18  4:55 ` [Qemu-devel] [PATCH v5 04/10] target/m68k: optimize bcd_flags() " Philippe Mathieu-Daudé
2017-07-18  4:55 ` [Qemu-devel] [PATCH v5 05/10] target/ppc: optimize various functions " Philippe Mathieu-Daudé
2017-07-18  4:55 ` [Qemu-devel] [PATCH v5 06/10] target/sparc: " Philippe Mathieu-Daudé
2017-07-18  4:55 ` [Qemu-devel] [PATCH v5 07/10] target/sparc: optimize gen_op_mulscc() " Philippe Mathieu-Daudé
2017-07-18  6:26   ` Richard Henderson
2017-07-18  4:55 ` [Qemu-devel] [PATCH v5 08/10] target/sparc: optimize gen_op_mulscc() using deposit op Philippe Mathieu-Daudé
2017-07-18  4:55 ` [Qemu-devel] [PATCH v5 09/10] target/alpha: optimize gen_cvtlq() " Philippe Mathieu-Daudé
2017-07-18  4:55 ` [Qemu-devel] [PATCH v5 10/10] tcg/tci: enable bswap16_i64 Philippe Mathieu-Daudé
2017-07-18  6:27 ` [Qemu-devel] [PATCH v5 00/10] optimize various tcg_gen() functions using extract/deposit op 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).