* [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
* [Qemu-devel] [PATCH v5 01/10] coccinelle: ignore ASTs pre-parsed cached C files
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 ` 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é
` (9 subsequent siblings)
10 siblings, 1 reply; 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,
Eduardo Habkost, Eric Blake, Markus Armbruster
files generated using coccinelle tool: 'spatch --use-cache'
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
.gitignore | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.gitignore b/.gitignore
index 09c2363acf..cf65316863 100644
--- a/.gitignore
+++ b/.gitignore
@@ -116,6 +116,8 @@ tags
TAGS
docker-src.*
*~
+*.ast_raw
+*.depend_raw
trace.h
trace.c
trace-ust.h
--
2.13.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Qemu-devel] [PATCH v5 02/10] coccinelle: add a script to optimize tcg op using tcg_gen_extract()
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 4:55 ` 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é
` (8 subsequent siblings)
10 siblings, 0 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,
Eduardo Habkost, Eric Blake, Markus Armbruster
The following thread was helpful while writing this script:
https://github.com/coccinelle/coccinelle/issues/86
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
| 107 +++++++++++++++++++++++++++++++
1 file changed, 107 insertions(+)
create mode 100644 scripts/coccinelle/tcg_gen_extract.cocci
--git a/scripts/coccinelle/tcg_gen_extract.cocci b/scripts/coccinelle/tcg_gen_extract.cocci
new file mode 100644
index 0000000000..81e66a35ae
--- /dev/null
+++ b/scripts/coccinelle/tcg_gen_extract.cocci
@@ -0,0 +1,107 @@
+// optimize TCG using extract op
+//
+// Copyright: (C) 2017 Philippe Mathieu-Daudé. GPLv2+.
+// Confidence: High
+// Options: --macro-file scripts/cocci-macro-file.h
+//
+// Nikunj A Dadhania optimization:
+// http://lists.nongnu.org/archive/html/qemu-devel/2017-02/msg05211.html
+// Aurelien Jarno optimization:
+// http://lists.nongnu.org/archive/html/qemu-devel/2017-05/msg01466.html
+//
+// This script can be run either using spatch locally or via a docker image:
+//
+// $ spatch \
+// --macro-file scripts/cocci-macro-file.h \
+// --sp-file scripts/coccinelle/tcg_gen_extract.cocci \
+// --keep-comments --in-place \
+// --use-gitgrep --dir target
+//
+// $ docker run --rm -v `pwd`:`pwd` -w `pwd` philmd/coccinelle \
+// --macro-file scripts/cocci-macro-file.h \
+// --sp-file scripts/coccinelle/tcg_gen_extract.cocci \
+// --keep-comments --in-place \
+// --use-gitgrep --dir target
+
+@initialize:python@
+@@
+import sys
+fd = sys.stderr
+def debug(msg="", trailer="\n"):
+ fd.write("[DBG] " + msg + trailer)
+def low_bits_count(value):
+ bits_count = 0
+ while (value & (1 << bits_count)):
+ bits_count += 1
+ return bits_count
+def Mn(order): # Mersenne number
+ return (1 << order) - 1
+
+@match@
+identifier ret;
+metavariable arg;
+constant ofs, msk;
+position shr_p, and_p;
+@@
+(
+ tcg_gen_shri_i32@shr_p
+|
+ tcg_gen_shri_i64@shr_p
+|
+ tcg_gen_shri_tl@shr_p
+)(ret, arg, ofs);
+... WHEN != ret
+(
+ tcg_gen_andi_i32@and_p
+|
+ tcg_gen_andi_i64@and_p
+|
+ tcg_gen_andi_tl@and_p
+)(ret, ret, msk);
+
+@script:python verify_len depends on match@
+ret_s << match.ret;
+msk_s << match.msk;
+shr_p << match.shr_p;
+extract_len;
+@@
+is_optimizable = False
+debug("candidate at %s:%s" % (shr_p[0].file, shr_p[0].line))
+try: # only eval integer, no #define like 'SR_M' (cpp did this, else some headers are missing).
+ msk_v = long(msk_s.strip("UL"), 0)
+ msk_b = low_bits_count(msk_v)
+ if msk_b == 0:
+ debug(" value: 0x%x low_bits: %d" % (msk_v, msk_b))
+ else:
+ debug(" value: 0x%x low_bits: %d [Mersenne number: 0x%x]" % (msk_v, msk_b, Mn(msk_b)))
+ is_optimizable = Mn(msk_b) == msk_v # check low_bits
+ coccinelle.extract_len = "%d" % msk_b
+ debug(" candidate %s optimizable" % ("IS" if is_optimizable else "is NOT"))
+except:
+ debug(" ERROR (check included headers?)")
+cocci.include_match(is_optimizable)
+debug()
+
+@replacement depends on verify_len@
+identifier match.ret;
+metavariable match.arg;
+constant match.ofs, match.msk;
+position match.shr_p, match.and_p;
+identifier verify_len.extract_len;
+@@
+(
+-tcg_gen_shri_i32@shr_p(ret, arg, ofs);
++tcg_gen_extract_i32(ret, arg, ofs, extract_len);
+... WHEN != ret
+-tcg_gen_andi_i32@and_p(ret, ret, msk);
+|
+-tcg_gen_shri_i64@shr_p(ret, arg, ofs);
++tcg_gen_extract_i64(ret, arg, ofs, extract_len);
+... WHEN != ret
+-tcg_gen_andi_i64@and_p(ret, ret, msk);
+|
+-tcg_gen_shri_tl@shr_p(ret, arg, ofs);
++tcg_gen_extract_tl(ret, arg, ofs, extract_len);
+... WHEN != ret
+-tcg_gen_andi_tl@and_p(ret, ret, msk);
+)
--
2.13.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Qemu-devel] [PATCH v5 03/10] target/arm: optimize aarch64 rev16() using extract op
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 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 ` Philippe Mathieu-Daudé
2017-07-18 6:25 ` 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é
` (7 subsequent siblings)
10 siblings, 2 replies; 18+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-07-18 4:55 UTC (permalink / raw)
To: Richard Henderson, Peter Maydell
Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-arm, Aurelien Jarno,
Laurent Vivier, Nikunj A Dadhania, Paolo Bonzini
Aurelien Jarno denoted this function could be implemented more effectively using
the aarch32 rev16() pattern.
[http://lists.nongnu.org/archive/html/qemu-devel/2017-05/msg03180.html]
Done with the Coccinelle semantic patch from commit 58daf05d07dd
(see scripts/coccinelle/tcg_gen_extract.cocci)
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
Richard: maybe you need to update 58daf05d07dd to your commit...
target/arm/translate-a64.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index e55547d95d..8ade865481 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -4046,14 +4046,12 @@ static void handle_rev16(DisasContext *s, unsigned int sf,
tcg_gen_andi_i64(tcg_tmp, tcg_rn, 0xffff);
tcg_gen_bswap16_i64(tcg_rd, tcg_tmp);
- tcg_gen_shri_i64(tcg_tmp, tcg_rn, 16);
- tcg_gen_andi_i64(tcg_tmp, tcg_tmp, 0xffff);
+ tcg_gen_extract_i64(tcg_tmp, tcg_rn, 16, 16);
tcg_gen_bswap16_i64(tcg_tmp, tcg_tmp);
tcg_gen_deposit_i64(tcg_rd, tcg_rd, tcg_tmp, 16, 16);
if (sf) {
- tcg_gen_shri_i64(tcg_tmp, tcg_rn, 32);
- tcg_gen_andi_i64(tcg_tmp, tcg_tmp, 0xffff);
+ tcg_gen_extract_i64(tcg_tmp, tcg_rn, 32, 16);
tcg_gen_bswap16_i64(tcg_tmp, tcg_tmp);
tcg_gen_deposit_i64(tcg_rd, tcg_rd, tcg_tmp, 32, 16);
--
2.13.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Qemu-devel] [PATCH v5 04/10] target/m68k: optimize bcd_flags() using extract op
2017-07-18 4:55 [Qemu-devel] [PATCH v5 00/10] optimize various tcg_gen() functions using extract/deposit op Philippe Mathieu-Daudé
` (2 preceding siblings ...)
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 4:55 ` Philippe Mathieu-Daudé
2017-07-18 4:55 ` [Qemu-devel] [PATCH v5 05/10] target/ppc: optimize various functions " Philippe Mathieu-Daudé
` (6 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-07-18 4:55 UTC (permalink / raw)
To: Richard Henderson, Laurent Vivier
Cc: Philippe Mathieu-Daudé, qemu-devel, Aurelien Jarno,
Nikunj A Dadhania, Paolo Bonzini, Peter Maydell
Done with the Coccinelle semantic patch from commit 58daf05d07dd
(see scripts/coccinelle/tcg_gen_extract.cocci)
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
Richard: maybe you need to update 58daf05d07dd to your commit...
target/m68k/translate.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/target/m68k/translate.c b/target/m68k/translate.c
index 3a519b790d..e709e6cde2 100644
--- a/target/m68k/translate.c
+++ b/target/m68k/translate.c
@@ -1749,8 +1749,7 @@ static void bcd_flags(TCGv val)
tcg_gen_andi_i32(QREG_CC_C, val, 0x0ff);
tcg_gen_or_i32(QREG_CC_Z, QREG_CC_Z, QREG_CC_C);
- tcg_gen_shri_i32(QREG_CC_C, val, 8);
- tcg_gen_andi_i32(QREG_CC_C, QREG_CC_C, 1);
+ tcg_gen_extract_i32(QREG_CC_C, val, 8, 1);
tcg_gen_mov_i32(QREG_CC_X, QREG_CC_C);
}
--
2.13.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Qemu-devel] [PATCH v5 05/10] target/ppc: optimize various functions using extract op
2017-07-18 4:55 [Qemu-devel] [PATCH v5 00/10] optimize various tcg_gen() functions using extract/deposit op Philippe Mathieu-Daudé
` (3 preceding siblings ...)
2017-07-18 4:55 ` [Qemu-devel] [PATCH v5 04/10] target/m68k: optimize bcd_flags() " Philippe Mathieu-Daudé
@ 2017-07-18 4:55 ` Philippe Mathieu-Daudé
2017-07-18 4:55 ` [Qemu-devel] [PATCH v5 06/10] target/sparc: " Philippe Mathieu-Daudé
` (5 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-07-18 4:55 UTC (permalink / raw)
To: Richard Henderson, Alexander Graf, David Gibson
Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-ppc, Aurelien Jarno,
Laurent Vivier, Nikunj A Dadhania
Done with the Coccinelle semantic patch from commit 58daf05d07dd
(see scripts/coccinelle/tcg_gen_extract.cocci)
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
---
Richard: maybe you need to update 58daf05d07dd to your commit...
target/ppc/translate.c | 21 +++++++--------------
target/ppc/translate/vsx-impl.inc.c | 24 ++++++++----------------
2 files changed, 15 insertions(+), 30 deletions(-)
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index c0cd64d927..de271af52b 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -873,8 +873,7 @@ static inline void gen_op_arith_add(DisasContext *ctx, TCGv ret, TCGv arg1,
}
tcg_gen_xor_tl(cpu_ca, t0, t1); /* bits changed w/ carry */
tcg_temp_free(t1);
- tcg_gen_shri_tl(cpu_ca, cpu_ca, 32); /* extract bit 32 */
- tcg_gen_andi_tl(cpu_ca, cpu_ca, 1);
+ tcg_gen_extract_tl(cpu_ca, cpu_ca, 32, 1);
if (is_isa300(ctx)) {
tcg_gen_mov_tl(cpu_ca32, cpu_ca);
}
@@ -1404,8 +1403,7 @@ static inline void gen_op_arith_subf(DisasContext *ctx, TCGv ret, TCGv arg1,
tcg_temp_free(inv1);
tcg_gen_xor_tl(cpu_ca, t0, t1); /* bits changes w/ carry */
tcg_temp_free(t1);
- tcg_gen_shri_tl(cpu_ca, cpu_ca, 32); /* extract bit 32 */
- tcg_gen_andi_tl(cpu_ca, cpu_ca, 1);
+ tcg_gen_extract_tl(cpu_ca, cpu_ca, 32, 1);
if (is_isa300(ctx)) {
tcg_gen_mov_tl(cpu_ca32, cpu_ca);
}
@@ -4336,8 +4334,7 @@ static void gen_mfsrin(DisasContext *ctx)
CHK_SV;
t0 = tcg_temp_new();
- tcg_gen_shri_tl(t0, cpu_gpr[rB(ctx->opcode)], 28);
- tcg_gen_andi_tl(t0, t0, 0xF);
+ tcg_gen_extract_tl(t0, cpu_gpr[rB(ctx->opcode)], 28, 4);
gen_helper_load_sr(cpu_gpr[rD(ctx->opcode)], cpu_env, t0);
tcg_temp_free(t0);
#endif /* defined(CONFIG_USER_ONLY) */
@@ -4368,8 +4365,7 @@ static void gen_mtsrin(DisasContext *ctx)
CHK_SV;
t0 = tcg_temp_new();
- tcg_gen_shri_tl(t0, cpu_gpr[rB(ctx->opcode)], 28);
- tcg_gen_andi_tl(t0, t0, 0xF);
+ tcg_gen_extract_tl(t0, cpu_gpr[rB(ctx->opcode)], 28, 4);
gen_helper_store_sr(cpu_env, t0, cpu_gpr[rD(ctx->opcode)]);
tcg_temp_free(t0);
#endif /* defined(CONFIG_USER_ONLY) */
@@ -4403,8 +4399,7 @@ static void gen_mfsrin_64b(DisasContext *ctx)
CHK_SV;
t0 = tcg_temp_new();
- tcg_gen_shri_tl(t0, cpu_gpr[rB(ctx->opcode)], 28);
- tcg_gen_andi_tl(t0, t0, 0xF);
+ tcg_gen_extract_tl(t0, cpu_gpr[rB(ctx->opcode)], 28, 4);
gen_helper_load_sr(cpu_gpr[rD(ctx->opcode)], cpu_env, t0);
tcg_temp_free(t0);
#endif /* defined(CONFIG_USER_ONLY) */
@@ -4435,8 +4430,7 @@ static void gen_mtsrin_64b(DisasContext *ctx)
CHK_SV;
t0 = tcg_temp_new();
- tcg_gen_shri_tl(t0, cpu_gpr[rB(ctx->opcode)], 28);
- tcg_gen_andi_tl(t0, t0, 0xF);
+ tcg_gen_extract_tl(t0, cpu_gpr[rB(ctx->opcode)], 28, 4);
gen_helper_store_sr(cpu_env, t0, cpu_gpr[rS(ctx->opcode)]);
tcg_temp_free(t0);
#endif /* defined(CONFIG_USER_ONLY) */
@@ -5414,8 +5408,7 @@ static void gen_mfsri(DisasContext *ctx)
CHK_SV;
t0 = tcg_temp_new();
gen_addr_reg_index(ctx, t0);
- tcg_gen_shri_tl(t0, t0, 28);
- tcg_gen_andi_tl(t0, t0, 0xF);
+ tcg_gen_extract_tl(t0, t0, 28, 4);
gen_helper_load_sr(cpu_gpr[rd], cpu_env, t0);
tcg_temp_free(t0);
if (ra != 0 && ra != rd)
diff --git a/target/ppc/translate/vsx-impl.inc.c b/target/ppc/translate/vsx-impl.inc.c
index 7f12908029..85ed135d44 100644
--- a/target/ppc/translate/vsx-impl.inc.c
+++ b/target/ppc/translate/vsx-impl.inc.c
@@ -1248,8 +1248,7 @@ static void gen_xsxexpdp(DisasContext *ctx)
gen_exception(ctx, POWERPC_EXCP_VSXU);
return;
}
- tcg_gen_shri_i64(rt, cpu_vsrh(xB(ctx->opcode)), 52);
- tcg_gen_andi_i64(rt, rt, 0x7FF);
+ tcg_gen_extract_i64(rt, cpu_vsrh(xB(ctx->opcode)), 52, 11);
}
static void gen_xsxexpqp(DisasContext *ctx)
@@ -1262,8 +1261,7 @@ static void gen_xsxexpqp(DisasContext *ctx)
gen_exception(ctx, POWERPC_EXCP_VSXU);
return;
}
- tcg_gen_shri_i64(xth, xbh, 48);
- tcg_gen_andi_i64(xth, xth, 0x7FFF);
+ tcg_gen_extract_i64(xth, xbh, 48, 15);
tcg_gen_movi_i64(xtl, 0);
}
@@ -1323,8 +1321,7 @@ static void gen_xsxsigdp(DisasContext *ctx)
zr = tcg_const_i64(0);
nan = tcg_const_i64(2047);
- tcg_gen_shri_i64(exp, cpu_vsrh(xB(ctx->opcode)), 52);
- tcg_gen_andi_i64(exp, exp, 0x7FF);
+ tcg_gen_extract_i64(exp, cpu_vsrh(xB(ctx->opcode)), 52, 11);
tcg_gen_movi_i64(t0, 0x0010000000000000);
tcg_gen_movcond_i64(TCG_COND_EQ, t0, exp, zr, zr, t0);
tcg_gen_movcond_i64(TCG_COND_EQ, t0, exp, nan, zr, t0);
@@ -1352,8 +1349,7 @@ static void gen_xsxsigqp(DisasContext *ctx)
zr = tcg_const_i64(0);
nan = tcg_const_i64(32767);
- tcg_gen_shri_i64(exp, cpu_vsrh(rB(ctx->opcode) + 32), 48);
- tcg_gen_andi_i64(exp, exp, 0x7FFF);
+ tcg_gen_extract_i64(exp, cpu_vsrh(rB(ctx->opcode) + 32), 48, 15);
tcg_gen_movi_i64(t0, 0x0001000000000000);
tcg_gen_movcond_i64(TCG_COND_EQ, t0, exp, zr, zr, t0);
tcg_gen_movcond_i64(TCG_COND_EQ, t0, exp, nan, zr, t0);
@@ -1448,10 +1444,8 @@ static void gen_xvxexpdp(DisasContext *ctx)
gen_exception(ctx, POWERPC_EXCP_VSXU);
return;
}
- tcg_gen_shri_i64(xth, xbh, 52);
- tcg_gen_andi_i64(xth, xth, 0x7FF);
- tcg_gen_shri_i64(xtl, xbl, 52);
- tcg_gen_andi_i64(xtl, xtl, 0x7FF);
+ tcg_gen_extract_i64(xth, xbh, 52, 11);
+ tcg_gen_extract_i64(xtl, xbl, 52, 11);
}
GEN_VSX_HELPER_2(xvxsigsp, 0x00, 0x04, 0, PPC2_ISA300)
@@ -1474,16 +1468,14 @@ static void gen_xvxsigdp(DisasContext *ctx)
zr = tcg_const_i64(0);
nan = tcg_const_i64(2047);
- tcg_gen_shri_i64(exp, xbh, 52);
- tcg_gen_andi_i64(exp, exp, 0x7FF);
+ tcg_gen_extract_i64(exp, xbh, 52, 11);
tcg_gen_movi_i64(t0, 0x0010000000000000);
tcg_gen_movcond_i64(TCG_COND_EQ, t0, exp, zr, zr, t0);
tcg_gen_movcond_i64(TCG_COND_EQ, t0, exp, nan, zr, t0);
tcg_gen_andi_i64(xth, xbh, 0x000FFFFFFFFFFFFF);
tcg_gen_or_i64(xth, xth, t0);
- tcg_gen_shri_i64(exp, xbl, 52);
- tcg_gen_andi_i64(exp, exp, 0x7FF);
+ tcg_gen_extract_i64(exp, xbl, 52, 11);
tcg_gen_movi_i64(t0, 0x0010000000000000);
tcg_gen_movcond_i64(TCG_COND_EQ, t0, exp, zr, zr, t0);
tcg_gen_movcond_i64(TCG_COND_EQ, t0, exp, nan, zr, t0);
--
2.13.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Qemu-devel] [PATCH v5 06/10] target/sparc: optimize various functions using extract op
2017-07-18 4:55 [Qemu-devel] [PATCH v5 00/10] optimize various tcg_gen() functions using extract/deposit op Philippe Mathieu-Daudé
` (4 preceding siblings ...)
2017-07-18 4:55 ` [Qemu-devel] [PATCH v5 05/10] target/ppc: optimize various functions " Philippe Mathieu-Daudé
@ 2017-07-18 4:55 ` Philippe Mathieu-Daudé
2017-07-18 4:55 ` [Qemu-devel] [PATCH v5 07/10] target/sparc: optimize gen_op_mulscc() " Philippe Mathieu-Daudé
` (4 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-07-18 4:55 UTC (permalink / raw)
To: Richard Henderson, Artyom Tarasenko, Michael Tokarev
Cc: Philippe Mathieu-Daudé, qemu-devel, Aurelien Jarno,
Laurent Vivier, Nikunj A Dadhania, Peter Maydell
Done with the Coccinelle semantic patch from commit 58daf05d07dd
(see scripts/coccinelle/tcg_gen_extract.cocci)
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
Richard: maybe you need to update 58daf05d07dd to your commit...
target/sparc/translate.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/target/sparc/translate.c b/target/sparc/translate.c
index aa6734d54e..962ce08f80 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -380,29 +380,25 @@ static inline void gen_goto_tb(DisasContext *s, int tb_num,
static inline void gen_mov_reg_N(TCGv reg, TCGv_i32 src)
{
tcg_gen_extu_i32_tl(reg, src);
- tcg_gen_shri_tl(reg, reg, PSR_NEG_SHIFT);
- tcg_gen_andi_tl(reg, reg, 0x1);
+ tcg_gen_extract_tl(reg, reg, PSR_NEG_SHIFT, 1);
}
static inline void gen_mov_reg_Z(TCGv reg, TCGv_i32 src)
{
tcg_gen_extu_i32_tl(reg, src);
- tcg_gen_shri_tl(reg, reg, PSR_ZERO_SHIFT);
- tcg_gen_andi_tl(reg, reg, 0x1);
+ tcg_gen_extract_tl(reg, reg, PSR_ZERO_SHIFT, 1);
}
static inline void gen_mov_reg_V(TCGv reg, TCGv_i32 src)
{
tcg_gen_extu_i32_tl(reg, src);
- tcg_gen_shri_tl(reg, reg, PSR_OVF_SHIFT);
- tcg_gen_andi_tl(reg, reg, 0x1);
+ tcg_gen_extract_tl(reg, reg, PSR_OVF_SHIFT, 1);
}
static inline void gen_mov_reg_C(TCGv reg, TCGv_i32 src)
{
tcg_gen_extu_i32_tl(reg, src);
- tcg_gen_shri_tl(reg, reg, PSR_CARRY_SHIFT);
- tcg_gen_andi_tl(reg, reg, 0x1);
+ tcg_gen_extract_tl(reg, reg, PSR_CARRY_SHIFT, 1);
}
static inline void gen_op_add_cc(TCGv dst, TCGv src1, TCGv src2)
--
2.13.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Qemu-devel] [PATCH v5 07/10] target/sparc: optimize gen_op_mulscc() using extract op
2017-07-18 4:55 [Qemu-devel] [PATCH v5 00/10] optimize various tcg_gen() functions using extract/deposit op Philippe Mathieu-Daudé
` (5 preceding siblings ...)
2017-07-18 4:55 ` [Qemu-devel] [PATCH v5 06/10] target/sparc: " Philippe Mathieu-Daudé
@ 2017-07-18 4:55 ` 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é
` (3 subsequent siblings)
10 siblings, 1 reply; 18+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-07-18 4:55 UTC (permalink / raw)
To: Richard Henderson, Artyom Tarasenko, Michael Tokarev
Cc: Philippe Mathieu-Daudé, qemu-devel, Aurelien Jarno,
Laurent Vivier, Nikunj A Dadhania, Peter Maydell
Done with the Coccinelle semantic patch from commit 58daf05d07dd
(see scripts/coccinelle/tcg_gen_extract.cocci)
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
Richard: are you ok squashing it with previous commit?
maybe you need to update 58daf05d07dd to your commit...
target/sparc/translate.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/target/sparc/translate.c b/target/sparc/translate.c
index 962ce08f80..67a83b77cc 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -634,8 +634,7 @@ static inline void gen_op_mulscc(TCGv dst, TCGv src1, TCGv src2)
// env->y = (b2 << 31) | (env->y >> 1);
tcg_gen_andi_tl(r_temp, cpu_cc_src, 0x1);
tcg_gen_shli_tl(r_temp, r_temp, 31);
- tcg_gen_shri_tl(t0, cpu_y, 1);
- tcg_gen_andi_tl(t0, t0, 0x7fffffff);
+ tcg_gen_extract_tl(t0, cpu_y, 1, 31);
tcg_gen_or_tl(t0, t0, r_temp);
tcg_gen_andi_tl(cpu_y, t0, 0xffffffff);
--
2.13.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Qemu-devel] [PATCH v5 08/10] target/sparc: optimize gen_op_mulscc() using deposit op
2017-07-18 4:55 [Qemu-devel] [PATCH v5 00/10] optimize various tcg_gen() functions using extract/deposit op Philippe Mathieu-Daudé
` (6 preceding siblings ...)
2017-07-18 4:55 ` [Qemu-devel] [PATCH v5 07/10] target/sparc: optimize gen_op_mulscc() " Philippe Mathieu-Daudé
@ 2017-07-18 4:55 ` Philippe Mathieu-Daudé
2017-07-18 4:55 ` [Qemu-devel] [PATCH v5 09/10] target/alpha: optimize gen_cvtlq() " Philippe Mathieu-Daudé
` (2 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-07-18 4:55 UTC (permalink / raw)
To: Richard Henderson, Artyom Tarasenko, Michael Tokarev
Cc: Philippe Mathieu-Daudé, qemu-devel, Aurelien Jarno,
Laurent Vivier, Nikunj A Dadhania, Peter Maydell
Suggested-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/sparc/translate.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/target/sparc/translate.c b/target/sparc/translate.c
index 67a83b77cc..a425efb1f1 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -632,11 +632,8 @@ static inline void gen_op_mulscc(TCGv dst, TCGv src1, TCGv src2)
// b2 = T0 & 1;
// env->y = (b2 << 31) | (env->y >> 1);
- tcg_gen_andi_tl(r_temp, cpu_cc_src, 0x1);
- tcg_gen_shli_tl(r_temp, r_temp, 31);
tcg_gen_extract_tl(t0, cpu_y, 1, 31);
- tcg_gen_or_tl(t0, t0, r_temp);
- tcg_gen_andi_tl(cpu_y, t0, 0xffffffff);
+ tcg_gen_deposit_tl(cpu_y, cpu_y, cpu_cc_src, 31, 1);
// b1 = N ^ V;
gen_mov_reg_N(t0, cpu_psr);
--
2.13.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Qemu-devel] [PATCH v5 09/10] target/alpha: optimize gen_cvtlq() using deposit op
2017-07-18 4:55 [Qemu-devel] [PATCH v5 00/10] optimize various tcg_gen() functions using extract/deposit op Philippe Mathieu-Daudé
` (7 preceding siblings ...)
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 ` 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
10 siblings, 0 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
Suggested-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/alpha/translate.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/target/alpha/translate.c b/target/alpha/translate.c
index 232af9e177..2bffbae92f 100644
--- a/target/alpha/translate.c
+++ b/target/alpha/translate.c
@@ -756,11 +756,9 @@ static void gen_cvtlq(TCGv vc, TCGv vb)
/* The arithmetic right shift here, plus the sign-extended mask below
yields a sign-extended result without an explicit ext32s_i64. */
- tcg_gen_sari_i64(tmp, vb, 32);
- tcg_gen_shri_i64(vc, vb, 29);
- tcg_gen_andi_i64(tmp, tmp, (int32_t)0xc0000000);
- tcg_gen_andi_i64(vc, vc, 0x3fffffff);
- tcg_gen_or_i64(vc, vc, tmp);
+ tcg_gen_shri_i64(tmp, vb, 29);
+ tcg_gen_sari_i64(vc, vb, 32);
+ tcg_gen_deposit_i64(vc, vc, tmp, 0, 30);
tcg_temp_free(tmp);
}
--
2.13.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Qemu-devel] [PATCH v5 10/10] tcg/tci: enable bswap16_i64
2017-07-18 4:55 [Qemu-devel] [PATCH v5 00/10] optimize various tcg_gen() functions using extract/deposit op Philippe Mathieu-Daudé
` (8 preceding siblings ...)
2017-07-18 4:55 ` [Qemu-devel] [PATCH v5 09/10] target/alpha: optimize gen_cvtlq() " Philippe Mathieu-Daudé
@ 2017-07-18 4:55 ` 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
10 siblings, 0 replies; 18+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-07-18 4:55 UTC (permalink / raw)
To: Richard Henderson, Jaroslaw Pelczar, Alex Bennée, Eric Blake,
Stefan Weil
Cc: Philippe Mathieu-Daudé, qemu-devel, Aurelien Jarno,
Paolo Bonzini, Peter Maydell
Altough correctly implemented, bswap16_i64() never got tested/executed so the
safety TODO() statement was never removed.
Since it got now tested the TODO() can be removed.
while running Alex Bennée's image aarch64-linux-3.15rc2-buildroot.img:
Trace 0x7fa1904b0890 [0: ffffffc00036cd04]
----------------
IN:
0xffffffc00036cd24: 5ac00694 rev16 w20, w20
OP:
---- ffffffc00036cd24 0000000000000000 0000000000000000
ext32u_i64 tmp3,x20
ext16u_i64 tmp2,tmp3
bswap16_i64 x20,tmp2
movi_i64 tmp4,$0x10
shr_i64 tmp2,tmp3,tmp4
ext16u_i64 tmp2,tmp2
bswap16_i64 tmp2,tmp2
deposit_i64 x20,x20,tmp2,$0x10,$0x10
Linking TBs 0x7fa1904b0890 [ffffffc00036cd04] index 0 -> 0x7fa1904b0aa0 [ffffffc00036cd24]
Trace 0x7fa1904b0aa0 [0: ffffffc00036cd24]
TODO qemu/tci.c:1049: tcg_qemu_tb_exec()
qemu/tci.c:1049: tcg fatal error
Aborted
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Jaroslaw Pelczar <j.pelczar@samsung.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
---
tcg/tci.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/tcg/tci.c b/tcg/tci.c
index 4bdc645f2a..f39bfb95c0 100644
--- a/tcg/tci.c
+++ b/tcg/tci.c
@@ -1046,7 +1046,6 @@ uintptr_t tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr)
break;
#if TCG_TARGET_HAS_bswap16_i64
case INDEX_op_bswap16_i64:
- TODO();
t0 = *tb_ptr++;
t1 = tci_read_r16(&tb_ptr);
tci_write_reg64(t0, bswap16(t1));
--
2.13.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH v5 03/10] target/arm: optimize aarch64 rev16() using extract op
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 21:50 ` Eric Blake
1 sibling, 1 reply; 18+ messages in thread
From: Richard Henderson @ 2017-07-18 6:25 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, Peter Maydell
Cc: qemu-devel, qemu-arm, Aurelien Jarno, Laurent Vivier,
Nikunj A Dadhania, Paolo Bonzini
On 07/17/2017 06:55 PM, Philippe Mathieu-Daudé wrote:
> Aurelien Jarno denoted this function could be implemented more effectively using
> the aarch32 rev16() pattern.
> [http://lists.nongnu.org/archive/html/qemu-devel/2017-05/msg03180.html]
>
> Done with the Coccinelle semantic patch from commit 58daf05d07dd
> (see scripts/coccinelle/tcg_gen_extract.cocci)
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
I'm dropping this patch and replacing it with the much smaller code mentioned
in the message quoted above.
r~
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH v5 07/10] target/sparc: optimize gen_op_mulscc() using extract op
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
0 siblings, 0 replies; 18+ messages in thread
From: Richard Henderson @ 2017-07-18 6:26 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, Artyom Tarasenko, Michael Tokarev
Cc: qemu-devel, Aurelien Jarno, Laurent Vivier, Nikunj A Dadhania,
Peter Maydell
On 07/17/2017 06:55 PM, Philippe Mathieu-Daudé wrote:
> Done with the Coccinelle semantic patch from commit 58daf05d07dd
> (see scripts/coccinelle/tcg_gen_extract.cocci)
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>
> Richard: are you ok squashing it with previous commit?
> maybe you need to update 58daf05d07dd to your commit...
Yes, I've squashed this into the previous while applying.
r~
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH v5 00/10] optimize various tcg_gen() functions using extract/deposit op
2017-07-18 4:55 [Qemu-devel] [PATCH v5 00/10] optimize various tcg_gen() functions using extract/deposit op Philippe Mathieu-Daudé
` (9 preceding siblings ...)
2017-07-18 4:55 ` [Qemu-devel] [PATCH v5 10/10] tcg/tci: enable bswap16_i64 Philippe Mathieu-Daudé
@ 2017-07-18 6:27 ` Richard Henderson
10 siblings, 0 replies; 18+ messages in thread
From: Richard Henderson @ 2017-07-18 6:27 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Aurelien Jarno, Laurent Vivier, Nikunj A Dadhania,
Paolo Bonzini, Peter Maydell
On 07/17/2017 06:55 PM, Philippe Mathieu-Daudé wrote:
> 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()
Thanks. Applied to tcg-next.
I'll run the one new target/arm patch past the relevant maintainers before
flushing the queue.
r~
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH v5 03/10] target/arm: optimize aarch64 rev16() using extract op
2017-07-18 6:25 ` Richard Henderson
@ 2017-07-18 7:14 ` Aurelien Jarno
2017-07-18 20:06 ` Richard Henderson
0 siblings, 1 reply; 18+ messages in thread
From: Aurelien Jarno @ 2017-07-18 7:14 UTC (permalink / raw)
To: Richard Henderson
Cc: Philippe Mathieu-Daudé, Peter Maydell, qemu-devel, qemu-arm,
Laurent Vivier, Nikunj A Dadhania, Paolo Bonzini
On 2017-07-17 20:25, Richard Henderson wrote:
> On 07/17/2017 06:55 PM, Philippe Mathieu-Daudé wrote:
> > Aurelien Jarno denoted this function could be implemented more effectively using
> > the aarch32 rev16() pattern.
> > [http://lists.nongnu.org/archive/html/qemu-devel/2017-05/msg03180.html]
> >
> > Done with the Coccinelle semantic patch from commit 58daf05d07dd
> > (see scripts/coccinelle/tcg_gen_extract.cocci)
> >
> > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>
> I'm dropping this patch and replacing it with the much smaller code
> mentioned in the message quoted above.
In that case, could you also get the corresponding aarch32 patch:
http://lists.nongnu.org/archive/html/qemu-devel/2017-05/msg03887.html
It has already been reviewed.
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH v5 03/10] target/arm: optimize aarch64 rev16() using extract op
2017-07-18 7:14 ` Aurelien Jarno
@ 2017-07-18 20:06 ` Richard Henderson
0 siblings, 0 replies; 18+ messages in thread
From: Richard Henderson @ 2017-07-18 20:06 UTC (permalink / raw)
To: Aurelien Jarno
Cc: Philippe Mathieu-Daudé, Peter Maydell, qemu-devel, qemu-arm,
Laurent Vivier, Nikunj A Dadhania, Paolo Bonzini
On 07/17/2017 09:14 PM, Aurelien Jarno wrote:
> On 2017-07-17 20:25, Richard Henderson wrote:
>> On 07/17/2017 06:55 PM, Philippe Mathieu-Daudé wrote:
>>> Aurelien Jarno denoted this function could be implemented more effectively using
>>> the aarch32 rev16() pattern.
>>> [http://lists.nongnu.org/archive/html/qemu-devel/2017-05/msg03180.html]
>>>
>>> Done with the Coccinelle semantic patch from commit 58daf05d07dd
>>> (see scripts/coccinelle/tcg_gen_extract.cocci)
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>
>> I'm dropping this patch and replacing it with the much smaller code
>> mentioned in the message quoted above.
>
> In that case, could you also get the corresponding aarch32 patch:
> http://lists.nongnu.org/archive/html/qemu-devel/2017-05/msg03887.html
>
> It has already been reviewed.
>
Done.
r~
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH v5 01/10] coccinelle: ignore ASTs pre-parsed cached C files
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
0 siblings, 0 replies; 18+ messages in thread
From: Eric Blake @ 2017-07-18 21:46 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, Richard Henderson
Cc: qemu-devel, Aurelien Jarno, Laurent Vivier, Nikunj A Dadhania,
Paolo Bonzini, Peter Maydell, Eduardo Habkost, Markus Armbruster
[-- Attachment #1: Type: text/plain, Size: 688 bytes --]
On 07/17/2017 11:55 PM, Philippe Mathieu-Daudé wrote:
> files generated using coccinelle tool: 'spatch --use-cache'
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> .gitignore | 2 ++
> 1 file changed, 2 insertions(+)
Reviewed-by: Eric Blake <eblake@redhat.com>
>
> diff --git a/.gitignore b/.gitignore
> index 09c2363acf..cf65316863 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -116,6 +116,8 @@ tags
> TAGS
> docker-src.*
> *~
> +*.ast_raw
> +*.depend_raw
> trace.h
> trace.c
> trace-ust.h
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH v5 03/10] target/arm: optimize aarch64 rev16() using extract op
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 21:50 ` Eric Blake
1 sibling, 0 replies; 18+ messages in thread
From: Eric Blake @ 2017-07-18 21:50 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, Richard Henderson, Peter Maydell
Cc: Nikunj A Dadhania, qemu-devel, Laurent Vivier, qemu-arm,
Paolo Bonzini, Aurelien Jarno
[-- Attachment #1: Type: text/plain, Size: 1138 bytes --]
On 07/17/2017 11:55 PM, Philippe Mathieu-Daudé wrote:
> Aurelien Jarno denoted this function could be implemented more effectively using
> the aarch32 rev16() pattern.
> [http://lists.nongnu.org/archive/html/qemu-devel/2017-05/msg03180.html]
>
> Done with the Coccinelle semantic patch from commit 58daf05d07dd
This commit id is not stable, unless it gets merged as a PULL request
from you. When submitting a series, it's okay to just refer to "the
previous patch" or "an earlier patch" without a commit id, especially if
you know your patch will go through a different maintainer (and thus
change id's the moment it is modified to add an R-b or S-o-b).
> (see scripts/coccinelle/tcg_gen_extract.cocci)
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> Richard: maybe you need to update 58daf05d07dd to your commit...
Indeed, you already noticed that the maintainer has to do more work to
rewrite any commit messages that refer to mid-series patch ids.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
^ 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).