From dbbac8f812a866b1b53f3007721f66038d208549 Mon Sep 17 00:00:00 2001 From: Aart Bik Date: Fri, 1 Sep 2017 13:06:08 -0700 Subject: Implement Sum-of-Abs-Differences idiom recognition. Rationale: Currently just on ARM64 (x86 lacks proper support), using the SAD idiom yields great speedup on loops that compute the sum-of-abs-difference operation. Also includes some refinements around type conversions. Speedup ExoPlayerAudio (golem run): 1.3x on ARM64 1.1x on x86 Test: test-art-host test-art-target Bug: 64091002 Change-Id: Ia2b711d2bc23609a2ed50493dfe6719eedfe0130 --- compiler/optimizing/loop_optimization.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'compiler/optimizing/loop_optimization.h') diff --git a/compiler/optimizing/loop_optimization.h b/compiler/optimizing/loop_optimization.h index f34751815b..ae2ea76f47 100644 --- a/compiler/optimizing/loop_optimization.h +++ b/compiler/optimizing/loop_optimization.h @@ -75,6 +75,7 @@ class HLoopOptimization : public HOptimization { kNoMinMax = 1 << 8, // no min/max kNoStringCharAt = 1 << 9, // no StringCharAt kNoReduction = 1 << 10, // no reduction + kNoSAD = 1 << 11, // no sum of absolute differences (SAD) }; /* @@ -172,6 +173,11 @@ class HLoopOptimization : public HOptimization { bool generate_code, Primitive::Type type, uint64_t restrictions); + bool VectorizeSADIdiom(LoopNode* node, + HInstruction* instruction, + bool generate_code, + Primitive::Type type, + uint64_t restrictions); // Vectorization heuristics. bool IsVectorizationProfitable(int64_t trip_count); -- cgit v1.2.3-59-g8ed1b