From: SF Markus Elfring <elfring@users.sourceforge.net>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: Aurelien Jarno <aurelien@aurel32.net>,
Richard Henderson <rth@twiddle.net>,
Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>,
Eric Blake <eblake@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Laurent Vivier <lvivier@redhat.com>,
Michael Tokarev <mjt@tls.msk.ru>,
Eduardo Habkost <ehabkost@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Julia Lawall <julia.lawall@lip6.fr>,
Nicolas Palix <nicolas.palix@imag.fr>
Subject: Re: [Qemu-devel] [RFC PATCH v3 1/5] coccinelle: add a script to optimize tcg op using tcg_gen_extract()
Date: Fri, 12 May 2017 07:48:21 +0200 [thread overview]
Message-ID: <a1881660-43ef-b7b1-8642-eb1df934ae8a@users.sourceforge.net> (raw)
In-Reply-To: <20170512033543.6789-2-f4bug@amsat.org>
> create mode 100644 scripts/coccinelle/tcg_gen_extract.cocci
Will an other subdirectory be more appropriate for this SmPL script?
> +// Coccinelle helpful issue:
> +// https://github.com/coccinelle/coccinelle/issues/86
I am curious if such an information source will trigger further
software evolution.
How do you think about to mention also the corresponding topic
“Propagating values back from Python script to SmPL rule with other metavariable
type than “identifier”” just for the case that the issue number can be fragile?
> +@match@ // match shri*+andi* pattern, calls script verify_len
> +identifier ret, arg;
> +constant ofs, len;
> +identifier shr_fn =~ "^tcg_gen_shri_";
> +identifier and_fn =~ "^tcg_gen_andi_";
> +position shr_p;
> +position and_p;
> +@@
> +(
> +shr_fn@shr_p(ret, arg, ofs);
> +and_fn@and_p(ret, ret, len);
> +)
My software development attention was caught also a bit by this specification.
How much do you care for coding style there?
* Two repeated SmPL key words while using the variable list functionality before.
* I wonder about the relevance for the parentheses.
Did you try to express a disjunction for the semantic patch language
besides the usage of two function (or macro) calls?
> + print " candidate", "IS" if is_optimizable else "is NOT", "optimizable"
Would you like to move this information display into a separate function?
Do you care if the “print” is the usage of a function call or a statement?
https://docs.python.org/3.0/whatsnew/3.0.html#print-is-a-function
> +-shr_fn@shr_p(ret, arg, ofs);
> +-and_fn@and_p(ret, ret, len);
> ++extract_fn(ret, arg, ofs, len);
Are there any more cases to consider for the sown function call replacement?
Regards,
Markus
next prev parent reply other threads:[~2017-05-12 5:49 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-12 3:35 [Qemu-devel] [PATCH v3 0/5] optimize various tcg_gen() functions using extract op Philippe Mathieu-Daudé
2017-05-12 3:35 ` [Qemu-devel] [RFC PATCH v3 1/5] coccinelle: add a script to optimize tcg op using tcg_gen_extract() Philippe Mathieu-Daudé
2017-05-12 3:41 ` Julia Lawall
2017-05-12 5:36 ` Philippe Mathieu-Daudé
2017-05-12 7:16 ` Julia Lawall
2017-05-12 7:39 ` SF Markus Elfring
2017-05-12 17:49 ` Eric Blake
2017-05-12 5:48 ` SF Markus Elfring [this message]
2017-05-12 11:00 ` SF Markus Elfring
2017-05-12 3:35 ` [Qemu-devel] [PATCH v3 2/5] target/arm: optimize rev16() using extract op Philippe Mathieu-Daudé
2017-05-12 16:50 ` Richard Henderson
2017-05-12 18:21 ` Aurelien Jarno
2017-05-12 19:05 ` Richard Henderson
2017-05-12 19:22 ` Aurelien Jarno
2017-05-12 19:38 ` Richard Henderson
2017-05-12 23:50 ` Philippe Mathieu-Daudé
2017-05-12 3:35 ` [Qemu-devel] [PATCH v3 3/5] target/m68k: optimize bcd_flags() " Philippe Mathieu-Daudé
2017-05-12 3:35 ` [Qemu-devel] [PATCH v3 4/5] target/ppc: using various functions " Philippe Mathieu-Daudé
2017-05-12 23:48 ` Philippe Mathieu-Daudé
2017-05-12 3:35 ` [Qemu-devel] [PATCH v3 5/5] target/sparc: optimize " Philippe Mathieu-Daudé
2017-05-12 23:49 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a1881660-43ef-b7b1-8642-eb1df934ae8a@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=armbru@redhat.com \
--cc=aurelien@aurel32.net \
--cc=eblake@redhat.com \
--cc=ehabkost@redhat.com \
--cc=f4bug@amsat.org \
--cc=julia.lawall@lip6.fr \
--cc=lvivier@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=nicolas.palix@imag.fr \
--cc=nikunj@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).