summaryrefslogtreecommitdiff
path: root/compiler/optimizing/loop_optimization.h
diff options
context:
space:
mode:
authorArtem Serov <artem.serov@linaro.org>2018-08-07 00:52:22 +0100
committerArtem Serov <artem.serov@linaro.org>2018-09-25 14:47:48 +0100
commitaaac0e3cbfe72217cad204d0122f2b73a602d2dd (patch)
treed148274452b3a409c9d6b8ef749c34185375d2ea /compiler/optimizing/loop_optimization.h
parent7dca45b9677c16a54347cdc0d08bfa2bdd94b464 (diff)
ART: ARM64: Support DotProd SIMD idiom.
Implement support for vectorization idiom which performs dot product of two vectors and adds the result to wider precision components in the accumulator. viz. DOT_PRODUCT([ a1, .. , am], [ x1, .. , xn ], [ y1, .. , yn ]) = [ a1 + sum(xi * yi), .. , am + sum(xj * yj) ], for m <= n, non-overlapping sums, for either both signed or both unsigned operands x, y. The patch shows up to 7x performance improvement on a micro benchmark on Cortex-A57. Test: 684-checker-simd-dotprod. Test: test-art-host, test-art-target. Change-Id: Ibab0d51f537fdecd1d84033197be3ebf5ec4e455
Diffstat (limited to 'compiler/optimizing/loop_optimization.h')
-rw-r--r--compiler/optimizing/loop_optimization.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/optimizing/loop_optimization.h b/compiler/optimizing/loop_optimization.h
index 2b202fda75..1a842c4bf3 100644
--- a/compiler/optimizing/loop_optimization.h
+++ b/compiler/optimizing/loop_optimization.h
@@ -82,6 +82,7 @@ class HLoopOptimization : public HOptimization {
kNoReduction = 1 << 9, // no reduction
kNoSAD = 1 << 10, // no sum of absolute differences (SAD)
kNoWideSAD = 1 << 11, // no sum of absolute differences (SAD) with operand widening
+ kNoDotProd = 1 << 12, // no dot product
};
/*
@@ -217,6 +218,11 @@ class HLoopOptimization : public HOptimization {
bool generate_code,
DataType::Type type,
uint64_t restrictions);
+ bool VectorizeDotProdIdiom(LoopNode* node,
+ HInstruction* instruction,
+ bool generate_code,
+ DataType::Type type,
+ uint64_t restrictions);
// Vectorization heuristics.
Alignment ComputeAlignment(HInstruction* offset,